Documentation ¶
Index ¶
- Variables
- func AddExternalTagsField() config.ResourceOption
- func CLIReconciledResourceList() []string
- func DocumentationForTags() config.ResourceOption
- func FormattedIdentifierFromProvider(separator string, keys ...string) config.ExternalName
- func FormattedIdentifierUserDefinedNameFirst(param, separator string, keys ...string) config.ExternalName
- func FormattedIdentifierUserDefinedNameLast(param, separator string, keys ...string) config.ExternalName
- func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider, error)
- func GroupKindOverrides() config.ResourceOption
- func IdentifierAssignedByAWS() config.ResourceOption
- func KindOverrides() config.ResourceOption
- func KnownReferencers() config.ResourceOption
- func NamePrefixRemoval() config.ResourceOption
- func NoForkResourceList() []string
- func RegionAddition() config.ResourceOption
- func ResourceConfigurator() config.ResourceOption
- func TagsAllRemoval() config.ResourceOption
- func TemplatedStringAsIdentifierWithNoName(tmpl string) config.ExternalName
- type GroupKindCalculator
Constants ¶
This section is empty.
Variables ¶
var CLIReconciledExternalNameConfigs = map[string]config.ExternalName{ "aws_vpc_security_group_egress_rule": vpcSecurityGroupRule(), "aws_vpc_security_group_ingress_rule": vpcSecurityGroupRule(), "aws_appconfig_environment": config.IdentifierFromProvider, "aws_cognito_user_pool_client": FormattedIdentifierFromProvider("", "name"), "aws_simpledb_domain": config.NameAsIdentifier, }
var ExternalNameNotTestedConfigs = map[string]config.ExternalName{}/* 209 elements not displayed */
ExternalNameNotTestedConfigs contains no-tested configurations for this provider.
var GroupMap = map[string]GroupKindCalculator{}/* 251 elements not displayed */
GroupMap contains all overrides we'd like to make to the default group search. It's written with data from TF Provider AWS repo service grouping in here: https://github.com/hashicorp/terraform-provider-aws/tree/main/internal/service
At the end, all of them are based on grouping of the AWS Go SDK. The initial grouping is calculated based on folder grouping of AWS TF Provider which is based on Go SDK. Here is the script used to fetch that list: https://gist.github.com/muvaf/8d61365ffc1df7757864422ba16d7819
var KindMap = map[string]string{
"aws_autoscaling_group": "AutoscalingGroup",
"aws_cloudformation_type": "CloudFormationType",
"aws_cloudtrail": "Trail",
"aws_config_configuration_recorder_status": "AWSConfigurationRecorderStatus",
}
KindMap contains kind string overrides.
var NoForkExternalNameConfigs = map[string]config.ExternalName{}/* 909 elements not displayed */
NoForkExternalNameConfigs contains all external name configurations belonging to Terraform resources to be reconciled under the no-fork architecture for this provider.
Functions ¶
func AddExternalTagsField ¶
func AddExternalTagsField() config.ResourceOption
AddExternalTagsField adds ExternalTagsFieldName configuration for resources that have tags field.
func CLIReconciledResourceList ¶ added in v0.44.0
func CLIReconciledResourceList() []string
CLIReconciledResourceList returns the list of resources that have external name configured in ExternalNameConfigs table and to be reconciled under the TF CLI based architecture.
func DocumentationForTags ¶ added in v0.19.0
func DocumentationForTags() config.ResourceOption
DocumentationForTags overrides the API documentation of the tags fields since it contains Terraform-specific feature call out.
func FormattedIdentifierFromProvider ¶
func FormattedIdentifierFromProvider(separator string, keys ...string) config.ExternalName
FormattedIdentifierFromProvider is a helper function to construct Terraform IDs that use elements from the parameters in a certain string format. It should be used in cases where all information in the ID is gathered from the spec and not user defined like name. For example, zone_id:vpc_id.
func FormattedIdentifierUserDefinedNameFirst ¶ added in v0.22.0
func FormattedIdentifierUserDefinedNameFirst(param, separator string, keys ...string) config.ExternalName
FormattedIdentifierUserDefinedNameFirst is used in cases where the ID is constructed using some of the spec fields as well as a field that users use to name the resource. For example, budget_name:product_id where product_id comes from spec but budget_name is a naming field we can use external name for. This function assumes that the naming field is the FIRST component in the constructed identifier, which may not always hold (e.g., aws_eks_addon).
func FormattedIdentifierUserDefinedNameLast ¶ added in v0.22.0
func FormattedIdentifierUserDefinedNameLast(param, separator string, keys ...string) config.ExternalName
FormattedIdentifierUserDefinedNameLast is used in cases where the ID is constructed using some of the spec fields as well as a field that users use to name the resource. For example, vpc_id:cluster_name where vpc_id comes from spec but cluster_name is a naming field we can use external name for. This function assumes that the naming field is the LAST component in the constructed identifier, which may not always hold (e.g., aws_servicecatalog_budget_resource_association).
func GetProvider ¶
GetProvider returns the provider configuration. The `generationProvider` argument specifies whether the provider configuration is being read for the code generation pipelines. In that case, we will only use the JSON schema for generating the CRDs.
func GroupKindOverrides ¶
func GroupKindOverrides() config.ResourceOption
GroupKindOverrides overrides the group and kind of the resource if it matches any entry in the GroupMap.
func IdentifierAssignedByAWS ¶
func IdentifierAssignedByAWS() config.ResourceOption
IdentifierAssignedByAWS will work for all AWS types because even if the ID is assigned by user, we'll see it in the TF State ID. The resource-specific configurations should override this whenever possible.
func KindOverrides ¶
func KindOverrides() config.ResourceOption
KindOverrides overrides the kind of the resources given in KindMap.
func KnownReferencers ¶
func KnownReferencers() config.ResourceOption
KnownReferencers adds referencers for fields that are known and common among more than a few resources.
func NamePrefixRemoval ¶
func NamePrefixRemoval() config.ResourceOption
NamePrefixRemoval makes sure we remove name_prefix from all since it is mostly for Terraform functionality.
func NoForkResourceList ¶ added in v0.44.0
func NoForkResourceList() []string
NoForkResourceList returns the list of resources that have external name configured in ExternalNameConfigs table and to be reconciled under the no-fork architecture.
func RegionAddition ¶
func RegionAddition() config.ResourceOption
RegionAddition adds region to the spec of all resources except iam group which does not have a region notion.
func ResourceConfigurator ¶ added in v0.44.0
func ResourceConfigurator() config.ResourceOption
ResourceConfigurator applies all external name configs listed in the table NoForkExternalNameConfigs and CLIReconciledExternalNameConfigs and sets the version of those resources to v1beta1. For those resource in NoForkExternalNameConfigs, it also sets config.Resource.UseNoForkClient to `true`.
func TagsAllRemoval ¶
func TagsAllRemoval() config.ResourceOption
TagsAllRemoval removes the tags_all field that is used only in tfstate to accumulate provider-wide default tags in TF, which is not something we support. So, we don't need it as a parameter while "tags" is already in place.
func TemplatedStringAsIdentifierWithNoName ¶
func TemplatedStringAsIdentifierWithNoName(tmpl string) config.ExternalName
TemplatedStringAsIdentifierWithNoName uses TemplatedStringAsIdentifier but without the name initializer. This allows it to be used in cases where the ID is constructed with parameters and a provider-defined value, meaning no user-defined input. Since the external name is not user-defined, the name initializer has to be disabled.
Types ¶
type GroupKindCalculator ¶
GroupKindCalculator returns the correct group and kind name for given TF resource.
func ReplaceGroupWords ¶
func ReplaceGroupWords(group string, count int) GroupKindCalculator
ReplaceGroupWords uses given group as the group of the resource and removes a number of words in resource name before calculating the kind of the resource.