# Functions
No description provided by the author
No description provided by the author
Base64DiffSuppress compares two Base64 strings, ignoring differences between standard encoding and web safe URL encoding, padding, and embedded line endings.
This function replaces references to Terraform properties (in the form of {{var}}) with their value in Terraform It also replaces {{project}}, {{project_id_or_project}}, {{region}}, and {{zone}} with their appropriate values This function supports URL-encoding the result by prepending '%' to the field name e.g.
Given two sets of references (with "from" values in self link form), determine which need to be added or removed // during an update using addX/removeX APIs.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CheckGoogleIamPolicy makes assertions about the contents of a google_iam_policy data source's policy_data attribute.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Compare only the resource name of two self links/paths.
CompareSelfLinkOrResourceName checks if two resources are the same resource
Use this method when the field accepts either a name or a self_link referencing a resource.
Compare only the relative path of two self links.
Compare only the relative path of two self links.
Convert between two types by converting to/from JSON.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
When converting to a map, we can't use setOmittedFields because FieldByName fails.
DatasourceSchemaFromResourceSchema is a recursive func that converts an existing Resource schema to a Datasource schema.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Suppress diffs for duration format.
No description provided by the author
No description provided by the author
No description provided by the author
The core logic for EmptyOrUnsetBlockDiffSuppress, in a format that is more conducive to unit testing.
ExpandBuildEnvironmentVariables pulls the value of "build_environment_variables" out of a schema.ResourceData as a map[string]string.
ExpandEffectiveLabels pulls the value of "effective_labels" out of a TerraformResourceData as a map[string]string.
ExpandEnvironmentVariables pulls the value of "environment_variables" out of a schema.ResourceData as a map[string]string.
ExpandLabels pulls the value of "labels" out of a TerraformResourceData as a map[string]string.
No description provided by the author
ExpandStringMap pulls the value of key out of a TerraformResourceData as a map[string]string.
ExtractFieldByPattern returns the value of a field extracted from a parent field according to the given regular expression pattern.
No description provided by the author
return a fake 404 so requests get retried or nested objects are considered deleted.
fixDatasourceSchemaFlags is a convenience func that toggles the Computed, Optional + Required flags on a schema element.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetBillingProject reads the "billing_project" field from the given resource data and falls back to the provider's value if not given.
No description provided by the author
No description provided by the author
No description provided by the author
Parse an import id extracting field values using the given list of regexes.
No description provided by the author
GetLocation attempts to get values in this order (if they exist): - location argument in the resource config - region argument in the resource config - zone argument in the resource config - region argument in the provider config - zone argument set in the provider config.
given a full locational (non-global) self link, returns the project + region/zone + name or an error.
GetProject reads the "project" field from the given resource data and falls back to the provider's value if not given.
GetProjectFromDiff reads the "project" field from the given diff and falls back to the provider's value if not given.
No description provided by the author
No description provided by the author
Infers the region based on the following (in order of priority): - `region` field in resource schema - region extracted from the `zone` field in resource schema - provider-level region - region extracted from the provider-level zone.
No description provided by the author
getRegionFromDiff reads the "region" field from the given diff and falls back to the provider's value if not given.
This function supports selflinks that have regions and locations in their paths.
Infers the region based on the following (in order of priority): - `regionSchemaField` in resource schema - region extracted from the `zoneSchemaField` in resource schema - provider-level region - region extracted from the provider-level zone.
GetRegionFromZone returns the region from a zone for Google cloud.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetUniverse reads the "universe_domain" field from the given resource data and falls back to the provider's value if not given.
No description provided by the author
No description provided by the author
GetZone reads the "zone" value from the given resource data and falls back to provider's value if not given.
getZoneFromDiff reads the "zone" field from the given diff and falls back to the provider's value if not given.
No description provided by the author
Hashcode hashes a string to a unique hashcode.
InterfaceSliceToStringSlice converts a []interface{} containing strings to []string.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
gRPC does not return errors of type *googleapi.Error.
No description provided by the author
No description provided by the author
Upgrade the field "labels" in the state to exclude the labels with the labels prefix and the field "effective_labels" to have all of labels, including the labels with the labels prefix.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Parses a global field supporting 5 different formats: - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/global/{resource_type}/{resource_name} - projects/{my_project}/global/{resource_type}/{resource_name} - global/{resource_type}/{resource_name} - resource_name - "" (empty string).
No description provided by the author
Parse an import id extracting field values using the given list of regexes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Parses an organization field with the following formats: - organizations/{my_organizations}/{resource_type}/{resource_name}.
Parses a project field with the following formats: - projects/{my_projects}/{resource_type}/{resource_name}.
Parses a regional field supporting 5 different formats: - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/regions/{region}/{resource_type}/{resource_name} - projects/{my_project}/regions/{region}/{resource_type}/{resource_name} - regions/{region}/{resource_type}/{resource_name} - resource_name - "" (empty string).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Parses a zonal field supporting 5 different formats: - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} - projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} - zones/{zone}/{resource_type}/{resource_name} - resource_name - "" (empty string).
Parses a zonal field supporting 5 different formats: - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} - projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} - zones/{zone}/{resource_type}/{resource_name} - resource_name - "" (empty string).
Suppress diffs when the value read from api has the project ID instead of the project number.
Suppress diffs when the value read from api has the project number instead of the project name.
id.UniqueId() returns a timestamp + incremental hash This function truncates the timestamp to provide a prefix + 9 using YYmmdd + last 3 digits of the incremental hash.
No description provided by the author
relaceVarsForId shortens variables by running them through GetResourceNameFromSelfLink this allows us to use long forms of variables from configs without needing custom id formats.
This function isn't a test of transport.go; instead, it is used as an alternative to ReplaceVars inside tests.
ReplaceVars must be done recursively because there are baseUrls that can contain references to regions (eg cloudrun service) there aren't any cases known for 2+ recursion but we will track a run away substitution as 10+ calls to allow for future use cases.
No description provided by the author
Hash the name path of a self link.
Hash the relative path of a self link.
ServiceAccountFQN will attempt to generate the fully qualified name in the format of:
"projects/(-|<project>)/serviceAccounts/<service_account_id>@<project>.iam.gserviceaccount.com" A project is required if we are trying to build the FQN from a service account id and and error will be returned in this case if no project is set in the resource or the provider-level config.
No description provided by the author
Sets the "annotations" field with the value of the field "effective_annotations" for data sources.
Sets the "labels" field and "terraform_labels" with the value of the field "effective_labels" for data sources.
The CustomizeDiff func to set the values of terraform_labels and effective_labels fields when labels field is at the root level and has a diffent name (e.g.
SetLabels is called in the READ method of the resources to set the field "labels" and "terraform_labels" in the state based on the labels field in the configuration.
The CustomizeDiff func to set the values of terraform_labels and effective_labels fields when labels field is at the root level and named "labels".
No description provided by the author
No description provided by the author
No description provided by the author
Used to create populated schema.ResourceData structs in tests.
No description provided by the author
SortMapsByConfigOrder takes a slice of map[string]interface{} from a TF config and API data, and returns a new slice containing the API data, reorderd to match the TF config as closely as possible (with new items at the end of the list.) idKey is be used to extract a string key from the values in the slice.
SortStringsByConfigOrder takes a slice of map[string]interface{} from a TF config and API data, and returns a new slice containing the API data, reorderd to match the TF config as closely as possible (with new items at the end of the list.).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Upgrade the field "terraform_labels" in the state to have the value of filed "labels" when it is not set but "labels" field is set in the state.
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
Wraps Op.Error in an implementation of built-in Error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
The cloud resource manager API operation is an example of one of many interchangeable API operations.
No description provided by the author