config

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GroupMap = map[string]GroupKindCalculator{}/* 228 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

View Source
var IncludedResources = []string{

	"aws_lb$",
	"aws_lb_listener$",
	"aws_lb_target_group$",
	"aws_lb_target_group_attachment$",

	"aws_ecr_repository$",
	"aws_ecrpublic_repository$",

	"aws_rds_cluster$",
	"aws_db_instance$",
	"aws_db_parameter_group$",
	"aws_db_subnet_group$",

	"aws_s3_bucket$",

	"aws_elasticache_cluster$",
	"aws_elasticache_subnet_group$",
	"aws_elasticache_parameter_group$",
	"aws_elasticache_replication_group$",
	"aws_elasticache_user$",
	"aws_elasticache_user_group$",

	"aws_ecs_cluster$",
	"aws_ecs_service$",
	"aws_ecs_capacity_provider$",
	"aws_ecs_tag$",
	"aws_ecs_task_definition$",

	"aws_autoscaling_group$",
	"aws_autoscaling_attachment$",

	"aws_instance$",
	"aws_eip$",
	"aws_launch_template$",
	"aws_ec2_transit_gateway$",
	"aws_ec2_transit_gateway_route$",
	"aws_ec2_transit_gateway_route_table$",
	"aws_ec2_transit_gateway_route_table_association$",
	"aws_ec2_transit_gateway_vpc_attachment$",
	"aws_ec2_transit_gateway_vpc_attachment_accepter$",
	"aws_ec2_transit_gateway_route_table_propagation$",
	"aws_vpc$",
	"aws_security_group$",
	"aws_security_group_rule$",
	"aws_subnet$",
	"aws_network_interface$",
	"aws_route$",
	"aws_route_table$",
	"aws_vpc_endpoint$",
	"aws_vpc_ipv4_cidr_block_association$",
	"aws_vpc_peering_connection$",
	"aws_route_table_association$",
	"aws_internet_gateway$",

	"aws_iam_access_key$",
	"aws_iam_group$",
	"aws_iam_group_policy$",
	"aws_iam_group_policy_attachment$",
	"aws_iam_instance_profile$",
	"aws_iam_policy$",
	"aws_iam_policy_attachment$",
	"aws_iam_role$",
	"aws_iam_role_policy$",
	"aws_iam_role_policy_attachment$",
	"aws_iam_user$",
	"aws_iam_user_group_membership$",
	"aws_iam_user_policy$",
	"aws_iam_user_policy_attachment$",
	"aws_iam_openid_connect_provider$",

	"aws_eks_addon$",
	"aws_eks_cluster$",
	"aws_eks_fargate_profile$",
	"aws_eks_node_group$",
	"aws_eks_identity_provider_config$",

	"aws_kms_key$",

	"aws_ebs_volume$",

	"aws_route53_.*",

	"aws_neptune_cluster$",
	"aws_neptune_cluster_endpoint$",
	"aws_neptune_cluster_instance$",
	"aws_neptune_cluster_parameter_group$",
	"aws_neptune_cluster_snapshot$",
	"aws_neptune_event_subscription",
	"aws_neptune_parameter_group$",
	"aws_neptune_subnet_group$",

	"aws_mq_broker$",
	"aws_mq_configuration$",

	"aws_globalaccelerator_accelerator",
	"aws_globalaccelerator_endpoint_group",
	"aws_globalaccelerator_listener",
}

IncludedResources lists all resource patterns included in small set release.

View Source
var KindMap = map[string]string{
	"aws_autoscaling_group":                    "AutoscalingGroup",
	"aws_cloudformation_type":                  "CloudFormationType",
	"aws_config_configuration_recorder_status": "AWSConfigurationRecorderStatus",
	"aws_cloudtrail":                           "Trail",
}

KindMap contains kind string overrides.

Functions

func AddExternalTagsField added in v0.5.0

func AddExternalTagsField() tjconfig.ResourceOption

AddExternalTagsField adds ExternalTagsFieldName configuration for resources that have tags field.

func DefaultResource

func DefaultResource(opts ...tjconfig.ResourceOption) tjconfig.DefaultResourceFn

DefaultResource returns a DefaultResoruceFn that makes sure the original DefaultResource call is made with given options here.

func GetProvider

func GetProvider() *tjconfig.Provider

GetProvider returns provider configuration

func GroupKindOverrides added in v0.4.0

func GroupKindOverrides() tjconfig.ResourceOption

GroupKindOverrides overrides the group and kind of the resource if it matches any entry in the GroupMap.

func IdentifierAssignedByAWS

func IdentifierAssignedByAWS() tjconfig.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 added in v0.4.0

func KindOverrides() tjconfig.ResourceOption

KindOverrides overrides the kind of the resources given in KindMap.

func KnownReferencers added in v0.4.0

func KnownReferencers() tjconfig.ResourceOption

KnownReferencers adds referencers for fields that are known and common among more than a few resources.

func NamePrefixRemoval

func NamePrefixRemoval() tjconfig.ResourceOption

NamePrefixRemoval makes sure we remove name_prefix from all since it is mostly for Terraform functionality.

func RegionAddition

func RegionAddition() tjconfig.ResourceOption

RegionAddition adds region to the spec of all resources except iam group which does not have a region notion.

func TagsAllRemoval

func TagsAllRemoval() tjconfig.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.

Types

type GroupKindCalculator added in v0.4.0

type GroupKindCalculator func(resource string) (string, string)

GroupKindCalculator returns the correct group and kind name for given TF resource.

func ReplaceGroupWords added in v0.4.0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL