Skip to content

Commit

Permalink
nolint:gocyclo resource configurations (#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergenci authored Oct 29, 2024
1 parent 7cd7083 commit db6ece3
Show file tree
Hide file tree
Showing 83 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion config/acm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the acm group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_acm_certificate_validation", func(r *config.Resource) {
r.References = map[string]config.Reference{
"certificate_arn": {
Expand Down
2 changes: 1 addition & 1 deletion config/acmpca/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the acmpca group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_acmpca_certificate_authority", func(r *config.Resource) {
// NOTE(muvaf): It causes circular dependency. See https://github.com/crossplane/crossplane-runtime/issues/313
delete(r.References, "revocation_configuration.crl_configuration.s3_bucket_name")
Expand Down
2 changes: 1 addition & 1 deletion config/apigateway/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the apigateway group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_api_gateway_rest_api", func(r *config.Resource) {
config.MoveToStatus(r.TerraformResource, "policy")
})
Expand Down
2 changes: 1 addition & 1 deletion config/apigatewayv2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the apigatewayv2 group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_apigatewayv2_api_mapping", func(r *config.Resource) {
r.References["api_id"] = config.Reference{
TerraformName: "aws_apigatewayv2_api",
Expand Down
2 changes: 1 addition & 1 deletion config/apprunner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the apprunner group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_apprunner_vpc_connector", func(r *config.Resource) {
r.References["subnets"] = config.Reference{
TerraformName: "aws_subnet",
Expand Down
2 changes: 1 addition & 1 deletion config/appstream/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the appstream group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_appstream_fleet", func(r *config.Resource) {
r.References["vpc_config.subnet_ids"] = config.Reference{
TerraformName: "aws_subnet",
Expand Down
2 changes: 1 addition & 1 deletion config/athena/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the athena group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_athena_workgroup", func(r *config.Resource) {
r.References["configuration.result_configuration.encryption_configuration.kms_key_arn"] = config.Reference{
TerraformName: "aws_kms_key",
Expand Down
2 changes: 1 addition & 1 deletion config/autoscaling/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// Configure adds configurations for the autoscaling group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_autoscaling_group", func(r *config.Resource) {
// These are mutually exclusive with aws_autoscaling_attachment.
config.MoveToStatus(r.TerraformResource, "load_balancers", "target_group_arns")
Expand Down
2 changes: 1 addition & 1 deletion config/backup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the backup group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_backup_vault", func(r *config.Resource) {
r.References["kms_key_arn"] = config.Reference{
TerraformName: "aws_kms_key",
Expand Down
2 changes: 1 addition & 1 deletion config/bedrockagent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/upbound/provider-aws/config/common"
)

func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_bedrockagent_agent", func(r *config.Resource) {
r.References["customer_encryption_key_arn"] = config.Reference{
TerraformName: "aws_kms_key",
Expand Down
2 changes: 1 addition & 1 deletion config/budgets/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the budgets group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_budgets_budget_action", func(r *config.Resource) {
r.References["definition.iam_action_definition.aws_iam_role.example.name"] = config.Reference{
TerraformName: "aws_iam_role",
Expand Down
2 changes: 1 addition & 1 deletion config/cloudformation/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package cloudformation
import "github.com/crossplane/upjet/pkg/config"

// Configure adds configurations for the cloudformation group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudformation_stack_set_instance", func(r *config.Resource) {
r.TerraformConfigurationInjector = func(jsonMap map[string]any, params map[string]any) error {
params["region"] = jsonMap["region"]
Expand Down
2 changes: 1 addition & 1 deletion config/cloudfront/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the cloudfront group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudfront_distribution", func(r *config.Resource) {
r.UseAsync = true
delete(r.References, "origin.domain_name")
Expand Down
2 changes: 1 addition & 1 deletion config/cloudsearch/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the cloudsearch group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudsearch_domain", func(r *config.Resource) {
r.UseAsync = true
})
Expand Down
2 changes: 1 addition & 1 deletion config/cloudwatch/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the cloudwatch group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudwatch_metric_stream", func(r *config.Resource) {
config.MarkAsRequired(r.TerraformResource, "name")
r.LateInitializer = config.LateInitializer{
Expand Down
2 changes: 1 addition & 1 deletion config/cloudwatchevents/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

// Configure adds configurations for the cloudwatchevents group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudwatch_event_permission", func(r *config.Resource) {
r.References["event_bus_name"] = config.Reference{
TerraformName: "aws_cloudwatch_event_bus",
Expand Down
2 changes: 1 addition & 1 deletion config/cloudwatchlogs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the cloudwatchlogs group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cloudwatch_log_destination", func(r *config.Resource) {
// the target_arn field is generated together with the associated
// referencer fields but the auto-generated extractor refers to
Expand Down
2 changes: 1 addition & 1 deletion config/codeartifact/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the codeartifact group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_codeartifact_domain", func(r *config.Resource) {
r.References["encryption_key"] = config.Reference{
TerraformName: "aws_kms_key",
Expand Down
2 changes: 1 addition & 1 deletion config/cognitoidentity/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the cognitoidentity group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cognito_identity_pool", func(r *config.Resource) {
r.References["saml_provider_arns"] = config.Reference{
TerraformName: "aws_iam_saml_provider",
Expand Down
2 changes: 1 addition & 1 deletion config/cognitoidp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the cognitoidp group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cognito_user_pool_client", func(r *config.Resource) {
r.References["user_pool_id"] = config.Reference{
TerraformName: "aws_cognito_user_pool",
Expand Down
2 changes: 1 addition & 1 deletion config/cur/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the cur group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_cur_report_definition", func(r *config.Resource) {
r.References["s3_bucket"] = config.Reference{
TerraformName: "aws_s3_bucket",
Expand Down
2 changes: 1 addition & 1 deletion config/datasync/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the datasync group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_datasync_task", func(r *config.Resource) {
r.References["destination_location_arn"] = config.Reference{
TerraformName: "aws_datasync_location_s3",
Expand Down
2 changes: 1 addition & 1 deletion config/dax/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package dax
import "github.com/crossplane/upjet/pkg/config"

// Configure adds configurations for the dax group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_dax_cluster", func(r *config.Resource) {
r.UseAsync = true
})
Expand Down
2 changes: 1 addition & 1 deletion config/devicefarm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the devicefarm group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_devicefarm_test_grid_project", func(r *config.Resource) {
r.References["vpc_config.subnet_ids"] = config.Reference{
TerraformName: "aws_subnet",
Expand Down
2 changes: 1 addition & 1 deletion config/directconnect/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the directconnect group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_dx_public_virtual_interface", func(r *config.Resource) {
r.References["connection_id"] = config.Reference{
TerraformName: "aws_dx_connection",
Expand Down
2 changes: 1 addition & 1 deletion config/dms/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// Configure adds configurations for the dms group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_dms_endpoint", func(r *config.Resource) {
r.References = config.References{
"secrets_manager_access_role_arn": {
Expand Down
2 changes: 1 addition & 1 deletion config/docdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// Configure adds configurations for the docdb group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_docdb_cluster", func(r *config.Resource) {
config.MoveToStatus(r.TerraformResource, "cluster_members")
r.UseAsync = true
Expand Down
2 changes: 1 addition & 1 deletion config/ds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package ds
import "github.com/crossplane/upjet/pkg/config"

// Configure adds configurations for the ds group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_directory_service_directory", func(r *config.Resource) {
r.References["vpc_settings.subnet_ids"] = config.Reference{
TerraformName: "aws_subnet",
Expand Down
2 changes: 1 addition & 1 deletion config/dynamodb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the dynamodb group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
// currently needs an ARN reference for external name
p.AddResourceConfigurator("aws_dynamodb_contributor_insights", func(r *config.Resource) {
r.References["table_name"] = config.Reference{
Expand Down
2 changes: 1 addition & 1 deletion config/ebs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the ebs group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_ebs_volume", func(r *config.Resource) {
r.References = map[string]config.Reference{
"kms_key_id": {
Expand Down
2 changes: 1 addition & 1 deletion config/ec2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// Configure adds configurations for the ec2 group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_instance", func(r *config.Resource) {
r.UseAsync = true
r.References["subnet_id"] = config.Reference{
Expand Down
2 changes: 1 addition & 1 deletion config/ecr/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the ecr group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_ecr_repository", func(r *config.Resource) {
r.References = map[string]config.Reference{
"encryption_configuration.kms_key": {
Expand Down
2 changes: 1 addition & 1 deletion config/ecrpublic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the ecrpublic group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_ecrpublic_repository", func(r *config.Resource) {
// Deletion takes a while.
r.UseAsync = true
Expand Down
2 changes: 1 addition & 1 deletion config/ecs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// Configure adds configurations for the ecs group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_ecs_cluster", func(r *config.Resource) {
r.ExternalName.GetExternalNameFn = func(tfstate map[string]interface{}) (string, error) {
// expected id format: arn:aws:ecs:us-west-2:123456789123:cluster/example-cluster
Expand Down
2 changes: 1 addition & 1 deletion config/efs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the efs group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_efs_mount_target", func(r *config.Resource) {
r.UseAsync = true
r.References["file_system_id"] = config.Reference{
Expand Down
2 changes: 1 addition & 1 deletion config/eks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the eks group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_eks_cluster", func(r *config.Resource) {
r.References = config.References{
"role_arn": {
Expand Down
2 changes: 1 addition & 1 deletion config/elb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package elb
import "github.com/crossplane/upjet/pkg/config"

// Configure adds configurations for the elb group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_elb", func(r *config.Resource) {
r.References["instances"] = config.Reference{
TerraformName: "aws_instance",
Expand Down
2 changes: 1 addition & 1 deletion config/firehose/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// Configure adds configurations for the firehose group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_kinesis_firehose_delivery_stream", func(r *config.Resource) {
r.TerraformResource.Schema["splunk_configuration"].Elem.(*schema.Resource).Schema["hec_token"].Sensitive = true

Expand Down
2 changes: 1 addition & 1 deletion config/fsx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the fsx group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_fsx_windows_file_system", func(r *config.Resource) {
r.References["kms_key_id"] = config.Reference{
TerraformName: "aws_kms_key",
Expand Down
2 changes: 1 addition & 1 deletion config/gamelift/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the gamelift group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_gamelift_build", func(r *config.Resource) {
r.References["storage_location.role_arn"] = config.Reference{
TerraformName: "aws_iam_role",
Expand Down
2 changes: 1 addition & 1 deletion config/globalaccelerator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Configure adds configurations for the globalaccelerator group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_globalaccelerator_endpoint_group", func(r *config.Resource) {
r.References = config.References{
"listener_arn": {
Expand Down
2 changes: 1 addition & 1 deletion config/glue/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// Configure adds configurations for the glue group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_glue_catalog_database", func(r *config.Resource) {
// Required in ID but optional in schema since TF defaults to Account ID.
// This causes refresh to fail in the first reconcile.
Expand Down
2 changes: 1 addition & 1 deletion config/grafana/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the grafana group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_grafana_workspace", func(r *config.Resource) {
r.References["role_arn"] = config.Reference{
TerraformName: "aws_iam_role",
Expand Down
2 changes: 1 addition & 1 deletion config/iam/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Configure adds configurations for the iam group.
func Configure(p *config.Provider) {
func Configure(p *config.Provider) { //nolint:gocyclo
p.AddResourceConfigurator("aws_iam_access_key", func(r *config.Resource) {
r.References["user"] = config.Reference{
TerraformName: "aws_iam_user",
Expand Down
Loading

0 comments on commit db6ece3

Please sign in to comment.