diff --git a/.changelog/33624.txt b/.changelog/33624.txt new file mode 100644 index 000000000000..c5bcbfe2633a --- /dev/null +++ b/.changelog/33624.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_cognito_risk_configuration: Make `account_takeover_risk_configuration.notify_configuration` optional +``` diff --git a/.changelog/43240.txt b/.changelog/43240.txt new file mode 100644 index 000000000000..f96ffa2f919f --- /dev/null +++ b/.changelog/43240.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_dynamodb_table: Add `replica.deletion_protection_enabled` argument +``` diff --git a/.changelog/43262.txt b/.changelog/43262.txt new file mode 100644 index 000000000000..102842ebc7cd --- /dev/null +++ b/.changelog/43262.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_vpc_ipam_pool_cidr: Fix netmask_length not being saved and diffed correctly +``` diff --git a/.changelog/43337.txt b/.changelog/43337.txt new file mode 100644 index 000000000000..9b2ce0d52e41 --- /dev/null +++ b/.changelog/43337.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_batch_compute_environment: Fix `inconsistent final plan` error when `compute_resource.launch_template.version` is unknown during an update +``` \ No newline at end of file diff --git a/.changelog/43534.txt b/.changelog/43534.txt new file mode 100644 index 000000000000..de5d2d6e470e --- /dev/null +++ b/.changelog/43534.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_timestreaminfluxdb_db_instance: Don't mark `network_type` as [ForceNew](https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#forcenew) if the value is not configured. This fixes a problem with `terraform apply -refresh=false` after upgrade from `v5.90.0` and below +``` \ No newline at end of file diff --git a/.changelog/43545.txt b/.changelog/43545.txt new file mode 100644 index 000000000000..793936ca0427 --- /dev/null +++ b/.changelog/43545.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_servicequotas_service_quota: Add validation, during `create`, to check if new value is less than current value of quota +``` diff --git a/.changelog/43561.txt b/.changelog/43561.txt new file mode 100644 index 000000000000..cb9014c63684 --- /dev/null +++ b/.changelog/43561.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_wafv2_web_acl_rule_group_association +``` \ No newline at end of file diff --git a/.changelog/43597.txt b/.changelog/43597.txt new file mode 100644 index 000000000000..72970ed2001a --- /dev/null +++ b/.changelog/43597.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +data-source/aws_wafv2_web_acl: Add `resource_arn` argument to enable finding web ACLs by resource ARN +``` + +```release-note:enhancement +data-source/aws_wafv2_web_acl: Add support for `CLOUDFRONT` `scope` web ACLs using `resource_arn` +``` diff --git a/.changelog/43605.txt b/.changelog/43605.txt new file mode 100644 index 000000000000..621d5fdad6f2 --- /dev/null +++ b/.changelog/43605.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_fsx_lustre_file_system: Fix validation of SSD read cache size for file systems using the Intelligent-Tiering storage class +``` diff --git a/.changelog/43613.txt b/.changelog/43613.txt new file mode 100644 index 000000000000..7e7aa90d51ce --- /dev/null +++ b/.changelog/43613.txt @@ -0,0 +1,31 @@ +```release-note:new-resource +aws_quicksight_custom_permissions +``` + +```release-note:new-resource +aws_quicksight_role_custom_permission +``` + +```release-note:new-resource +aws_quicksight_user_custom_permission +``` + +```release-note:enhancement +resource/aws_quicksight_user: Change `user_name` to Optional and Computed +``` + +```release-note:enhancement +resource/aws_quicksight_user: Support `IAM_IDENTITY_CENTER` as a valid value for `identity_type` +``` + +```release-note:enhancement +resource/aws_quicksight_user: Support `RESTRICTED_AUTHOR` and `RESTRICTED_READER` as valid values for `user_role` +``` + +```release-note:enhancement +resource/aws_quicksight_user: Add plan-time validation of `iam_arn` +``` + +```release-note:enhancement +data-source/aws_quicksight_user: Add `custom_permissions_name` attribute +``` \ No newline at end of file diff --git a/.changelog/43630.txt b/.changelog/43630.txt new file mode 100644 index 000000000000..7f8157a8ac96 --- /dev/null +++ b/.changelog/43630.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_s3_access_point: Add `tags` argument and `tags_all` attribute. This functionality requires the `s3:ListTagsForResource`, `s3:TagResource`, and `s3:UntagResource` IAM permissions +``` + +```release-note:enhancement +data-source/aws_s3_access_point: Add `tags` attribute. This functionality requires the `s3:ListTagsForResource` IAM permission +``` \ No newline at end of file diff --git a/.changelog/43642.txt b/.changelog/43642.txt new file mode 100644 index 000000000000..1f3463d92979 --- /dev/null +++ b/.changelog/43642.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_ecr_repository: Add `image_tag_mutability_exclusion_filter` argument +``` + +```release-note:enhancement +resource/aws_ecr_repository: Support `IMMUTABLE_WITH_EXCLUSION` and `MUTABLE_WITH_EXCLUSION` as valid values for `image_tag_mutability` +``` \ No newline at end of file diff --git a/.changelog/43647.txt b/.changelog/43647.txt new file mode 100644 index 000000000000..8979285fde84 --- /dev/null +++ b/.changelog/43647.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_kinesis_firehose_delivery_stream: Add `iceberg_configuration.append_only` argument +``` diff --git a/.changelog/43654.txt b/.changelog/43654.txt new file mode 100644 index 000000000000..bd84ca1c52a8 --- /dev/null +++ b/.changelog/43654.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_bedrockagent_flow: Prevent `created_at` becoming `null` on Update +``` diff --git a/.changelog/43659.txt b/.changelog/43659.txt new file mode 100644 index 000000000000..e57a56c9e81a --- /dev/null +++ b/.changelog/43659.txt @@ -0,0 +1,3 @@ +```release-note:bug +provider: Fix failure to detect resources deleted outside of Terraform as missing for numerous resource types +``` \ No newline at end of file diff --git a/.changelog/43661.txt b/.changelog/43661.txt new file mode 100644 index 000000000000..b06b5906836a --- /dev/null +++ b/.changelog/43661.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_ec2_managed_prefix_list: Fix `PrefixListVersionMismatch: The prefix list has the incorrect version number` errors when updating entry description +``` \ No newline at end of file diff --git a/.changelog/43667.txt b/.changelog/43667.txt new file mode 100644 index 000000000000..3ed1f46ee9ac --- /dev/null +++ b/.changelog/43667.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_docdb_cluster: Add `serverless_v2_scaling_configuration` argument in support of [Amazon DocumentDB serverless](https://docs.aws.amazon.com/documentdb/latest/developerguide/docdb-serverless.html) +``` diff --git a/.changelog/43672.txt b/.changelog/43672.txt new file mode 100644 index 000000000000..9e196e510a71 --- /dev/null +++ b/.changelog/43672.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_lightsail_static_ip: Support resource import +``` diff --git a/.changelog/43673.txt b/.changelog/43673.txt new file mode 100644 index 000000000000..e74f3cbcc905 --- /dev/null +++ b/.changelog/43673.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_inspector2_enabler: Support resource import +``` diff --git a/.changelog/43674.txt b/.changelog/43674.txt new file mode 100644 index 000000000000..e4bca455c146 --- /dev/null +++ b/.changelog/43674.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_opensearch_domain_policy: Support resource import +``` diff --git a/.changelog/43675.txt b/.changelog/43675.txt new file mode 100644 index 000000000000..f0d443f5340b --- /dev/null +++ b/.changelog/43675.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_networkfirewall_vpc_endpoint_association +``` \ No newline at end of file diff --git a/.changelog/43676.txt b/.changelog/43676.txt new file mode 100644 index 000000000000..9a1ea0a54878 --- /dev/null +++ b/.changelog/43676.txt @@ -0,0 +1,3 @@ +```release-note:bug +ephemeral-resource/aws_lambda_invocation: Fix plan inconsistency issue due to improperly assigned payload values +``` diff --git a/.changelog/43677.txt b/.changelog/43677.txt new file mode 100644 index 000000000000..2ad6d986e2a0 --- /dev/null +++ b/.changelog/43677.txt @@ -0,0 +1,4 @@ +```release-note:enhancement +resource/aws_computeoptimizer_recommendation_preferences: Add `AuroraDBClusterStorage` as a valid `resource_type` +``` + diff --git a/.changelog/43693.txt b/.changelog/43693.txt new file mode 100644 index 000000000000..b3a2df3a11d9 --- /dev/null +++ b/.changelog/43693.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_wafv2_regex_pattern_set: Remove maximum items limit on the `regular_expression` argument +``` \ No newline at end of file diff --git a/.changelog/43697.txt b/.changelog/43697.txt new file mode 100644 index 000000000000..bd31a7d1e318 --- /dev/null +++ b/.changelog/43697.txt @@ -0,0 +1,6 @@ +```release-note:enhancement +resource/aws_ivschat_room: Add resource identity support +``` +```release-note:enhancement +resource/aws_ivschat_logging_configuration: Add resource identity support +``` diff --git a/.changelog/43702.txt b/.changelog/43702.txt new file mode 100644 index 000000000000..c7b51d0eb2c6 --- /dev/null +++ b/.changelog/43702.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_bedrock_guardrail: Add `input_action`, `output_action`, `input_enabled`, and `output_enabled` attributes to `sensitive_information_policy_config.pii_entities_config` and `sensitive_information_policy_config.regexes_config` configuration blocks +``` diff --git a/.changelog/43704.txt b/.changelog/43704.txt new file mode 100644 index 000000000000..4d6cb1935fdd --- /dev/null +++ b/.changelog/43704.txt @@ -0,0 +1,9 @@ +```release-note:enhancement +resource/aws_ivs_channel: Add resource identity support +``` +```release-note:enhancement +resource/aws_ivs_playback_key_pair: Add resource identity support +``` +```release-note:enhancement +resource/aws_ivs_recording_configuration: Add resource identity support +``` diff --git a/.changelog/43707.txt b/.changelog/43707.txt new file mode 100644 index 000000000000..78331eb79bfe --- /dev/null +++ b/.changelog/43707.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_s3tables_table_bucket: Fix crash on `maintenance_configuration` read failure +``` diff --git a/.changelog/43710.txt b/.changelog/43710.txt new file mode 100644 index 000000000000..156ed87fa3c3 --- /dev/null +++ b/.changelog/43710.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_sqs_queue: Increase upper limit of `max_message_size` from 256 KiB to 1024 KiB +``` diff --git a/.changelog/43716.txt b/.changelog/43716.txt new file mode 100644 index 000000000000..6b6ad616d213 --- /dev/null +++ b/.changelog/43716.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_kms_key: Restore pre-v6.3.0 retry delay behavior when waiting for continuous target state occurrences. This fixes certain tag update timeouts +``` \ No newline at end of file diff --git a/.changelog/43719.txt b/.changelog/43719.txt new file mode 100644 index 000000000000..6352f6cd5ae4 --- /dev/null +++ b/.changelog/43719.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_cloudwatch_log_group: Add resource identity support +``` diff --git a/.changelog/43722.txt b/.changelog/43722.txt new file mode 100644 index 000000000000..6d54855089bf --- /dev/null +++ b/.changelog/43722.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_instance: Prevent destruction of resource when `disable_api_termination` is `true` +``` + +```release-note:enhancement +resource/aws_instance: Adds `force_destroy` argument that allows destruction even when `disable_api_termination` and `disable_api_stop` are `true` +``` \ No newline at end of file diff --git a/.changelog/43736.txt b/.changelog/43736.txt new file mode 100644 index 000000000000..55064e9fbfff --- /dev/null +++ b/.changelog/43736.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ssm_parameter: Add resource identity support +``` diff --git a/.changelog/43744.txt b/.changelog/43744.txt new file mode 100644 index 000000000000..59630af5cee2 --- /dev/null +++ b/.changelog/43744.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_security_group: Add parameterized resource identity support +``` diff --git a/.changelog/43751.txt b/.changelog/43751.txt new file mode 100644 index 000000000000..225692d53df3 --- /dev/null +++ b/.changelog/43751.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_sagemaker_image: Fix `image_name` regular expression validation +``` diff --git a/.changelog/43752.txt b/.changelog/43752.txt new file mode 100644 index 000000000000..3267860f0ee0 --- /dev/null +++ b/.changelog/43752.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_eks_cluster: Add `deletion_protection` argument +``` + +```release-note:enhancement +data-source/aws_eks_cluster: Add `deletion_protection` attribute +``` \ No newline at end of file diff --git a/.changelog/43753.txt b/.changelog/43753.txt new file mode 100644 index 000000000000..ba7096ffde92 --- /dev/null +++ b/.changelog/43753.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_lambda_function: Fix missing value for `reserved_concurrent_executions` attribute when a published version exists. This functionality requires the `lambda:GetFunctionConcurrency` IAM permission +``` + +```release-note:bug +data-source/aws_lambda_function: Fix missing value for `reserved_concurrent_executions` attribute when a published version exists. This functionality requires the `lambda:GetFunctionConcurrency` IAM permission +``` diff --git a/.changelog/43758.txt b/.changelog/43758.txt new file mode 100644 index 000000000000..1c84fc9372a6 --- /dev/null +++ b/.changelog/43758.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_cloudwatch_event_rule: Add resource identity support +``` diff --git a/.changelog/43759.txt b/.changelog/43759.txt new file mode 100644 index 000000000000..74decbdf3aa0 --- /dev/null +++ b/.changelog/43759.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_cloudwatch_metric_alarm: Add resource identity support +``` diff --git a/.changelog/43764.txt b/.changelog/43764.txt new file mode 100644 index 000000000000..e0627ad4ecf7 --- /dev/null +++ b/.changelog/43764.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_s3tables_table: Fix `runtime error: invalid memory address or nil pointer dereference` panics when `GetTableMaintenanceConfiguration` returns an error +``` \ No newline at end of file diff --git a/.changelog/43787.txt b/.changelog/43787.txt new file mode 100644 index 000000000000..164c750a17f2 --- /dev/null +++ b/.changelog/43787.txt @@ -0,0 +1,7 @@ +```release-note:new-resource +aws_appsync_api +``` + +```release-note:new-resource +aws_appsync_channel_namespace +``` \ No newline at end of file diff --git a/.changelog/43807.txt b/.changelog/43807.txt new file mode 100644 index 000000000000..a802df2e0e7b --- /dev/null +++ b/.changelog/43807.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_sagemaker_user_profile: Fix incomplete regex for `user_profile_name` +``` \ No newline at end of file diff --git a/.changelog/43816.txt b/.changelog/43816.txt new file mode 100644 index 000000000000..16e4a0cb338e --- /dev/null +++ b/.changelog/43816.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_ecs_service: Fix tagging failure after upgrading to v6 provider +``` diff --git a/.changelog/43819.txt b/.changelog/43819.txt new file mode 100644 index 000000000000..3f4b36d858b4 --- /dev/null +++ b/.changelog/43819.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_storagegateway_gateway: Handle `InvalidGatewayRequestException: The specified gateway is not connected` errors during Read by using the [`ListGateways` API](https://docs.aws.amazon.com/storagegateway/latest/APIReference/API_ListGateways.html) to return minimal information about a disconnected gateway. This functionality requires the `storagegateway:ListGateways` IAM permission +``` \ No newline at end of file diff --git a/.changelog/43821.txt b/.changelog/43821.txt new file mode 100644 index 000000000000..d7fd9cb0b265 --- /dev/null +++ b/.changelog/43821.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_lambda_function: Add resource identity support +``` diff --git a/.changelog/43830.txt b/.changelog/43830.txt new file mode 100644 index 000000000000..558cf3fe21a1 --- /dev/null +++ b/.changelog/43830.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_sns_topic_policy: Add resource identity support +``` + +```release-note:enhancement +resource/aws_sns_topic_data_protection_policy: Add resource identity support +``` + +```release-note:enhancement +resource/aws_sns_topic_subscription: Add resource identity support +``` diff --git a/.changelog/43833.txt b/.changelog/43833.txt new file mode 100644 index 000000000000..cf105056899a --- /dev/null +++ b/.changelog/43833.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_subnet: Add resource identity support +``` diff --git a/.changelog/43852.txt b/.changelog/43852.txt new file mode 100644 index 000000000000..79bd8e40b7a6 --- /dev/null +++ b/.changelog/43852.txt @@ -0,0 +1,3 @@ +```release-note:bug +data-source/aws_networkfirewall_firewall_policy: Add missing schema definition for `firewall_policy.stateful_engine_options.flow_timeouts` +``` diff --git a/.changelog/43871.txt b/.changelog/43871.txt new file mode 100644 index 000000000000..f3af9a55e871 --- /dev/null +++ b/.changelog/43871.txt @@ -0,0 +1,2 @@ +```release-note:bug +resource/aws_ecs_service: Fix refreshing `service_connect_configuration` when deleted outside of Terraform \ No newline at end of file diff --git a/.changelog/43872.txt b/.changelog/43872.txt new file mode 100644 index 000000000000..a586f8658f19 --- /dev/null +++ b/.changelog/43872.txt @@ -0,0 +1,9 @@ +```release-note:enhancement +resource/aws_secretsmanager_secret: Add resource identity support +``` +```release-note:enhancement +resource/aws_secretsmanager_secret_policy: Add resource identity support +``` +```release-note:enhancement +resource/aws_secretsmanager_secret_rotation: Add resource identity support +``` diff --git a/.changelog/43874.txt b/.changelog/43874.txt new file mode 100644 index 000000000000..c29524de50f7 --- /dev/null +++ b/.changelog/43874.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_lightsail_static_ip_attachment: Support resource import +``` diff --git a/.changelog/43886.txt b/.changelog/43886.txt new file mode 100644 index 000000000000..36421993ebbf --- /dev/null +++ b/.changelog/43886.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_ecr_repository_creation_template: Add `image_tag_mutability_exclusion_filter` configuration block +``` + +```release-note:enhancement +data-source/aws_ecr_repository_creation_template: Add `image_tag_mutability_exclusion_filter` attribute +``` + +```release-note:enhancement +data-source/aws_ecr_repository: Add `image_tag_mutability_exclusion_filter` attribute +``` diff --git a/.ci/.semgrep-service-name0.yml b/.ci/.semgrep-service-name0.yml index 505867179cd5..519582fa3031 100644 --- a/.ci/.semgrep-service-name0.yml +++ b/.ci/.semgrep-service-name0.yml @@ -1938,6 +1938,67 @@ rules: patterns: - pattern-regex: "(?i)BedrockAgent" severity: WARNING + - id: bedrockagentcore-in-func-name + languages: + - go + message: Do not use "BedrockAgentCore" in func name inside bedrockagentcore package + paths: + include: + - internal/service/bedrockagentcore + exclude: + - internal/service/bedrockagentcore/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)BedrockAgentCore" + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING + - id: bedrockagentcore-in-test-name + languages: + - go + message: Include "BedrockAgentCore" in test name + paths: + include: + - internal/service/bedrockagentcore/*_test.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-not-regex: "^TestAccBedrockAgentCore" + - pattern-regex: ^TestAcc.* + severity: WARNING + - id: bedrockagentcore-in-const-name + languages: + - go + message: Do not use "BedrockAgentCore" in const name inside bedrockagentcore package + paths: + include: + - internal/service/bedrockagentcore + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)BedrockAgentCore" + severity: WARNING + - id: bedrockagentcore-in-var-name + languages: + - go + message: Do not use "BedrockAgentCore" in var name inside bedrockagentcore package + paths: + include: + - internal/service/bedrockagentcore + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)BedrockAgentCore" + severity: WARNING - id: billing-in-func-name languages: - go @@ -4357,22 +4418,3 @@ rules: patterns: - pattern-regex: "(?i)ConfigService" severity: WARNING - - id: connect-in-func-name - languages: - - go - message: Do not use "Connect" in func name inside connect package - paths: - include: - - internal/service/connect - exclude: - - internal/service/connect/list_pages_gen.go - patterns: - - pattern: func $NAME( ... ) - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Connect" - - pattern-not-regex: .*uickConnect.* - - focus-metavariable: $NAME - - pattern-not: func $NAME($T *testing.T) - severity: WARNING diff --git a/.ci/.semgrep-service-name1.yml b/.ci/.semgrep-service-name1.yml index 9667e2aac131..91c627e0e7f9 100644 --- a/.ci/.semgrep-service-name1.yml +++ b/.ci/.semgrep-service-name1.yml @@ -1,5 +1,24 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: connect-in-func-name + languages: + - go + message: Do not use "Connect" in func name inside connect package + paths: + include: + - internal/service/connect + exclude: + - internal/service/connect/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Connect" + - pattern-not-regex: .*uickConnect.* + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING - id: connect-in-test-name languages: - go @@ -4380,3 +4399,21 @@ rules: patterns: - pattern-regex: "(?i)Invoicing" severity: WARNING + - id: iot-in-func-name + languages: + - go + message: Do not use "IoT" in func name inside iot package + paths: + include: + - internal/service/iot + exclude: + - internal/service/iot/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)IoT" + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING diff --git a/.ci/.semgrep-service-name2.yml b/.ci/.semgrep-service-name2.yml index 7b145a586f94..4d9bcaf1968a 100644 --- a/.ci/.semgrep-service-name2.yml +++ b/.ci/.semgrep-service-name2.yml @@ -1,23 +1,5 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: - - id: iot-in-func-name - languages: - - go - message: Do not use "IoT" in func name inside iot package - paths: - include: - - internal/service/iot - exclude: - - internal/service/iot/list_pages_gen.go - patterns: - - pattern: func $NAME( ... ) - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)IoT" - - focus-metavariable: $NAME - - pattern-not: func $NAME($T *testing.T) - severity: WARNING - id: iot-in-test-name languages: - go @@ -3021,6 +3003,67 @@ rules: patterns: - pattern-regex: "(?i)ObservabilityAccessManager" severity: WARNING + - id: odb-in-func-name + languages: + - go + message: Do not use "ODB" in func name inside odb package + paths: + include: + - internal/service/odb + exclude: + - internal/service/odb/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ODB" + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING + - id: odb-in-test-name + languages: + - go + message: Include "ODB" in test name + paths: + include: + - internal/service/odb/*_test.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-not-regex: "^TestAccODB" + - pattern-regex: ^TestAcc.* + severity: WARNING + - id: odb-in-const-name + languages: + - go + message: Do not use "ODB" in const name inside odb package + paths: + include: + - internal/service/odb + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ODB" + severity: WARNING + - id: odb-in-var-name + languages: + - go + message: Do not use "ODB" in var name inside odb package + paths: + include: + - internal/service/odb + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ODB" + severity: WARNING - id: opensearch-in-func-name languages: - go @@ -4370,3 +4413,21 @@ rules: patterns: - pattern-regex: "(?i)RDS" severity: WARNING + - id: recyclebin-in-func-name + languages: + - go + message: Do not use "recyclebin" in func name inside rbin package + paths: + include: + - internal/service/rbin + exclude: + - internal/service/rbin/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)recyclebin" + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING diff --git a/.ci/.semgrep-service-name3.yml b/.ci/.semgrep-service-name3.yml index bdca7386db66..59c27147346c 100644 --- a/.ci/.semgrep-service-name3.yml +++ b/.ci/.semgrep-service-name3.yml @@ -1,23 +1,5 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: - - id: recyclebin-in-func-name - languages: - - go - message: Do not use "recyclebin" in func name inside rbin package - paths: - include: - - internal/service/rbin - exclude: - - internal/service/rbin/list_pages_gen.go - patterns: - - pattern: func $NAME( ... ) - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)recyclebin" - - focus-metavariable: $NAME - - pattern-not: func $NAME($T *testing.T) - severity: WARNING - id: recyclebin-in-const-name languages: - go @@ -1404,6 +1386,67 @@ rules: patterns: - pattern-regex: "(?i)S3Tables" severity: WARNING + - id: s3vectors-in-func-name + languages: + - go + message: Do not use "S3Vectors" in func name inside s3vectors package + paths: + include: + - internal/service/s3vectors + exclude: + - internal/service/s3vectors/list_pages_gen.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)S3Vectors" + - focus-metavariable: $NAME + - pattern-not: func $NAME($T *testing.T) + severity: WARNING + - id: s3vectors-in-test-name + languages: + - go + message: Include "S3Vectors" in test name + paths: + include: + - internal/service/s3vectors/*_test.go + patterns: + - pattern: func $NAME( ... ) + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-not-regex: "^TestAccS3Vectors" + - pattern-regex: ^TestAcc.* + severity: WARNING + - id: s3vectors-in-const-name + languages: + - go + message: Do not use "S3Vectors" in const name inside s3vectors package + paths: + include: + - internal/service/s3vectors + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)S3Vectors" + severity: WARNING + - id: s3vectors-in-var-name + languages: + - go + message: Do not use "S3Vectors" in var name inside s3vectors package + paths: + include: + - internal/service/s3vectors + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)S3Vectors" + severity: WARNING - id: sagemaker-in-func-name languages: - go diff --git a/.ci/.tflint.hcl b/.ci/.tflint.hcl index bdffe7525511..eb97244a8493 100644 --- a/.ci/.tflint.hcl +++ b/.ci/.tflint.hcl @@ -1,6 +1,6 @@ plugin "aws" { enabled = true - version = "0.39.0" + version = "0.41.0" source = "github.com/terraform-linters/tflint-ruleset-aws" } @@ -26,7 +26,18 @@ rule "aws_acm_certificate_lifecycle" { enabled = false } -rule "aws_accessanalyzer_analyzer_invalid_type" { +# Rule needs to be disabled due to enum value case inconsistencies +rule "aws_dms_s3_endpoint_invalid_compression_type" { + enabled = false +} + +# Rule needs to be disabled due to enum value case inconsistencies +rule "aws_dms_s3_endpoint_invalid_date_partition_sequence" { + enabled = false +} + +# Rule needs to be disabled due to enum value case inconsistencies +rule "aws_dms_s3_endpoint_invalid_encryption_mode" { enabled = false } @@ -34,3 +45,8 @@ rule "aws_accessanalyzer_analyzer_invalid_type" { rule "aws_iam_saml_provider_invalid_saml_metadata_document" { enabled = false } + +# Rule needs to be disabled due to bad email regex in the linter rule +rule "aws_guardduty_member_invalid_email" { + enabled = false +} diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index c3e3942cb084..4a3b91793ba5 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -1,12 +1,12 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint -go 1.24.5 +go 1.24.6 require ( github.com/bflad/tfproviderlint v0.31.0 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.65 github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 - golang.org/x/tools v0.35.0 + golang.org/x/tools v0.36.0 ) require ( @@ -53,12 +53,12 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.16.2 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/mod v0.26.0 // indirect - golang.org/x/net v0.42.0 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/net v0.43.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/grpc v1.72.1 // indirect diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index 56ae586640b1..034e4403758c 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -179,18 +179,18 @@ go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -208,22 +208,22 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/.ci/providerlint/passes/AWSAT001/testdata/go.mod b/.ci/providerlint/passes/AWSAT001/testdata/go.mod index cf8e25dbb556..7b6c5e842e0e 100644 --- a/.ci/providerlint/passes/AWSAT001/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT001/testdata/go.mod @@ -1,6 +1,6 @@ module testdata -go 1.24.5 +go 1.24.6 require ( github.com/YakDriver/regexache v0.24.0 diff --git a/.ci/providerlint/passes/AWSAT002/testdata/go.mod b/.ci/providerlint/passes/AWSAT002/testdata/go.mod index 0cec4e51d888..193682352e59 100644 --- a/.ci/providerlint/passes/AWSAT002/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT002/testdata/go.mod @@ -1,3 +1,3 @@ module testdata -go 1.24.5 +go 1.24.6 diff --git a/.ci/providerlint/passes/AWSAT003/testdata/go.mod b/.ci/providerlint/passes/AWSAT003/testdata/go.mod index 0cec4e51d888..193682352e59 100644 --- a/.ci/providerlint/passes/AWSAT003/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT003/testdata/go.mod @@ -1,3 +1,3 @@ module testdata -go 1.24.5 +go 1.24.6 diff --git a/.ci/providerlint/passes/AWSAT004/testdata/go.mod b/.ci/providerlint/passes/AWSAT004/testdata/go.mod index 9679c41edd58..8612d40d91c9 100644 --- a/.ci/providerlint/passes/AWSAT004/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT004/testdata/go.mod @@ -1,6 +1,6 @@ module testdata -go 1.24.5 +go 1.24.6 require github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1 diff --git a/.ci/providerlint/passes/AWSAT005/testdata/go.mod b/.ci/providerlint/passes/AWSAT005/testdata/go.mod index 0cec4e51d888..193682352e59 100644 --- a/.ci/providerlint/passes/AWSAT005/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT005/testdata/go.mod @@ -1,3 +1,3 @@ module testdata -go 1.24.5 +go 1.24.6 diff --git a/.ci/providerlint/passes/AWSAT006/testdata/go.mod b/.ci/providerlint/passes/AWSAT006/testdata/go.mod index 0cec4e51d888..193682352e59 100644 --- a/.ci/providerlint/passes/AWSAT006/testdata/go.mod +++ b/.ci/providerlint/passes/AWSAT006/testdata/go.mod @@ -1,3 +1,3 @@ module testdata -go 1.24.5 +go 1.24.6 diff --git a/.ci/providerlint/passes/AWSR001/testdata/go.mod b/.ci/providerlint/passes/AWSR001/testdata/go.mod index 0cec4e51d888..193682352e59 100644 --- a/.ci/providerlint/passes/AWSR001/testdata/go.mod +++ b/.ci/providerlint/passes/AWSR001/testdata/go.mod @@ -1,3 +1,3 @@ module testdata -go 1.24.5 +go 1.24.6 diff --git a/.ci/providerlint/passes/AWSV001/testdata/go.mod b/.ci/providerlint/passes/AWSV001/testdata/go.mod index 36c386c144fe..6d0182fd68a9 100644 --- a/.ci/providerlint/passes/AWSV001/testdata/go.mod +++ b/.ci/providerlint/passes/AWSV001/testdata/go.mod @@ -1,6 +1,6 @@ module testdata -go 1.24.5 +go 1.24.6 require github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1 diff --git a/.ci/semgrep/errors/error-checks.yml b/.ci/semgrep/errors/error-checks.yml index 784970a08317..7ac00c741592 100644 --- a/.ci/semgrep/errors/error-checks.yml +++ b/.ci/semgrep/errors/error-checks.yml @@ -95,4 +95,11 @@ rules: if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } return ... } + # e.g. internal/service/storagegateway/gateway.go + - pattern-not-inside: | + if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if isGatewayNotConnectedErr(err) { + ... + } + if $ERR != nil { ... } severity: ERROR diff --git a/.ci/tools/go.mod b/.ci/tools/go.mod index 4bab75411e07..65c2cb34e105 100644 --- a/.ci/tools/go.mod +++ b/.ci/tools/go.mod @@ -1,17 +1,18 @@ module github.com/hashicorp/terraform-provider-aws/tools -go 1.24.5 +go 1.24.6 require ( github.com/YakDriver/tfproviderdocs v0.22.0 github.com/client9/misspell v0.3.4 - github.com/golangci/golangci-lint/v2 v2.3.0 + github.com/golangci/golangci-lint/v2 v2.4.0 github.com/hashicorp/copywrite v0.22.0 github.com/hashicorp/go-changelog v0.0.0-20250127101332-effe3832fb0b github.com/katbyte/terrafmt v0.5.5 github.com/pavius/impi v0.0.3 github.com/rhysd/actionlint v1.7.7 github.com/terraform-linters/tflint v0.58.1 + golang.org/x/tools v0.36.0 mvdan.cc/gofumpt v0.8.0 ) @@ -28,7 +29,9 @@ require ( cloud.google.com/go/storage v1.53.0 // indirect codeberg.org/chavacava/garif v0.2.0 // indirect dario.cat/mergo v1.0.1 // indirect - github.com/4meepo/tagalign v1.4.2 // indirect + dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect + dev.gaijin.team/go/golib v0.6.0 // indirect + github.com/4meepo/tagalign v1.4.3 // indirect github.com/Abirdcfly/dupword v0.1.6 // indirect github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/AlwxSin/noinlineerr v1.0.5 // indirect @@ -37,7 +40,6 @@ require ( github.com/Antonboom/testifylint v1.6.1 // indirect github.com/BurntSushi/toml v1.5.0 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect @@ -48,10 +50,11 @@ require ( github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/agext/levenshtein v1.2.3 // indirect - github.com/alecthomas/chroma/v2 v2.19.0 // indirect + github.com/alecthomas/chroma/v2 v2.20.0 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.6 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/alfatraining/structtag v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/alingse/nilnesserr v0.2.0 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect @@ -71,7 +74,7 @@ require ( github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/bmatcuk/doublestar/v4 v4.8.0 // indirect github.com/bombsimon/wsl/v4 v4.7.0 // indirect - github.com/bombsimon/wsl/v5 v5.1.0 // indirect + github.com/bombsimon/wsl/v5 v5.1.1 // indirect github.com/bradleyfalzon/ghinstallation/v2 v2.5.0 // indirect github.com/breml/bidichk v0.3.3 // indirect github.com/breml/errchkjson v0.4.1 // indirect @@ -95,7 +98,7 @@ require ( github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect github.com/cyphar/filepath-securejoin v0.2.5 // indirect - github.com/daixiang0/gci v0.13.6 // indirect + github.com/daixiang0/gci v0.13.7 // indirect github.com/dave/dst v0.27.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect @@ -224,7 +227,7 @@ require ( github.com/lasiar/canonicalheader v1.1.2 // indirect github.com/ldez/exptostd v0.4.4 // indirect github.com/ldez/gomoddirectives v0.7.0 // indirect - github.com/ldez/grignotin v0.9.0 // indirect + github.com/ldez/grignotin v0.10.0 // indirect github.com/ldez/tagliatelle v0.7.1 // indirect github.com/ldez/usetesting v0.5.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect @@ -293,7 +296,7 @@ require ( github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect github.com/sassoftware/relic v7.2.1+incompatible // indirect github.com/secure-systems-lab/go-securesystemslib v0.9.0 // indirect - github.com/securego/gosec/v2 v2.22.6 // indirect + github.com/securego/gosec/v2 v2.22.7 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect @@ -305,7 +308,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/skeema/knownhosts v1.3.0 // indirect - github.com/sonatard/noctx v0.3.5 // indirect + github.com/sonatard/noctx v0.4.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/sourcegraph/go-lsp v0.0.0-20200429204803-219e11d77f5d // indirect @@ -370,18 +373,17 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.40.0 // indirect + golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20250620022241-b7579e27df2b // indirect - golang.org/x/mod v0.26.0 // indirect - golang.org/x/net v0.42.0 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/net v0.43.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/term v0.33.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/term v0.34.0 // indirect + golang.org/x/text v0.28.0 // indirect golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.35.0 // indirect google.golang.org/api v0.242.0 // indirect google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect diff --git a/.ci/tools/go.sum b/.ci/tools/go.sum index 7291ad59a6f3..bb546c2e2f9f 100644 --- a/.ci/tools/go.sum +++ b/.ci/tools/go.sum @@ -624,13 +624,17 @@ codeberg.org/chavacava/garif v0.2.0 h1:F0tVjhYbuOCnvNcU3YSpO6b3Waw6Bimy4K0mM8y6M codeberg.org/chavacava/garif v0.2.0/go.mod h1:P2BPbVbT4QcvLZrORc2T29szK3xEOlnl0GiPTJmEqBQ= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dev.gaijin.team/go/exhaustruct/v4 v4.0.0 h1:873r7aNneqoBB3IaFIzhvt2RFYTuHgmMjoKfwODoI1Y= +dev.gaijin.team/go/exhaustruct/v4 v4.0.0/go.mod h1:aZ/k2o4Y05aMJtiux15x8iXaumE88YdiB0Ai4fXOzPI= +dev.gaijin.team/go/golib v0.6.0 h1:v6nnznFTs4bppib/NyU1PQxobwDHwCXXl15P7DV5Zgo= +dev.gaijin.team/go/golib v0.6.0/go.mod h1:uY1mShx8Z/aNHWDyAkZTkX+uCi5PdX7KsG1eDQa2AVE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E= -github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= +github.com/4meepo/tagalign v1.4.3 h1:Bnu7jGWwbfpAie2vyl63Zup5KuRv21olsPIha53BJr8= +github.com/4meepo/tagalign v1.4.3/go.mod h1:00WwRjiuSbrRJnSVeGWPLp2epS5Q/l4UEy0apLLS37c= github.com/Abirdcfly/dupword v0.1.6 h1:qeL6u0442RPRe3mcaLcbaCi2/Y/hOcdtw6DE9odjz9c= github.com/Abirdcfly/dupword v0.1.6/go.mod h1:s+BFMuL/I4YSiFv29snqyjwzDp4b65W2Kvy+PKzZ6cw= github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d h1:zjqpY4C7H15HjRPEenkS4SAn3Jy2eRRjkjZbGR30TOg= @@ -663,8 +667,6 @@ github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1/go.mod h1:n/LSCXNuIYqVfBlVXyHfMQkZDdp1/mmxfSjADd3z1Zg= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 h1:ErKg/3iS1AKcTkf3yixlZ54f9U1rljCkQyEXWUnIUxc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0/go.mod h1:yAZHSGnqScoU556rBOVkwLze6WP5N+U11RHuWaGVxwY= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 h1:fYE9p3esPxA/C0rQ0AHhP0drtPXDRhaWiwg1DPqO7IU= @@ -710,12 +712,12 @@ github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGW github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.19.0 h1:Im+SLRgT8maArxv81mULDWN8oKxkzboH07CHesxElq4= -github.com/alecthomas/chroma/v2 v2.19.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= +github.com/alecthomas/chroma/v2 v2.20.0 h1:sfIHpxPyR07/Oylvmcai3X/exDlE8+FA820NTz+9sGw= +github.com/alecthomas/chroma/v2 v2.20.0/go.mod h1:e7tViK0xh/Nf4BYHl00ycY6rV7b8iXBksI9E359yNmA= github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= -github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= -github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/repr v0.5.1 h1:E3G4t2QbHTSNpPKBgMTln5KLkZHLOcU7r37J4pXBuIg= +github.com/alecthomas/repr v0.5.1/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -727,6 +729,8 @@ github.com/alexkohler/nakedret/v2 v2.0.6 h1:ME3Qef1/KIKr3kWX3nti3hhgNxw6aqN5pZmQ github.com/alexkohler/nakedret/v2 v2.0.6/go.mod h1:l3RKju/IzOMQHmsEvXwkqMDzHHvurNQfAgE1eVmT40Q= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alfatraining/structtag v1.0.0 h1:2qmcUqNcCoyVJ0up879K614L9PazjBSFruTB0GOFjCc= +github.com/alfatraining/structtag v1.0.0/go.mod h1:p3Xi5SwzTi+Ryj64DqjLWz7XurHxbGsq6y3ubePJPus= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w= @@ -821,8 +825,8 @@ github.com/bmatcuk/doublestar/v4 v4.8.0 h1:DSXtrypQddoug1459viM9X9D3dp1Z7993fw36 github.com/bmatcuk/doublestar/v4 v4.8.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bombsimon/wsl/v4 v4.7.0 h1:1Ilm9JBPRczjyUs6hvOPKvd7VL1Q++PL8M0SXBDf+jQ= github.com/bombsimon/wsl/v4 v4.7.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg= -github.com/bombsimon/wsl/v5 v5.1.0 h1:pLmVRBMxSL1D3/rCe65s/iCSFqU37Cz5/8dVEB4UNBw= -github.com/bombsimon/wsl/v5 v5.1.0/go.mod h1:Gp8lD04z27wm3FANIUPZycXp+8huVsn0oxc+n4qfV9I= +github.com/bombsimon/wsl/v5 v5.1.1 h1:cQg5KJf9FlctAH4cpL9vLKnziYknoCMCdqXl0wjl72Q= +github.com/bombsimon/wsl/v5 v5.1.1/go.mod h1:Gp8lD04z27wm3FANIUPZycXp+8huVsn0oxc+n4qfV9I= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradleyfalzon/ghinstallation/v2 v2.5.0 h1:yaYcGQ7yEIGbsJfW/9z7v1sLiZg/5rSNNXwmMct5XaE= @@ -914,8 +918,8 @@ github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 h github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.13.6 h1:RKuEOSkGpSadkGbvZ6hJ4ddItT3cVZ9Vn9Rybk6xjl8= -github.com/daixiang0/gci v0.13.6/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/daixiang0/gci v0.13.7 h1:+0bG5eK9vlI08J+J/NWGbWPTNiXPG4WhNLJOkSxWITQ= +github.com/daixiang0/gci v0.13.7/go.mod h1:812WVN6JLFY9S6Tv76twqmNqevN0pa3SX3nih0brVzQ= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/dave/dst v0.27.3 h1:P1HPoMza3cMEquVf9kKy8yXsFirry4zEnWOdYPOoIzY= @@ -1156,8 +1160,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.3.0 h1:SgxoaAXH8vMuuSnvRDjfF0sxWeIplxJTcs4o6gGEu9Q= -github.com/golangci/golangci-lint/v2 v2.3.0/go.mod h1:9eHPNOsTOqLGSnDsfPRcOaC2m52stgt37uxsjtQwjg0= +github.com/golangci/golangci-lint/v2 v2.4.0 h1:qz6O6vr7kVzXJqyvHjHSz5fA3D+PM8v96QU5gxZCNWM= +github.com/golangci/golangci-lint/v2 v2.4.0/go.mod h1:Oq7vuAf6L1iNL34uHDcsIF6Mnc0amOPdsT3/GlpHD+I= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.7.0 h1:4GOHr/T1lTW0hhR4tgaaV1WS/lJ+ncvYCoFKmqJsj0c= @@ -1512,8 +1516,8 @@ github.com/ldez/exptostd v0.4.4 h1:58AtQjnLcT/tI5W/1KU7xE/O7zW9RAWB6c/ScQAnfus= github.com/ldez/exptostd v0.4.4/go.mod h1:QfdzPw6oHjFVdNV7ILoPu5sw3OZ3OG1JS0I5JN3J4Js= github.com/ldez/gomoddirectives v0.7.0 h1:EOx8Dd56BZYSez11LVgdj025lKwlP0/E5OLSl9HDwsY= github.com/ldez/gomoddirectives v0.7.0/go.mod h1:wR4v8MN9J8kcwvrkzrx6sC9xe9Cp68gWYCsda5xvyGc= -github.com/ldez/grignotin v0.9.0 h1:MgOEmjZIVNn6p5wPaGp/0OKWyvq42KnzAt/DAb8O4Ow= -github.com/ldez/grignotin v0.9.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= +github.com/ldez/grignotin v0.10.0 h1:NQPeh1E/Eza4F0exCeC1WkpnLvgUcQDT8MQ1vOLML0E= +github.com/ldez/grignotin v0.10.0/go.mod h1:oR4iCKUP9fwoeO6vCQeD7M5SMxCT6xdVas4vg0h1LaI= github.com/ldez/tagliatelle v0.7.1 h1:bTgKjjc2sQcsgPiT902+aadvMjCeMHrY7ly2XKFORIk= github.com/ldez/tagliatelle v0.7.1/go.mod h1:3zjxUpsNB2aEZScWiZTHrAXOl1x25t3cRmzfK1mlo2I= github.com/ldez/usetesting v0.5.0 h1:3/QtzZObBKLy1F4F8jLuKJiKBjjVFi1IavpoWbmqLwc= @@ -1766,8 +1770,8 @@ github.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PK github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/secure-systems-lab/go-securesystemslib v0.9.0 h1:rf1HIbL64nUpEIZnjLZ3mcNEL9NBPB0iuVjyxvq3LZc= github.com/secure-systems-lab/go-securesystemslib v0.9.0/go.mod h1:DVHKMcZ+V4/woA/peqr+L0joiRXbPpQ042GgJckkFgw= -github.com/securego/gosec/v2 v2.22.6 h1:mixR+X+Z5fT6QddWY8jyU9gs43CyW0SnADHB6kJm8NY= -github.com/securego/gosec/v2 v2.22.6/go.mod h1:510TFNDMrIPytokyHQAVLvPeDr41Yihn2ak8P+XQfNE= +github.com/securego/gosec/v2 v2.22.7 h1:8/9P+oTYI4yIpAzccQKVsg1/90Po+JzGtAhqoHImDeM= +github.com/securego/gosec/v2 v2.22.7/go.mod h1:510TFNDMrIPytokyHQAVLvPeDr41Yihn2ak8P+XQfNE= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= @@ -1807,8 +1811,8 @@ github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+W github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= -github.com/sonatard/noctx v0.3.5 h1:KJmJt2jEXFu2JLlGfjpGNOjyjc4qvfzl4918XJ4Odpc= -github.com/sonatard/noctx v0.3.5/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas= +github.com/sonatard/noctx v0.4.0 h1:7MC/5Gg4SQ4lhLYR6mvOP6mQVSxCrdyiExo7atBs27o= +github.com/sonatard/noctx v0.4.0/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= @@ -2049,8 +2053,8 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2119,8 +2123,8 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2190,8 +2194,8 @@ golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2358,8 +2362,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2375,8 +2379,8 @@ golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2398,8 +2402,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2483,8 +2487,8 @@ golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= diff --git a/.ci/tools/main.go b/.ci/tools/main.go index f4e7bc1660a4..9028fa1a3d36 100644 --- a/.ci/tools/main.go +++ b/.ci/tools/main.go @@ -13,5 +13,6 @@ import ( _ "github.com/pavius/impi/cmd/impi" _ "github.com/rhysd/actionlint/cmd/actionlint" _ "github.com/terraform-linters/tflint" + _ "golang.org/x/tools/cmd/stringer" _ "mvdan.cc/gofumpt" ) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 5e07c149b293..0bdfe2b5c673 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -97,6 +97,8 @@ service/bedrock: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_bedrock_' service/bedrockagent: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_bedrockagent_' +service/bedrockagentcore: + - '((\*|-)\s*`?|(data|resource)\s+"?)aws_bedrockagentcore_' service/billing: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_billing_' service/billingconductor: @@ -505,6 +507,8 @@ service/notificationscontacts: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_notificationscontacts_' service/oam: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_oam_' +service/odb: + - '((\*|-)\s*`?|(data|resource)\s+"?)aws_odb_' service/opensearch: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_opensearch_' service/opensearchserverless: @@ -611,6 +615,8 @@ service/s3outposts: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_s3outposts_' service/s3tables: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_s3tables_' +service/s3vectors: + - '((\*|-)\s*`?|(data|resource)\s+"?)aws_s3vectors_' service/sagemaker: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_sagemaker_' service/sagemakera2iruntime: diff --git a/.github/labeler-pr-triage.yml b/.github/labeler-pr-triage.yml index 7d87c0503313..53d3c782a3a5 100644 --- a/.github/labeler-pr-triage.yml +++ b/.github/labeler-pr-triage.yml @@ -331,6 +331,12 @@ service/bedrockagent: - any-glob-to-any-file: - 'internal/service/bedrockagent/**/*' - 'website/**/bedrockagent_*' +service/bedrockagentcore: + - any: + - changed-files: + - any-glob-to-any-file: + - 'internal/service/bedrockagentcore/**/*' + - 'website/**/bedrockagentcore_*' service/billing: - any: - changed-files: @@ -1602,6 +1608,12 @@ service/oam: - any-glob-to-any-file: - 'internal/service/oam/**/*' - 'website/**/oam_*' +service/odb: + - any: + - changed-files: + - any-glob-to-any-file: + - 'internal/service/odb/**/*' + - 'website/**/odb_*' service/opensearch: - any: - changed-files: @@ -1935,6 +1947,12 @@ service/s3tables: - any-glob-to-any-file: - 'internal/service/s3tables/**/*' - 'website/**/s3tables_*' +service/s3vectors: + - any: + - changed-files: + - any-glob-to-any-file: + - 'internal/service/s3vectors/**/*' + - 'website/**/s3vectors_*' service/sagemaker: - any: - changed-files: diff --git a/.github/workflows/acctest-terraform-embedded-lint.yml b/.github/workflows/acctest-terraform-embedded-lint.yml index 90943591c319..0e68dea75762 100644 --- a/.github/workflows/acctest-terraform-embedded-lint.yml +++ b/.github/workflows/acctest-terraform-embedded-lint.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -55,13 +55,13 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 name: Cache plugin dir continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index d8778ada55a8..9abfa30ca79c 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -45,13 +45,13 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 name: Cache plugin dir continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/changelog_misspell.yml b/.github/workflows/changelog_misspell.yml index ff66ef6219ef..d11e072cc909 100644 --- a/.github/workflows/changelog_misspell.yml +++ b/.github/workflows/changelog_misspell.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index 3276619ccb5d..a25d413ed778 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -12,7 +12,6 @@ on: - .teamcity/** - .release/** - infrastructure/repository/labels-service.tf - - .goreleaser.yml ## NOTE: !!! ## When changing these workflows, ensure that the following is updated: @@ -33,13 +32,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index ffc277b80b7f..9e5d8d212ac5 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -47,13 +47,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3b1a4b8a965b..175eb0ae9218 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 40af085144f1..6660d1e29b1f 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -38,7 +38,7 @@ jobs: - name: install tflint run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 name: Cache plugin dir with: path: ~/.tflint.d/plugins @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} diff --git a/.github/workflows/firewatch.yml b/.github/workflows/firewatch.yml index 47c3e5e4e5b7..817b5fbfaec6 100644 --- a/.github/workflows/firewatch.yml +++ b/.github/workflows/firewatch.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Firewatch - uses: breathingdust/firewatch@ee67583a20f6f6741ca2f499a146e0110e5095ea # v2.0.7 + uses: breathingdust/firewatch@9fd4a9c5d71091defabd7d931843b24341c19769 # v2.0.8 with: github_token: ${{ secrets.GITHUB_TOKEN }} alert_threshold: 10 diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 6a86f0677488..953a581fca2c 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -8,7 +8,7 @@ jobs: if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: app-token with: app-id: ${{ secrets.APP_ID }} diff --git a/.github/workflows/maintainer_helpers.yml b/.github/workflows/maintainer_helpers.yml index c25feeb626ac..3dba8b4db589 100644 --- a/.github/workflows/maintainer_helpers.yml +++ b/.github/workflows/maintainer_helpers.yml @@ -39,7 +39,7 @@ jobs: CURRENT_LABELS: ${{ github.event_name == 'issues' && toJSON(github.event.issue.labels.*.name) || toJSON(github.event.pull_request.labels.*.name) }} GH_CLI_SUBCOMMAND: ${{ github.event_name == 'pull_request_target' && 'pr' || 'issue' }} steps: - - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: token with: app-id: ${{ secrets.APP_ID }} @@ -220,7 +220,7 @@ jobs: ] } - - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 if: github.event_name == 'schedule' id: token with: @@ -229,7 +229,7 @@ jobs: - name: Open Maintainer Pull Request Stats if: steps.token.outcome != 'skipped' - uses: breathingdust/github-team-slackbot@1993808d8d185c6786607cb97e8d8fac778eb3f2 # v18.5.3 + uses: breathingdust/github-team-slackbot@86aab12fa9d04755f51c543c9211acf6caa7005a # v18.5.4 with: github_token: ${{ steps.token.outputs.token }} team_slug: terraform-aws diff --git a/.github/workflows/modern_go.yml b/.github/workflows/modern_go.yml index 52e1bda6ec34..b9129a28b385 100644 --- a/.github/workflows/modern_go.yml +++ b/.github/workflows/modern_go.yml @@ -29,13 +29,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/post-publish.yml b/.github/workflows/post-publish.yml index 14bb2b026e20..df724360263f 100644 --- a/.github/workflows/post-publish.yml +++ b/.github/workflows/post-publish.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Tidy Jira - uses: breathingdust/github-jira-tidy@a64b76479e0021bf2ea7b2066b7496e0d365f929 # v0.11.0 + uses: breathingdust/github-jira-tidy@90353323866d42ef3686f589d834ba5f30ce6534 # v0.14.0 with: jira_host: 'hashicorp.atlassian.net' jira_username: 'sdavis@hashicorp.com' diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 673b56e39d0f..e83c95e44e05 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true id: cache-go-pkg-mod timeout-minutes: 2 @@ -57,7 +57,7 @@ jobs: runs-on: custom-ubuntu-22.04-medium steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true id: cache-terraform-plugin-dir timeout-minutes: 2 @@ -74,12 +74,12 @@ jobs: run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -100,19 +100,20 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - run: go install golang.org/x/tools/cmd/goimports@latest + - run: go install golang.org/x/tools/cmd/stringer@latest - run: make gen - name: Check for Git Differences run: | @@ -134,13 +135,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -161,13 +162,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -194,13 +195,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -216,7 +217,7 @@ jobs: (echo; echo "Expected `strings` to detect sweeper function names in sweeper binary."; exit 1) # Use cached provider or rebuild - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 continue-on-error: true id: cache-terraform-plugin-dir timeout-minutes: 2 @@ -243,7 +244,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true id: cache-terraform-providers-schema timeout-minutes: 2 @@ -251,7 +252,7 @@ jobs: path: terraform-providers-schema key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 timeout-minutes: 2 with: path: terraform-plugin-dir @@ -285,14 +286,14 @@ jobs: with: terraform_version: ${{ env.TERRAFORM_VERSION }} terraform_wrapper: false - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - run: cd .ci/tools && go install github.com/YakDriver/tfproviderdocs - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 timeout-minutes: 2 with: path: terraform-providers-schema @@ -318,7 +319,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 3 with: diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index d66bd73ef3f1..c3b687765fec 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -29,13 +29,13 @@ jobs: go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/pull_request_target.yml b/.github/workflows/pull_request_target.yml index a41664c49da2..122c7fca3a86 100644 --- a/.github/workflows/pull_request_target.yml +++ b/.github/workflows/pull_request_target.yml @@ -39,13 +39,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/resource-counts.yml b/.github/workflows/resource-counts.yml index ad5f0fb71592..331baa6af823 100644 --- a/.github/workflows/resource-counts.yml +++ b/.github/workflows/resource-counts.yml @@ -36,9 +36,9 @@ jobs: EOF - run: terraform init - run: | - datasources=$(terraform providers schema -json | jq '.provider_schemas[] .data_source_schemas | length') - resources=$(terraform providers schema -json | jq '.provider_schemas[] .resource_schemas | length') - sed -r -i "s/There are currently ([0-9]+) resources and ([0-9]+)(.*)/There are currently $resources resources and $datasources\3/" website/docs/index.html.markdown + datasources=$(terraform providers schema -json | jq '.provider_schemas[] .data_source_schemas | length' | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') + resources=$(terraform providers schema -json | jq '.provider_schemas[] .resource_schemas | length' | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') + sed -r -i "s/With ([0-9,]+) resources and ([0-9,]+) data sources,/With $resources resources and $datasources data sources,/" website/docs/index.html.markdown - run: | rm main.tf rm .terraform.lock.hcl diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index 170d02e59d34..b71df2acb4ca 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -31,13 +31,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/smarterr.yml b/.github/workflows/smarterr.yml index b2aa71fd0c0a..d960b7dad7da 100644 --- a/.github/workflows/smarterr.yml +++ b/.github/workflows/smarterr.yml @@ -29,13 +29,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml deleted file mode 100644 index dfa9c9b3b34e..000000000000 --- a/.github/workflows/snapshot.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Snapshot - -on: - schedule: - - cron: '15 5 * * *' - workflow_dispatch: - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version-file: go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - name: goreleaser release - uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 - with: - args: release --clean --skip=sign --snapshot --timeout 2h - version: "~> v2" - - name: artifact naming - id: naming - run: | - case $GITHUB_REF in - refs/heads/*) - ARTIFACT="${GITHUB_REF#refs/heads/}";; - refs/pull/*) - ARTIFACT="pr-${GITHUB_REF#refs/pull/}" - ARTIFACT="${ARTIFACT%/merge}";; - *) - ARTIFACT="${GITHUB_REF}";; - esac - echo "artifact=$ARTIFACT-$(date -u +'%Y-%m-%dT%H-%M')" >> "$GITHUB_OUTPUT" - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: ${{steps.naming.outputs.artifact}} - path: dist/*.zip diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 22fb16ebc328..92409f313879 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -80,7 +80,7 @@ jobs: enable-versioned-regex: 0 include-title: 1 - - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: token if: github.event_name == 'issues' with: diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 9ac91b1e7f48..48cf5ec227a5 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -90,7 +90,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -106,7 +106,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -124,7 +124,7 @@ jobs: - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 continue-on-error: true timeout-minutes: 2 with: @@ -134,7 +134,7 @@ jobs: - run: cd .ci/tools && go install github.com/katbyte/terrafmt - run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 name: Cache plugin dir with: path: ~/.tflint.d/plugins diff --git a/.go-version b/.go-version index 6521720b4145..7a429d68a36a 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.24.5 +1.24.6 diff --git a/.teamcity/components/generated/services_all.kt b/.teamcity/components/generated/services_all.kt index af54a68fba64..ed0fe9a03529 100644 --- a/.teamcity/components/generated/services_all.kt +++ b/.teamcity/components/generated/services_all.kt @@ -29,6 +29,7 @@ val services = mapOf( "bcmdataexports" to ServiceSpec("BCM Data Exports", parallelismOverride = 5), "bedrock" to ServiceSpec("Bedrock"), "bedrockagent" to ServiceSpec("Bedrock Agents"), + "bedrockagentcore" to ServiceSpec("Bedrock AgentCore"), "billing" to ServiceSpec("Billing"), "budgets" to ServiceSpec("Web Services Budgets"), "ce" to ServiceSpec("CE (Cost Explorer)"), @@ -168,6 +169,7 @@ val services = mapOf( "notifications" to ServiceSpec("User Notifications"), "notificationscontacts" to ServiceSpec("User Notifications Contacts"), "oam" to ServiceSpec("CloudWatch Observability Access Manager"), + "odb" to ServiceSpec("Oracle Database@AWS"), "opensearch" to ServiceSpec("OpenSearch", vpcLock = true), "opensearchserverless" to ServiceSpec("OpenSearch Serverless"), "organizations" to ServiceSpec("Organizations"), @@ -207,6 +209,7 @@ val services = mapOf( "s3control" to ServiceSpec("S3 Control"), "s3outposts" to ServiceSpec("S3 on Outposts"), "s3tables" to ServiceSpec("S3 Tables"), + "s3vectors" to ServiceSpec("S3 Vectors"), "sagemaker" to ServiceSpec("SageMaker AI", vpcLock = true), "scheduler" to ServiceSpec("EventBridge Scheduler"), "schemas" to ServiceSpec("EventBridge Schemas"), diff --git a/.teamcity/scripts/provider_tests/acceptance_tests.sh b/.teamcity/scripts/provider_tests/acceptance_tests.sh index ef7cfbdc05ec..e7734d0537ea 100644 --- a/.teamcity/scripts/provider_tests/acceptance_tests.sh +++ b/.teamcity/scripts/provider_tests/acceptance_tests.sh @@ -48,7 +48,7 @@ TF_ACC=1 go test \ ./internal/function/... \ ./internal/generate/... \ ./internal/io/... \ - ./internal/iters/... \ + ./internal/iter/... \ ./internal/json/... \ ./internal/logging/... \ ./internal/maps/... \ diff --git a/.teamcity/scripts/provider_tests/unit_tests.sh b/.teamcity/scripts/provider_tests/unit_tests.sh index b023b2790400..c954cb904d3d 100644 --- a/.teamcity/scripts/provider_tests/unit_tests.sh +++ b/.teamcity/scripts/provider_tests/unit_tests.sh @@ -20,7 +20,7 @@ go test \ ./internal/function/... \ ./internal/generate/... \ ./internal/io/... \ - ./internal/iters/... \ + ./internal/iter/... \ ./internal/json/... \ ./internal/logging/... \ ./internal/maps/... \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da2c4085d0b..42b2fdc0cc44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,104 @@ -## 6.7.0 (Unreleased) +## 6.10.0 (Unreleased) + +ENHANCEMENTS: + +* data-source/aws_ecr_repository: Add `image_tag_mutability_exclusion_filter` attribute ([#43886](https://github.com/hashicorp/terraform-provider-aws/issues/43886)) +* data-source/aws_ecr_repository_creation_template: Add `image_tag_mutability_exclusion_filter` attribute ([#43886](https://github.com/hashicorp/terraform-provider-aws/issues/43886)) +* resource/aws_ecr_repository_creation_template: Add `image_tag_mutability_exclusion_filter` configuration block ([#43886](https://github.com/hashicorp/terraform-provider-aws/issues/43886)) +* resource/aws_lightsail_static_ip_attachment: Support resource import ([#43874](https://github.com/hashicorp/terraform-provider-aws/issues/43874)) +* resource/aws_secretsmanager_secret: Add resource identity support ([#43872](https://github.com/hashicorp/terraform-provider-aws/issues/43872)) +* resource/aws_secretsmanager_secret_policy: Add resource identity support ([#43872](https://github.com/hashicorp/terraform-provider-aws/issues/43872)) +* resource/aws_secretsmanager_secret_rotation: Add resource identity support ([#43872](https://github.com/hashicorp/terraform-provider-aws/issues/43872)) + +## 6.9.0 (August 14, 2025) + +FEATURES: + +* **New Resource:** `aws_appsync_api` ([#43787](https://github.com/hashicorp/terraform-provider-aws/issues/43787)) +* **New Resource:** `aws_appsync_channel_namespace` ([#43787](https://github.com/hashicorp/terraform-provider-aws/issues/43787)) + +ENHANCEMENTS: + +* data-source/aws_eks_cluster: Add `deletion_protection` attribute ([#43752](https://github.com/hashicorp/terraform-provider-aws/issues/43752)) +* resource/aws_cloudwatch_event_rule: Add resource identity support ([#43758](https://github.com/hashicorp/terraform-provider-aws/issues/43758)) +* resource/aws_cloudwatch_metric_alarm: Add resource identity support ([#43759](https://github.com/hashicorp/terraform-provider-aws/issues/43759)) +* resource/aws_dynamodb_table: Add `replica.deletion_protection_enabled` argument ([#43240](https://github.com/hashicorp/terraform-provider-aws/issues/43240)) +* resource/aws_eks_cluster: Add `deletion_protection` argument ([#43752](https://github.com/hashicorp/terraform-provider-aws/issues/43752)) +* resource/aws_lambda_function: Add resource identity support ([#43821](https://github.com/hashicorp/terraform-provider-aws/issues/43821)) +* resource/aws_sns_topic_data_protection_policy: Add resource identity support ([#43830](https://github.com/hashicorp/terraform-provider-aws/issues/43830)) +* resource/aws_sns_topic_policy: Add resource identity support ([#43830](https://github.com/hashicorp/terraform-provider-aws/issues/43830)) +* resource/aws_sns_topic_subscription: Add resource identity support ([#43830](https://github.com/hashicorp/terraform-provider-aws/issues/43830)) +* resource/aws_subnet: Add resource identity support ([#43833](https://github.com/hashicorp/terraform-provider-aws/issues/43833)) + +BUG FIXES: + +* data-source/aws_lambda_function: Fix missing value for `reserved_concurrent_executions` attribute when a published version exists. This functionality requires the `lambda:GetFunctionConcurrency` IAM permission ([#43753](https://github.com/hashicorp/terraform-provider-aws/issues/43753)) +* data-source/aws_networkfirewall_firewall_policy: Add missing schema definition for `firewall_policy.stateful_engine_options.flow_timeouts` ([#43852](https://github.com/hashicorp/terraform-provider-aws/issues/43852)) +* resource/aws_cognito_risk_configuration: Make `account_takeover_risk_configuration.notify_configuration` optional ([#33624](https://github.com/hashicorp/terraform-provider-aws/issues/33624)) +* resource/aws_ecs_service: Fix tagging failure after upgrading to v6 provider ([#43816](https://github.com/hashicorp/terraform-provider-aws/issues/43816)) +* resource/aws_ecs_service: Fix refreshing `service_connect_configuration` when deleted outside of Terraform ([#43871](https://github.com/hashicorp/terraform-provider-aws/issues/43871)) +* resource/aws_lambda_function: Fix missing value for `reserved_concurrent_executions` attribute when a published version exists. This functionality requires the `lambda:GetFunctionConcurrency` IAM permission ([#43753](https://github.com/hashicorp/terraform-provider-aws/issues/43753)) +* resource/aws_s3tables_table: Fix `runtime error: invalid memory address or nil pointer dereference` panics when `GetTableMaintenanceConfiguration` returns an error ([#43764](https://github.com/hashicorp/terraform-provider-aws/issues/43764)) +* resource/aws_sagemaker_user_profile: Fix incomplete regex for `user_profile_name` ([#43807](https://github.com/hashicorp/terraform-provider-aws/issues/43807)) +* resource/aws_servicequotas_service_quota: Add validation, during `create`, to check if new value is less than current value of quota ([#43545](https://github.com/hashicorp/terraform-provider-aws/issues/43545)) +* resource/aws_storagegateway_gateway: Handle `InvalidGatewayRequestException: The specified gateway is not connected` errors during Read by using the [`ListGateways` API](https://docs.aws.amazon.com/storagegateway/latest/APIReference/API_ListGateways.html) to return minimal information about a disconnected gateway. This functionality requires the `storagegateway:ListGateways` IAM permission ([#43819](https://github.com/hashicorp/terraform-provider-aws/issues/43819)) +* resource/aws_vpc_ipam_pool_cidr: Fix `netmask_length` not being saved and diffed correctly ([#43262](https://github.com/hashicorp/terraform-provider-aws/issues/43262)) + +## 6.8.0 (August 7, 2025) + +FEATURES: + +* **New Resource:** `aws_networkfirewall_vpc_endpoint_association` ([#43675](https://github.com/hashicorp/terraform-provider-aws/issues/43675)) +* **New Resource:** `aws_quicksight_custom_permissions` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* **New Resource:** `aws_quicksight_role_custom_permission` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* **New Resource:** `aws_quicksight_user_custom_permission` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* **New Resource:** `aws_wafv2_web_acl_rule_group_association` ([#43561](https://github.com/hashicorp/terraform-provider-aws/issues/43561)) + +ENHANCEMENTS: + +* data-source/aws_quicksight_user: Add `custom_permissions_name` attribute ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* data-source/aws_wafv2_web_acl: Add `resource_arn` argument to enable finding web ACLs by resource ARN ([#43597](https://github.com/hashicorp/terraform-provider-aws/issues/43597)) +* data-source/aws_wafv2_web_acl: Add support for `CLOUDFRONT` `scope` web ACLs using `resource_arn` ([#43597](https://github.com/hashicorp/terraform-provider-aws/issues/43597)) +* resource/aws_bedrock_guardrail: Add `input_action`, `output_action`, `input_enabled`, and `output_enabled` attributes to `sensitive_information_policy_config.pii_entities_config` and `sensitive_information_policy_config.regexes_config` configuration blocks ([#43702](https://github.com/hashicorp/terraform-provider-aws/issues/43702)) +* resource/aws_cloudwatch_log_group: Add resource identity support ([#43719](https://github.com/hashicorp/terraform-provider-aws/issues/43719)) +* resource/aws_computeoptimizer_recommendation_preferences: Add `AuroraDBClusterStorage` as a valid `resource_type` ([#43677](https://github.com/hashicorp/terraform-provider-aws/issues/43677)) +* resource/aws_docdb_cluster: Add `serverless_v2_scaling_configuration` argument in support of [Amazon DocumentDB serverless](https://docs.aws.amazon.com/documentdb/latest/developerguide/docdb-serverless.html) ([#43667](https://github.com/hashicorp/terraform-provider-aws/issues/43667)) +* resource/aws_ecr_repository: Add `image_tag_mutability_exclusion_filter` argument ([#43642](https://github.com/hashicorp/terraform-provider-aws/issues/43642)) +* resource/aws_ecr_repository: Support `IMMUTABLE_WITH_EXCLUSION` and `MUTABLE_WITH_EXCLUSION` as valid values for `image_tag_mutability` ([#43642](https://github.com/hashicorp/terraform-provider-aws/issues/43642)) +* resource/aws_inspector2_enabler: Support resource import ([#43673](https://github.com/hashicorp/terraform-provider-aws/issues/43673)) +* resource/aws_instance: Adds `force_destroy` argument that allows destruction even when `disable_api_termination` and `disable_api_stop` are `true` ([#43722](https://github.com/hashicorp/terraform-provider-aws/issues/43722)) +* resource/aws_ivs_channel: Add resource identity support ([#43704](https://github.com/hashicorp/terraform-provider-aws/issues/43704)) +* resource/aws_ivs_playback_key_pair: Add resource identity support ([#43704](https://github.com/hashicorp/terraform-provider-aws/issues/43704)) +* resource/aws_ivs_recording_configuration: Add resource identity support ([#43704](https://github.com/hashicorp/terraform-provider-aws/issues/43704)) +* resource/aws_ivschat_logging_configuration: Add resource identity support ([#43697](https://github.com/hashicorp/terraform-provider-aws/issues/43697)) +* resource/aws_ivschat_room: Add resource identity support ([#43697](https://github.com/hashicorp/terraform-provider-aws/issues/43697)) +* resource/aws_kinesis_firehose_delivery_stream: Add `iceberg_configuration.append_only` argument ([#43647](https://github.com/hashicorp/terraform-provider-aws/issues/43647)) +* resource/aws_lightsail_static_ip: Support resource import ([#43672](https://github.com/hashicorp/terraform-provider-aws/issues/43672)) +* resource/aws_opensearch_domain_policy: Support resource import ([#43674](https://github.com/hashicorp/terraform-provider-aws/issues/43674)) +* resource/aws_quicksight_user: Add plan-time validation of `iam_arn` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* resource/aws_quicksight_user: Change `user_name` to Optional and Computed ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* resource/aws_quicksight_user: Support `IAM_IDENTITY_CENTER` as a valid value for `identity_type` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* resource/aws_quicksight_user: Support `RESTRICTED_AUTHOR` and `RESTRICTED_READER` as valid values for `user_role` ([#43613](https://github.com/hashicorp/terraform-provider-aws/issues/43613)) +* resource/aws_security_group: Add parameterized resource identity support ([#43744](https://github.com/hashicorp/terraform-provider-aws/issues/43744)) +* resource/aws_sqs_queue: Increase upper limit of `max_message_size` from 256 KiB to 1024 KiB ([#43710](https://github.com/hashicorp/terraform-provider-aws/issues/43710)) +* resource/aws_ssm_parameter: Add resource identity support ([#43736](https://github.com/hashicorp/terraform-provider-aws/issues/43736)) + +BUG FIXES: + +* ephemeral-resource/aws_lambda_invocation: Fix plan inconsistency issue due to improperly assigned payload values ([#43676](https://github.com/hashicorp/terraform-provider-aws/issues/43676)) +* provider: Fix failure to detect resources deleted outside of Terraform as missing for numerous resource types ([#43659](https://github.com/hashicorp/terraform-provider-aws/issues/43659)) +* resource/aws_batch_compute_environment: Fix `inconsistent final plan` error when `compute_resource.launch_template.version` is unknown during an update ([#43337](https://github.com/hashicorp/terraform-provider-aws/issues/43337)) +* resource/aws_bedrockagent_flow: Prevent `created_at` becoming `null` on Update ([#43654](https://github.com/hashicorp/terraform-provider-aws/issues/43654)) +* resource/aws_ec2_managed_prefix_list: Fix `PrefixListVersionMismatch: The prefix list has the incorrect version number` errors when updating entry description ([#43661](https://github.com/hashicorp/terraform-provider-aws/issues/43661)) +* resource/aws_fsx_lustre_file_system: Fix validation of SSD read cache size for file systems using the Intelligent-Tiering storage class ([#43605](https://github.com/hashicorp/terraform-provider-aws/issues/43605)) +* resource/aws_instance: Prevent destruction of resource when `disable_api_termination` is `true` ([#43722](https://github.com/hashicorp/terraform-provider-aws/issues/43722)) +* resource/aws_kms_key: Restore pre-v6.3.0 retry delay behavior when waiting for continuous target state occurrences. This fixes certain tag update timeouts ([#43716](https://github.com/hashicorp/terraform-provider-aws/issues/43716)) +* resource/aws_s3tables_table_bucket: Fix crash on `maintenance_configuration` read failure ([#43707](https://github.com/hashicorp/terraform-provider-aws/issues/43707)) +* resource/aws_sagemaker_image: Fix `image_name` regular expression validation ([#43751](https://github.com/hashicorp/terraform-provider-aws/issues/43751)) +* resource/aws_timestreaminfluxdb_db_instance: Don't mark `network_type` as [ForceNew](https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#forcenew) if the value is not configured. This fixes a problem with `terraform apply -refresh=false` after upgrade from `v5.90.0` and below ([#43534](https://github.com/hashicorp/terraform-provider-aws/issues/43534)) +* resource/aws_wafv2_regex_pattern_set: Remove maximum items limit on the `regular_expression` argument ([#43693](https://github.com/hashicorp/terraform-provider-aws/issues/43693)) + +## 6.7.0 (July 31, 2025) FEATURES: @@ -10,11 +110,13 @@ ENHANCEMENTS: * data-source/aws_codebuild_fleet: Add `instance_type` attribute in `compute_configuration` block ([#43449](https://github.com/hashicorp/terraform-provider-aws/issues/43449)) * data-source/aws_ebs_volume: Add `volume_initialization_rate` attribute ([#43565](https://github.com/hashicorp/terraform-provider-aws/issues/43565)) * data-source/aws_ecs_service: Support `load_balancer` attribute ([#43582](https://github.com/hashicorp/terraform-provider-aws/issues/43582)) +* data-source/aws_s3_access_point: Add `tags` attribute. This functionality requires the `s3:ListTagsForResource` IAM permission with S3 Access Points for general purpose buckets and the `s3express:ListTagsForResource` IAM permission with S3 Access Points for directory buckets ([#43630](https://github.com/hashicorp/terraform-provider-aws/issues/43630)) * data-source/aws_verifiedpermissions_policy_store: Add `deletion_protection` attribute ([#43452](https://github.com/hashicorp/terraform-provider-aws/issues/43452)) * resource/aws_athena_workgroup: Add `configuration.identity_center_configuration` argument ([#38717](https://github.com/hashicorp/terraform-provider-aws/issues/38717)) * resource/aws_cleanrooms_collaboration: Add `analytics_engine` argument ([#43614](https://github.com/hashicorp/terraform-provider-aws/issues/43614)) * resource/aws_codebuild_fleet: Add `instance_type` argument in `compute_configuration` block to support custom instance types ([#43449](https://github.com/hashicorp/terraform-provider-aws/issues/43449)) * resource/aws_ebs_volume: Add `volume_initialization_rate` argument ([#43565](https://github.com/hashicorp/terraform-provider-aws/issues/43565)) +* resource/aws_s3_access_point: Add `tags` argument and `tags_all` attribute. This functionality requires the `s3:ListTagsForResource`, `s3:TagResource`, and `s3:UntagResource` IAM permissions with S3 Access Points for general purpose buckets and the `s3express:ListTagsForResource`, `s3express:TagResource`, and `s3express:UntagResource` IAM permissions with S3 Access Points for directory buckets ([#43630](https://github.com/hashicorp/terraform-provider-aws/issues/43630)) * resource/aws_verifiedpermissions_policy_store: Add `deletion_protection` argument ([#43452](https://github.com/hashicorp/terraform-provider-aws/issues/43452)) BUG FIXES: diff --git a/GNUmakefile b/GNUmakefile index 003b05e95e9a..bb3e9f3e64bf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -235,7 +235,7 @@ fix-constants: semgrep-constants fmt ## Use Semgrep to fix constants fix-imports: ## Fixing source code imports with goimports @echo "make: Fixing source code imports with goimports..." - @find internal -name "*.go" -type f -exec goimports -w {} \; + @find ./$(PKG_NAME) -name "*.go" -type f -exec goimports -w {} \; fmt: ## Fix Go source formatting @echo "make: Fixing source code with gofmt..." @@ -383,6 +383,9 @@ provider-lint: ## [CI] ProviderLint Checks / providerlint -XS002=false \ $(SVC_DIR)/... ./internal/provider/... +quick-fix: fmt testacc-lint-fix fix-imports modern-fix semgrep-fix ## Some quick fixes + @echo "make: Quick fixes..." + provider-markdown-lint: ## [CI] Provider Check / markdown-lint @echo "make: Provider Check / markdown-lint..." @docker run --rm \ @@ -627,7 +630,7 @@ t: prereq-go fmt-check ## Run acceptance tests (similar to testacc) test: prereq-go fmt-check ## Run unit tests @echo "make: Running unit tests..." - $(GO_VER) test -count $(TEST_COUNT) $(TEST) $(TESTARGS) -timeout=15m -vet=off + $(GO_VER) test $(TEST) -v -count $(TEST_COUNT) -parallel $(ACCTEST_PARALLELISM) $(RUNARGS) $(TESTARGS) -timeout 15m -vet=off test-compile: prereq-go ## Test package compilation @if [ "$(TEST)" = "./..." ]; then \ @@ -727,6 +730,7 @@ tools: prereq-go ## Install tools cd .ci/tools && $(GO_VER) install github.com/pavius/impi/cmd/impi cd .ci/tools && $(GO_VER) install github.com/rhysd/actionlint/cmd/actionlint cd .ci/tools && $(GO_VER) install github.com/terraform-linters/tflint + cd .ci/tools && $(GO_VER) install golang.org/x/tools/cmd/stringer cd .ci/tools && $(GO_VER) install mvdan.cc/gofumpt ts: testacc-short ## Alias to testacc-short @@ -885,45 +889,45 @@ yamllint: ## [CI] YAML Linting / yamllint acctest-lint \ build \ changelog-misspell \ - ci-quick \ ci \ + ci-quick \ + clean \ clean-go \ clean-make-tests \ clean-tidy \ - clean \ copyright \ default \ deps-check \ + docs \ docs-check \ docs-link-check \ - docs-lint-fix \ docs-lint \ + docs-lint-fix \ docs-markdown-lint \ docs-misspell \ - docs \ examples-tflint \ fix-constants \ fix-imports \ - fmt-check \ fmt \ + fmt-check \ fumpt \ - gen-check \ gen \ + gen-check \ generate-changelog \ gh-workflows-lint \ go-build \ go-misspell \ + golangci-lint \ golangci-lint1 \ golangci-lint2 \ golangci-lint3 \ golangci-lint4 \ golangci-lint5 \ - golangci-lint \ help \ import-lint \ install \ - lint-fix \ lint \ + lint-fix \ misspell \ modern-check \ modern-fix \ @@ -931,37 +935,38 @@ yamllint: ## [CI] YAML Linting / yamllint prereq-go \ provider-lint \ provider-markdown-lint \ + quick-fix \ sane \ sanity \ + semgrep \ semgrep-all \ semgrep-code-quality \ semgrep-constants \ semgrep-docker \ semgrep-fix \ - semgrep-naming-cae \ semgrep-naming \ + semgrep-naming-cae \ semgrep-service-naming \ semgrep-validate \ semgrep-vcr \ - semgrep \ - skaff-check-compile \ skaff \ + skaff-check-compile \ smoke \ sweep \ + sweeper \ sweeper-check \ sweeper-linked \ sweeper-unlinked \ - sweeper \ t \ - test-compile \ test \ - testacc-lint-fix \ + test-compile \ + testacc \ testacc-lint \ + testacc-lint-fix \ testacc-short \ testacc-tflint \ testacc-tflint-dir \ testacc-tflint-embedded \ - testacc \ tflint-init \ tfproviderdocs \ tfsdk2fw \ @@ -969,15 +974,15 @@ yamllint: ## [CI] YAML Linting / yamllint ts \ update \ vcr-enable \ + website \ + website-link-check \ website-link-check-ghrc \ website-link-check-markdown \ website-link-check-md \ - website-link-check \ - website-lint-fix \ website-lint \ + website-lint-fix \ website-markdown-lint \ website-misspell \ website-terrafmt \ website-tflint \ - website \ yamllint diff --git a/docs/ai-agent-guides/arn-based-resource-identity.md b/docs/ai-agent-guides/arn-based-resource-identity.md new file mode 100644 index 000000000000..ae379316880a --- /dev/null +++ b/docs/ai-agent-guides/arn-based-resource-identity.md @@ -0,0 +1,110 @@ +# Adding Resource Identity to ARN-based Resources + +You are working on the [Terraform AWS Provider](https://github.com/hashicorp/terraform-provider-aws), specifically focused on adding [resource identity](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/identity) to existing ARN-based Plugin SDKV2 resources. +[This Github issue](https://github.com/hashicorp/terraform-provider-aws/issues/42984) contains the resources that need resource identity support and have an ARN based identity. + +When adding resource identity, all resources in a service should be done in the same pull request. +Follow the steps below to complete this task. + +## 1. Prepare the branch + +- The feature branch name should begin with `f-ri` and be suffixed with the name of the service being updated, e.g. `f-ri-elbv2`. If the current branch does not match this convention, create one. +- Ensure the feature branch is rebased with the `main` branch. + +## 2. Add resource identity to each resource + +The changes for each individual resource should be done in its own commit. +Use the following steps to add resource identity to an existing resource: + +- Add the `@ArnIdentity` annotation to the target resource. If the corresponding property is named `arn`, then the `arnAttribute` value does not need to be specified. +- If the resource's test file uses a `CheckExists` helper function that accepts 3 parameters rather than 2 (you can check this in the resource's test file), add another annotation to the resource file in the format `// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types;types.TrustStore")`, but replacing the type with the correct one for the resource in question. The type should match the third parameter of the CheckExists function. +- Since we are newly adding identity to this resource, add an annotation indicating the most recent pre-identity version, e.g. `@Testing(preIdentityVersion="v6.3.0")`. Use `CHANGELOG.md` at the project root to determine the most recently released version (which will be the last before identity is added). +- Some resources will have an importer function defined. If that function uses `schema.ImportStatePassthroughContext` as `StateContext` value then remove that importer function declaration as it is no longer necessary. +- If the service does not use generated tag tests, you will need to create template files in the `testdata/tmpl` directory. For each resource, create a file named `_tags.gtpl` (e.g., `trust_store_tags.gtpl`). +- Populate each template file with the configuration from the resource's `_basic` test. If populating from the `_basic` configuration, be sure to replace any string format directives (e.g. `name = %[1]q`) with a corresponding reference to a variable (e.g. `name = var.rName`). +- The generators will use the template files to generate the resource identity test configuration. These will be located in the `testdata` directory for the service. **Do not manually create test directories or files as they will be generated.** +- The region template must be included inside each resource block in the template files. Add it as the first line after the resource declaration: + +```hcl +resource "aws_service_thing" "test" { +{{- template "region" }} + name = var.rName +{{- template "tags" }} +} +``` + +- If the test configuration references an `aws_region` data source, the region template should also be embedded here. + +```hcl +data "aws_region" "current" { +{{- template "region" }} +} +``` + +## 3. Generate and test the changes + +- Run the generators for this service. This can be done with the following command (e.g. for the elbv2 package): `go generate ./internal/service/elbv2/...`. This will generate tests for Resource Identity and any required test files. +- Run the tests in this order: + - First run the basic identity test: `make testacc PKG= TESTS=TestAcc_Identity_Basic` + - Run all identity tests: `make testacc PKG= TESTS=TestAcc_Identity` + - Finally, run all tests for the resource: `make testacc PKG= TESTS=TestAcc_`. **Always include the `PKG` parameter to properly scope the tests to the intended service package.** +- Ensure the template modifications have not introduced any structural changes that would fail `terraform fmt`. To verify, run `terraform fmt -recursive -check`, and confirm there is no output. +- If all the preceding steps complete successfully commit the changes with an appropriate message, e.g. `r/aws_lb_target_group: add resource identity`. Ensure the commit message body includes the results of the acceptance test run in the previous step. + +Repeat steps 2 and 3 for each resource in the service. When all resources are complete, proceed to the next section. + +## 4. Submit a pull request + +**!!!Important!!!**: Ask for confirmation before proceeding with this step. + +- Push the changes. +- Create a draft pull request with the following details: + - Title: "Add ARN-based resource identity to ``", e.g. "Add ARN-based resource identity to `elbv2`". + - Use the following template for the body. Be sure to replace the acceptance test results section with the full results + +``` +### Description +Add resource identity to ARN-based resources in ``. This includes: + + + +### Relations +Relates #42983 +Relates #42984 + +### Output from Acceptance Testing + + + +``` + +- Once the pull request is created, fetch the PR number to add changelog entries. Create a new file, `.changelog/.txt`, and include one enhancement entry per resource. Refer to `.changelog/43503.txt` for the appropriate formatting. +- Provide a summary of the completed changes. + +## Common Issues and Troubleshooting + +### Test Failures + +- Ensure `PKG` parameter is included in test commands +- Verify template file names match exactly (`_tags.gtpl`) +- Check region template placement is inside resource blocks +- Don't create test directories manually - let the generator create them +- If a generated test panics because a `testAccCheck*Exists` helper function has incorrect arguments, add a `@Testing(existsType="")` annotation. NEVER modify the function signature of an existing "exists" helper function + +### Generator Issues + +- Remove any manually created test directories before running the generator +- Ensure template files are in the correct location (`testdata/tmpl`) +- Verify template file names match the resource name +- If identity tests are not generated, verify that the `identitytests` generator is being called within the service's `generate.go` file. If it isn't, add the following line to `generate.go` next to the existing `go:generate` directives. +- If a generated test does not reference the `var.rName` variable, add an `// @Testing(generator=false)` annotation to remove it from the generated configuration. + +```go +//go:generate go run ../../generate/identitytests/main.go +``` + +### Resource Updates + +- Check if the resource's check exists helper takes 3 parameters +- Verify the correct type is used in the `existsType` annotation +- Ensure importer is only removed if using `ImportStatePassthroughContext` diff --git a/docs/ai-agent-guides/parameterized-resource-identity.md b/docs/ai-agent-guides/parameterized-resource-identity.md new file mode 100644 index 000000000000..9fde2beb8779 --- /dev/null +++ b/docs/ai-agent-guides/parameterized-resource-identity.md @@ -0,0 +1,133 @@ +# Adding Resource Identity to parameterized Resources + +You are working on the [Terraform AWS Provider](https://github.com/hashicorp/terraform-provider-aws), specifically focused on adding [resource identity](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/identity) to Plugin SDKV2 resources whose identity is composed from multiple parameters (parameterized). +[This Github meta issue](https://github.com/hashicorp/terraform-provider-aws/issues/42983) contains details and sub-issues related to adding resource identity support. + +When adding resource identity, a pull request may include all resources in a service or a single resource. +Follow the steps below to complete this task. + +## 1. Prepare the branch + +- The feature branch name should begin with `f-ri` and be suffixed with the name of the service being updated, e.g. `f-ri-elbv2`. If the current branch does not match this convention, create one. +- Ensure the feature branch is rebased with the `main` branch. + +## 2. Add resource identity to each resource + +The changes for each individual resource should be done in its own commit. +Use the following steps to add resource identity to an existing resource: + +- Determine which arguments the resource identity is composed from. This may be a single argument mapping to an AWS-generated identifier, or a combination of multiple arguments. Check for places where the resource ID is set (e.g. `d.SetId()`) and infer the relevant parameters. +- Add an `@IdentityAttribute("")` annotation to the target resource. For resources where the ID is composed from multiple arguments, add one annotation for each argument. +- If the `id` attribute is set to the same value as an identity attribute, add an `@Testing(idAttrDuplicates="")` annotation. +- If the resource's test file uses a `CheckExists` helper function that accepts 3 parameters rather than 2 (you can check this in the resource's test file), add another annotation to the resource file in the format `// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types;types.TrustStore")`, but replacing the type with the correct one for the resource in question. The type should match the third parameter of the CheckExists function. +- Since we are newly adding identity to this resource, add an annotation indicating the most recent pre-identity version, e.g. `@Testing(preIdentityVersion="v6.3.0")`. Use `CHANGELOG.md` at the project root to determine the most recently released version (which will be the last before identity is added). +- Some resources will have an importer function defined. + - If that function uses `schema.ImportStatePassthroughContext` as `StateContext` value then remove that importer function declaration as it is no longer necessary. + - If a custom import function is defined, add a `// @CustomImport` annotation and include the following at the beginning the custom `StateContext` function: + +```go + identitySpec := importer.IdentitySpec(ctx) + if err := importer.RegionalSingleParameterized(ctx, d, identitySpec, meta.(importer.AWSClient)); err != nil { + return nil, err + } +``` + +- If the service does not use generated tag tests, you will need to create template files in the `testdata/tmpl` directory. For each resource, create a file named `_tags.gtpl` (e.g., `trust_store_tags.gtpl`). +- Populate each template file with the configuration from the resource's `_basic` test. If populating from the `_basic` configuration, be sure to replace any string format directives (e.g. `name = %[1]q`) with a corresponding reference to a variable (e.g. `name = var.rName`). +- The generators will use the template files to generate the resource identity test configuration. These will be located in the `testdata` directory for the service. **Do not manually create test directories or files as they will be generated.** +- The region template must be included inside each resource block in the template files. Add it as the first line after the resource declaration: + +```hcl +resource "aws_service_thing" "test" { +{{- template "region" }} + name = var.rName +{{- template "tags" }} +} +``` + +- If the resource already has a tags template declaration different than the example above, e.g. `{{- template "tags" . }}`, leave it unchanged. +- If the test configuration references an `aws_region` data source, the region template should also be embedded here. + +```hcl +data "aws_region" "current" { +{{- template "region" }} +} +``` + +## 3. Generate and test the changes + +- Run the generators for this service. This can be done with the following command (e.g. for the elbv2 package): `go generate ./internal/service/elbv2/...`. This will generate tests for Resource Identity and any required test files. +- Run the tests in this order: + - First run the basic identity test: `make testacc PKG= TESTS=TestAcc_Identity_Basic` + - Run all identity tests: `make testacc PKG= TESTS=TestAcc_Identity` + - Finally, run all tests for the resource: `make testacc PKG= TESTS=TestAcc_`. **Always include the `PKG` parameter to properly scope the tests to the intended service package.** +- Ensure the template modifications have not introduced any structural changes that would fail `terraform fmt`. To verify, run `terraform fmt -recursive -check`, and confirm there is no output. +- If all the preceding steps complete successfully commit the changes with an appropriate message, e.g. `r/aws_lb_target_group: add resource identity`. Ensure the commit message body includes the results of the acceptance test run in the previous step. + +Repeat steps 2 and 3 for each resource in the service. When all resources are complete, proceed to the next section. + +## 4. Submit a pull request + +**!!!Important!!!**: Ask for confirmation before proceeding with this step. + +- Push the changes. +- Create a draft pull request with the following details: + - Title: "Add parameterized resource identity to ``", e.g. "Add parameterized resource identity to `elbv2`". If only a single resource is included, replace service-name with the full Terraform resource name. + - Use the following template for the body. Be sure to replace the acceptance test results section with the results from the full acceptance test suite run. + +``` +### Description +Add resource identity to parameterized resources in ``. This includes: + + + +### Relations +Relates #42983 +Relates #42988 + +### Output from Acceptance Testing + + + +``` + +- Once the pull request is created, fetch the PR number to add changelog entries. Create a new file, `.changelog/.txt`, and include one enhancement entry per resource. Refer to `.changelog/43503.txt` for the appropriate formatting. +- Provide a summary of the completed changes. + +## Common Issues and Troubleshooting + +### Test Failures + +- Ensure `PKG` parameter is included in test commands +- Verify template file names match exactly (`_tags.gtpl`) +- Check region template placement is inside resource blocks +- Don't create test directories manually - let the generator create them +- If a generated test panics because a `testAccCheck*Exists` helper function has incorrect arguments, add a `@Testing(existsType="")` annotation. NEVER modify the function signature of an existing "exists" helper function + +### Generator Issues + +- Remove any manually created test directories before running the generator +- Ensure template files are in the correct location (`testdata/tmpl`) +- Verify template file names match the resource name +- If identity tests are not generated, verify that the `identitytests` generator is being called within the service's `generate.go` file. If it isn't, add the following line to `generate.go` next to the existing `go:generate` directives. +- If a generated test does not reference the `var.rName` variable, add an `// @Testing(generator=false)` annotation to remove it from the generated configuration. + +```go +//go:generate go run ../../generate/identitytests/main.go +``` + +### Resource Updates + +- Check if the resource's check exists helper takes 3 parameters +- Verify the correct type is used in the `existsType` annotation +- Ensure importer is only removed if using `ImportStatePassthroughContext` + +### Import Test Failures + +- If identity tests are failing because they expect an update during import but get a no-op, add an `// @Testing(plannableImportAction="NoOp")` annotation and re-generate the test files. +- If identity tests are failing import verification due to missing attribute values, check the `_basic` test implementation for the presence of an `ImportStateVerifyIgnore` field in the import test step. If present, add an `// @Testing(importIgnore="arg1")` annotation where `arg1` is replaced with the argument name(s) from the verify ignore slice. If mutiple fields are ignored, separate field names with a `;`, e.g. `arg1;arg2`. +- If a region override test is failing and a custom import fuction is configured, ensure the appropriate helper function from the `importer` package is used. + - `RegionalSingleParameterized` - regional resources whose identity is made up of a single parameter. + - `GlobalSingleParameterized` - global resources whose identity is made up of a single parameter. + - `RegionalMultipleParameterized` - regional resources whose identity is made up of multiple parameters. + - `GlobalMultipleParameterized` - global resources whose identity is made up of multiple parameters. diff --git a/docs/smarterr.md b/docs/ai-agent-guides/smarterr.md similarity index 100% rename from docs/smarterr.md rename to docs/ai-agent-guides/smarterr.md diff --git a/docs/ai-agents.md b/docs/ai-agents.md new file mode 100644 index 000000000000..8e20c6e54585 --- /dev/null +++ b/docs/ai-agents.md @@ -0,0 +1,8 @@ +# AI Agents + +The `AI Agent Guides` section on the navbar serves as an index of documents which can be provided to AI agents as context to solve specific tasks. +The following points should be taken into consideration when developing new guides. + +- Use generalized instructions and remain tool agnostic. +- Limit scope to a single task per document. +- Structure documents so they are useful to both AI agents and human readers. diff --git a/docs/dependency-updates.md b/docs/dependency-updates.md index 744f2986f0cf..aea1d8e8eb70 100644 --- a/docs/dependency-updates.md +++ b/docs/dependency-updates.md @@ -12,7 +12,6 @@ Ensure that the following steps are tracked within the issue and completed withi - Update go version in `go.mod` - Verify `make test lint` works as expected -- Verify `goreleaser build --snapshot` succeeds for all currently supported architectures - Verify `goenv` support for the new version - Update `docs/development-environment.md` - Update `.go-version` diff --git a/docs/resource-tagging.md b/docs/resource-tagging.md index 70b745f871ab..f5928867c7f8 100644 --- a/docs/resource-tagging.md +++ b/docs/resource-tagging.md @@ -504,6 +504,10 @@ To override the common name, set the annotation `@Testing(tlsKeyDomain= 0 && d.pollInterval < 180*time.Second { - wait = d.pollInterval + delay = d.pollInterval } else { - if wait < d.minTimeout { - wait = d.minTimeout - } else if wait > 10*time.Second { - wait = 10 * time.Second + if delay < d.minTimeout { + delay = d.minTimeout + } else if delay > 10*time.Second { + delay = 10 * time.Second } } - d.wait = wait + d.delay = delay - return wait + return delay } -// SDKv2HelperRetryCompatibleDelay returns a Terraform Plugin SDK v2 helper/retry-compatible delay. -func SDKv2HelperRetryCompatibleDelay(initialDelay, pollInterval, minTimeout time.Duration) DelayFunc { - delay := &sdkv2HelperRetryCompatibleDelay{ - minTimeout: minTimeout, - pollInterval: pollInterval, - } - - return func(n uint) time.Duration { - if n == 0 { - return initialDelay - } +// SetIncrementDelay sets a flag to determine whether or not the next call to Next increments the delay duration. +func (d *sdkv2HelperRetryCompatibleDelay) SetIncrementDelay(incrementDelay bool) { + d.incrementDelay = incrementDelay +} - return delay.delay() +// SDKv2HelperRetryCompatibleDelay returns a Terraform Plugin SDK v2 helper/retry-compatible delay. +func SDKv2HelperRetryCompatibleDelay(initialDelay, pollInterval, minTimeout time.Duration) Delay { + return &sdkv2HelperRetryCompatibleDelay{ + incrementDelay: true, + initialDelay: initialDelay, + minTimeout: minTimeout, + pollInterval: pollInterval, } } // DefaultSDKv2HelperRetryCompatibleDelay returns a Terraform Plugin SDK v2 helper/retry-compatible delay // with default values (from the `RetryContext` function). -func DefaultSDKv2HelperRetryCompatibleDelay() DelayFunc { +func DefaultSDKv2HelperRetryCompatibleDelay() Delay { return SDKv2HelperRetryCompatibleDelay(0, 0, 500*time.Millisecond) //nolint:mnd // 500ms is the Plugin SDKv2 default } +var ( + _ DelayWithSetIncrementDelay = (*sdkv2HelperRetryCompatibleDelay)(nil) +) + // LoopConfig configures a loop. type LoopConfig struct { - delay DelayFunc + delay Delay gracePeriod time.Duration timer Timer } @@ -111,7 +140,7 @@ func WithGracePeriod(d time.Duration) Option { } } -func WithDelay(d DelayFunc) Option { +func WithDelay(d Delay) Option { if d == nil { return emptyOption } @@ -186,7 +215,7 @@ func (r *Loop) Continue(ctx context.Context) bool { r.gracePeriod = 0 } - r.sleep(ctx, r.config.delay(r.attempt)) + r.sleep(ctx, r.config.delay.Next(r.attempt)) r.attempt++ return context.Cause(ctx) == nil diff --git a/internal/backoff/backoff_test.go b/internal/backoff/backoff_test.go index 633b343cd3ae..e7ba0ae359c9 100644 --- a/internal/backoff/backoff_test.go +++ b/internal/backoff/backoff_test.go @@ -29,7 +29,35 @@ func TestDefaultSDKv2HelperRetryCompatibleDelay(t *testing.T) { } var got []time.Duration for i := range len(want) { - got = append(got, delay(uint(i))) + got = append(got, delay.Next(uint(i))) + } + + if diff := cmp.Diff(got, want); diff != "" { + t.Errorf("unexpected diff (+wanted, -got): %s", diff) + } +} + +func TestDefaultSDKv2HelperRetryCompatibleDelayWithIncrementDelay(t *testing.T) { + t.Parallel() + + delay := DefaultSDKv2HelperRetryCompatibleDelay() + want := []time.Duration{ + 0, + 500 * time.Millisecond, + 1 * time.Second, + 1 * time.Second, + 1 * time.Second, + 2 * time.Second, + 4 * time.Second, + 8 * time.Second, + 10 * time.Second, + 10 * time.Second, + } + var got []time.Duration + for i := range len(want) { + delay.(DelayWithSetIncrementDelay).SetIncrementDelay(i < 3 || i > 4) + + got = append(got, delay.Next(uint(i))) } if diff := cmp.Diff(got, want); diff != "" { @@ -50,7 +78,7 @@ func TestSDKv2HelperRetryCompatibleDelay(t *testing.T) { } var got []time.Duration for i := range len(want) { - got = append(got, delay(uint(i))) + got = append(got, delay.Next(uint(i))) } if diff := cmp.Diff(got, want); diff != "" { @@ -71,7 +99,7 @@ func TestSDKv2HelperRetryCompatibleDelayWithPollTimeout(t *testing.T) { } var got []time.Duration for i := range len(want) { - got = append(got, delay(uint(i))) + got = append(got, delay.Next(uint(i))) } if diff := cmp.Diff(got, want); diff != "" { diff --git a/internal/conns/awsclient_gen.go b/internal/conns/awsclient_gen.go index 4c14e3c15a83..ab86d8135ea4 100644 --- a/internal/conns/awsclient_gen.go +++ b/internal/conns/awsclient_gen.go @@ -32,6 +32,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/bcmdataexports" "github.com/aws/aws-sdk-go-v2/service/bedrock" "github.com/aws/aws-sdk-go-v2/service/bedrockagent" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol" "github.com/aws/aws-sdk-go-v2/service/billing" "github.com/aws/aws-sdk-go-v2/service/budgets" "github.com/aws/aws-sdk-go-v2/service/chatbot" @@ -171,6 +172,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/notifications" "github.com/aws/aws-sdk-go-v2/service/notificationscontacts" "github.com/aws/aws-sdk-go-v2/service/oam" + "github.com/aws/aws-sdk-go-v2/service/odb" "github.com/aws/aws-sdk-go-v2/service/opensearch" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless" "github.com/aws/aws-sdk-go-v2/service/organizations" @@ -210,6 +212,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3control" "github.com/aws/aws-sdk-go-v2/service/s3outposts" "github.com/aws/aws-sdk-go-v2/service/s3tables" + "github.com/aws/aws-sdk-go-v2/service/s3vectors" "github.com/aws/aws-sdk-go-v2/service/sagemaker" "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/aws/aws-sdk-go-v2/service/schemas" @@ -370,6 +373,10 @@ func (c *AWSClient) BedrockAgentClient(ctx context.Context) *bedrockagent.Client return errs.Must(client[*bedrockagent.Client](ctx, c, names.BedrockAgent, make(map[string]any))) } +func (c *AWSClient) BedrockAgentCoreClient(ctx context.Context) *bedrockagentcorecontrol.Client { + return errs.Must(client[*bedrockagentcorecontrol.Client](ctx, c, names.BedrockAgentCore, make(map[string]any))) +} + func (c *AWSClient) BillingClient(ctx context.Context) *billing.Client { return errs.Must(client[*billing.Client](ctx, c, names.Billing, make(map[string]any))) } @@ -922,6 +929,10 @@ func (c *AWSClient) NotificationsContactsClient(ctx context.Context) *notificati return errs.Must(client[*notificationscontacts.Client](ctx, c, names.NotificationsContacts, make(map[string]any))) } +func (c *AWSClient) ODBClient(ctx context.Context) *odb.Client { + return errs.Must(client[*odb.Client](ctx, c, names.ODB, make(map[string]any))) +} + func (c *AWSClient) ObservabilityAccessManagerClient(ctx context.Context) *oam.Client { return errs.Must(client[*oam.Client](ctx, c, names.ObservabilityAccessManager, make(map[string]any))) } @@ -1082,6 +1093,10 @@ func (c *AWSClient) S3TablesClient(ctx context.Context) *s3tables.Client { return errs.Must(client[*s3tables.Client](ctx, c, names.S3Tables, make(map[string]any))) } +func (c *AWSClient) S3VectorsClient(ctx context.Context) *s3vectors.Client { + return errs.Must(client[*s3vectors.Client](ctx, c, names.S3Vectors, make(map[string]any))) +} + func (c *AWSClient) SESClient(ctx context.Context) *ses.Client { return errs.Must(client[*ses.Client](ctx, c, names.SES, make(map[string]any))) } diff --git a/internal/framework/flex/diff.go b/internal/framework/flex/diff.go index f30cd3cc5967..b85277aaf894 100644 --- a/internal/framework/flex/diff.go +++ b/internal/framework/flex/diff.go @@ -110,6 +110,7 @@ func implementsAttrValue(field reflect.Value) bool { func skippedFields() []string { return []string{ + "Region", "Tags", "TagsAll", "Timeouts", diff --git a/internal/framework/types/list_nested_objectof.go b/internal/framework/types/list_nested_objectof.go index 9702bd4d9800..75a1b2c7f481 100644 --- a/internal/framework/types/list_nested_objectof.go +++ b/internal/framework/types/list_nested_objectof.go @@ -119,7 +119,7 @@ func (t listNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap func (t listNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics) { var diags diag.Diagnostics - return NewListNestedObjectValueOfNull[T](ctx, WithSemanticEqualityFunc(t.semanticEqualityFunc)), diags + return NewListNestedObjectValueOfNull(ctx, WithSemanticEqualityFunc(t.semanticEqualityFunc)), diags } func (t listNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics) { @@ -275,7 +275,7 @@ func NewListNestedObjectValueOfPtrMust[T any](ctx context.Context, t *T, f ...Ne } func NewListNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T, f semanticEqualityFunc[T]) (ListNestedObjectValueOf[T], diag.Diagnostics) { - return newListNestedObjectValueOf[T](ctx, ts, f) + return newListNestedObjectValueOf(ctx, ts, f) } func NewListNestedObjectValueOfSliceMust[T any](ctx context.Context, ts []*T, f ...NestedObjectOfOption[T]) ListNestedObjectValueOf[T] { @@ -285,7 +285,7 @@ func NewListNestedObjectValueOfSliceMust[T any](ctx context.Context, ts []*T, f func NewListNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T, f ...NestedObjectOfOption[T]) (ListNestedObjectValueOf[T], diag.Diagnostics) { opts := newNestedObjectOfOptions(f...) - return newListNestedObjectValueOf[T](ctx, ts, opts.SemanticEqualityFunc) + return newListNestedObjectValueOf(ctx, ts, opts.SemanticEqualityFunc) } func NewListNestedObjectValueOfValueSliceMust[T any](ctx context.Context, ts []T, f ...NestedObjectOfOption[T]) ListNestedObjectValueOf[T] { diff --git a/internal/framework/types/objectof.go b/internal/framework/types/objectof.go index d72a161b3de9..61a4a9544c08 100644 --- a/internal/framework/types/objectof.go +++ b/internal/framework/types/objectof.go @@ -250,5 +250,5 @@ func NewObjectValueOf[T any](ctx context.Context, t *T) (ObjectValueOf[T], diag. } func NewObjectValueOfMust[T any](ctx context.Context, t *T) ObjectValueOf[T] { - return fwdiag.Must(NewObjectValueOf[T](ctx, t)) + return fwdiag.Must(NewObjectValueOf(ctx, t)) } diff --git a/internal/framework/types/set_nested_objectof.go b/internal/framework/types/set_nested_objectof.go index 22f939789273..0bd4198724a0 100644 --- a/internal/framework/types/set_nested_objectof.go +++ b/internal/framework/types/set_nested_objectof.go @@ -117,7 +117,7 @@ func (t setNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap i func (t setNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics) { var diags diag.Diagnostics - return NewSetNestedObjectValueOfNull[T](ctx, WithSemanticEqualityFunc(t.semanticEqualityFunc)), diags + return NewSetNestedObjectValueOfNull(ctx, WithSemanticEqualityFunc(t.semanticEqualityFunc)), diags } func (t setNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics) { @@ -223,7 +223,7 @@ func NewSetNestedObjectValueOfPtrMust[T any](ctx context.Context, t *T, options } func NewSetNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T, f semanticEqualityFunc[T]) (SetNestedObjectValueOf[T], diag.Diagnostics) { - return newSetNestedObjectValueOf[T](ctx, ts, f) + return newSetNestedObjectValueOf(ctx, ts, f) } func NewSetNestedObjectValueOfSliceMust[T any](ctx context.Context, ts []*T, options ...NestedObjectOfOption[T]) SetNestedObjectValueOf[T] { @@ -233,7 +233,7 @@ func NewSetNestedObjectValueOfSliceMust[T any](ctx context.Context, ts []*T, opt func NewSetNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T, options ...NestedObjectOfOption[T]) (SetNestedObjectValueOf[T], diag.Diagnostics) { opts := newNestedObjectOfOptions(options...) - return newSetNestedObjectValueOf[T](ctx, ts, opts.SemanticEqualityFunc) + return newSetNestedObjectValueOf(ctx, ts, opts.SemanticEqualityFunc) } func NewSetNestedObjectValueOfValueSliceMust[T any](ctx context.Context, ts []T, options ...NestedObjectOfOption[T]) SetNestedObjectValueOf[T] { diff --git a/internal/framework/types/smithy_json.go b/internal/framework/types/smithy_json.go index caa104e951e4..83e792a91816 100644 --- a/internal/framework/types/smithy_json.go +++ b/internal/framework/types/smithy_json.go @@ -91,7 +91,7 @@ func (t SmithyJSONType[T]) ValueFromString(ctx context.Context, in basetypes.Str return SmithyJSONUnknown[T](), diags } - return SmithyJSONValue[T](in.ValueString(), t.f), diags + return SmithyJSONValue(in.ValueString(), t.f), diags } var ( diff --git a/internal/generate/identitytests/main.go b/internal/generate/identitytests/main.go index 12582f3de043..5901dfa570db 100644 --- a/internal/generate/identitytests/main.go +++ b/internal/generate/identitytests/main.go @@ -13,7 +13,6 @@ import ( "go/ast" "go/parser" "go/token" - "iter" "os" "path" "path/filepath" @@ -22,11 +21,9 @@ import ( "strconv" "strings" "text/template" - "time" "github.com/dlclark/regexp2" "github.com/hashicorp/go-version" - acctestgen "github.com/hashicorp/terraform-provider-aws/internal/acctest/generate" "github.com/hashicorp/terraform-provider-aws/internal/generate/common" "github.com/hashicorp/terraform-provider-aws/internal/generate/tests" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" @@ -98,20 +95,13 @@ func main() { } for _, resource := range v.identityResources { + resource.service = &svc + sourceName := resource.FileName ext := filepath.Ext(sourceName) sourceName = strings.TrimSuffix(sourceName, ext) sourceName = strings.TrimSuffix(sourceName, "_") - if name, err := svc.ProviderNameUpper(resource.TypeName); err != nil { - g.Fatalf("determining provider service name: %w", err) - } else { - resource.ResourceProviderNameUpper = name - } - resource.PackageProviderNameUpper = svc.PackageProviderNameUpper() - resource.ProviderPackage = servicePackage - resource.ARNNamespace = svc.ARNNamespace() - if svc.primary.IsGlobal() { resource.IsGlobal = true } @@ -136,7 +126,14 @@ func main() { }, "NewVersion": version.NewVersion, } - templates, err := template.New("identitytests").Funcs(templateFuncMap).Parse(resourceTestGoTmpl) + templates := template.New("identitytests").Funcs(templateFuncMap) + + templates, err = tests.AddCommonResourceTestTemplates(templates) + if err != nil { + g.Fatalf(err.Error()) + } + + templates, err = templates.Parse(resourceTestGoTmpl) if err != nil { g.Fatalf("parsing base Go test template: %w", err) } @@ -184,7 +181,7 @@ func main() { resource.GenerateConfig = true if resource.GenerateConfig { - additionalTfVars := tfmaps.Keys(resource.additionalTfVars) + additionalTfVars := tfmaps.Keys(resource.AdditionalTfVars_) slices.Sort(additionalTfVars) testDirPath := path.Join("testdata", resource.Name) @@ -193,7 +190,7 @@ func main() { g.Fatalf("parsing base Terraform config template: %s", err) } - tfTemplates, err = tests.AddCommonTemplates(tfTemplates) + tfTemplates, err = tests.AddCommonTfTemplates(tfTemplates) if err != nil { g.Fatalf(err.Error()) } @@ -216,52 +213,54 @@ func main() { generateTestConfig(g, testDirPath, "basic", tfTemplates, common) - if resource.PreIdentityVersion.Equal(v5_100_0) { - tfTemplatesV5, err := tfTemplates.Clone() - if err != nil { - g.Fatalf("cloning Terraform config template: %s", err) - } - ext := filepath.Ext(configTmplFile) - name := strings.TrimSuffix(configTmplFile, ext) - configTmplV5File := name + "_v5.100.0" + ext - configTmplV5Path := path.Join("testdata", "tmpl", configTmplV5File) - if _, err := os.Stat(configTmplV5Path); err == nil { - b, err := os.ReadFile(configTmplV5Path) + if resource.PreIdentityVersion != nil { + if resource.PreIdentityVersion.Equal(v5_100_0) { + tfTemplatesV5, err := tfTemplates.Clone() if err != nil { - g.Fatalf("reading config template %q: %s", configTmplV5Path, err) + g.Fatalf("cloning Terraform config template: %s", err) } - configTmplV5 := string(b) - _, err = tfTemplatesV5.New("body").Parse(configTmplV5) - if err != nil { - g.Fatalf("parsing config template %q: %s", configTmplV5Path, err) + ext := filepath.Ext(configTmplFile) + name := strings.TrimSuffix(configTmplFile, ext) + configTmplV5File := name + "_v5.100.0" + ext + configTmplV5Path := path.Join("testdata", "tmpl", configTmplV5File) + if _, err := os.Stat(configTmplV5Path); err == nil { + b, err := os.ReadFile(configTmplV5Path) + if err != nil { + g.Fatalf("reading config template %q: %s", configTmplV5Path, err) + } + configTmplV5 := string(b) + _, err = tfTemplatesV5.New("body").Parse(configTmplV5) + if err != nil { + g.Fatalf("parsing config template %q: %s", configTmplV5Path, err) + } } - } - commonV5 := common - commonV5.ExternalProviders = map[string]requiredProvider{ - "aws": { - Source: "hashicorp/aws", - Version: "5.100.0", - }, - } - generateTestConfig(g, testDirPath, "basic_v5.100.0", tfTemplatesV5, commonV5) + commonV5 := common + commonV5.ExternalProviders = map[string]requiredProvider{ + "aws": { + Source: "hashicorp/aws", + Version: "5.100.0", + }, + } + generateTestConfig(g, testDirPath, "basic_v5.100.0", tfTemplatesV5, commonV5) - commonV6 := common - commonV6.ExternalProviders = map[string]requiredProvider{ - "aws": { - Source: "hashicorp/aws", - Version: "6.0.0", - }, - } - generateTestConfig(g, testDirPath, "basic_v6.0.0", tfTemplates, commonV6) - } else { - commonPreIdentity := common - commonPreIdentity.ExternalProviders = map[string]requiredProvider{ - "aws": { - Source: "hashicorp/aws", - Version: resource.PreIdentityVersion.String(), - }, + commonV6 := common + commonV6.ExternalProviders = map[string]requiredProvider{ + "aws": { + Source: "hashicorp/aws", + Version: "6.0.0", + }, + } + generateTestConfig(g, testDirPath, "basic_v6.0.0", tfTemplates, commonV6) + } else { + commonPreIdentity := common + commonPreIdentity.ExternalProviders = map[string]requiredProvider{ + "aws": { + Source: "hashicorp/aws", + Version: resource.PreIdentityVersion.String(), + }, + } + generateTestConfig(g, testDirPath, fmt.Sprintf("basic_v%s", resource.PreIdentityVersion.String()), tfTemplates, commonPreIdentity) } - generateTestConfig(g, testDirPath, fmt.Sprintf("basic_v%s", resource.PreIdentityVersion.String()), tfTemplates, commonPreIdentity) } _, err = tfTemplates.New("region").Parse("\n region = var.region\n") @@ -291,6 +290,10 @@ type serviceRecords struct { additional []data.ServiceRecord } +func (sr serviceRecords) ProviderPackage() string { + return sr.primary.ProviderPackage() +} + func (sr serviceRecords) ProviderNameUpper(typeName string) (string, error) { if len(sr.additional) == 0 { return sr.primary.ProviderNameUpper(), nil @@ -352,37 +355,6 @@ func (sr serviceRecords) ARNNamespace() string { return sr.primary.ARNNamespace() } -type implementation string - -const ( - implementationFramework implementation = "framework" - implementationSDK implementation = "sdk" -) - -type importAction int - -const ( - importActionNoop importAction = iota - importActionUpdate - importActionReplace -) - -func (i importAction) String() string { - switch i { - case importActionNoop: - return "NoOp" - - case importActionUpdate: - return "Update" - - case importActionReplace: - return "Replace" - - default: - return "" - } -} - type triBoolean uint const ( @@ -392,86 +364,51 @@ const ( ) type ResourceDatum struct { - ProviderPackage string - ResourceProviderNameUpper string - PackageProviderNameUpper string - Name string - TypeName string - DestroyTakesT bool - HasExistsFunc bool - ExistsTypeName string - ExistsTakesT bool - FileName string - Generator string - idAttrDuplicates string // TODO: Remove. Still needed for Parameterized Identity - NoImport bool - ImportStateID string - importStateIDAttribute string - ImportStateIDFunc string - ImportIgnore []string - Implementation implementation - Serialize bool - SerializeDelay bool - SerializeParallelTests bool - PreChecks []codeBlock - PreChecksWithRegion []codeBlock - PreCheckRegions []string - GoImports []goImport - GenerateConfig bool - InitCodeBlocks []codeBlock - additionalTfVars map[string]string - CheckDestroyNoop bool - overrideIdentifierAttribute string - OverrideResourceType string - ARNNamespace string - ARNFormat string - arnAttribute string - isARNFormatGlobal triBoolean - ArnIdentity bool - MutableIdentity bool - IsGlobal bool - isSingleton bool - HasRegionOverrideTest bool - UseAlternateAccount bool - identityAttributes []identityAttribute - plannableImportAction importAction - identityAttribute string - IdentityDuplicateAttrs []string - IDAttrFormat string - HasV6_0NullValuesError bool - HasV6_0RefreshError bool - RequiredEnvVars []string - PreIdentityVersion *version.Version -} - -func (d ResourceDatum) AdditionalTfVars() map[string]string { - return tfmaps.ApplyToAllKeys(d.additionalTfVars, func(k string) string { - return acctestgen.ConstOrQuote(k) - }) + service *serviceRecords + FileName string + idAttrDuplicates string // TODO: Remove. Still needed for Parameterized Identity + GenerateConfig bool + ARNFormat string + arnAttribute string + isARNFormatGlobal triBoolean + ArnIdentity bool + MutableIdentity bool + IsGlobal bool + isSingleton bool + HasRegionOverrideTest bool + identityAttributes []identityAttribute + identityAttribute string + IdentityDuplicateAttrs []string + IDAttrFormat string + HasV6_0NullValuesError bool + HasV6_0RefreshError bool + HasNoPreExistingResource bool + PreIdentityVersion *version.Version + tests.CommonArgs } -func (d ResourceDatum) HasIDAttrDuplicates() bool { - return d.idAttrDuplicates != "" +func (d ResourceDatum) ProviderPackage() string { + return d.service.ProviderPackage() } -func (d ResourceDatum) IDAttrDuplicates() string { - return namesgen.ConstOrQuote(d.idAttrDuplicates) +func (d ResourceDatum) ResourceProviderNameUpper() (string, error) { + return d.service.ProviderNameUpper(d.TypeName) } -func (d ResourceDatum) HasImportStateIDAttribute() bool { - return d.importStateIDAttribute != "" +func (d ResourceDatum) PackageProviderNameUpper() string { + return d.service.PackageProviderNameUpper() } -func (d ResourceDatum) ImportStateIDAttribute() string { - return namesgen.ConstOrQuote(d.importStateIDAttribute) +func (d ResourceDatum) ARNNamespace() string { + return d.service.ARNNamespace() } -func (d ResourceDatum) OverrideIdentifier() bool { - return d.overrideIdentifierAttribute != "" +func (d ResourceDatum) HasIDAttrDuplicates() bool { + return d.idAttrDuplicates != "" } -func (d ResourceDatum) OverrideIdentifierAttribute() string { - return namesgen.ConstOrQuote(d.overrideIdentifierAttribute) +func (d ResourceDatum) IDAttrDuplicates() string { + return namesgen.ConstOrQuote(d.idAttrDuplicates) } func (d ResourceDatum) IsARNIdentity() bool { @@ -502,14 +439,6 @@ func (d ResourceDatum) HasInherentRegion() bool { return d.IsARNIdentity() || d.IsRegionalSingleton() } -func (d ResourceDatum) HasImportIgnore() bool { - return len(d.ImportIgnore) > 0 -} - -func (d ResourceDatum) PlannableResourceAction() string { - return d.plannableImportAction.String() -} - func (d ResourceDatum) IdentityAttribute() string { return namesgen.ConstOrQuote(d.identityAttribute) } @@ -535,15 +464,6 @@ func (i identityAttribute) Name() string { return namesgen.ConstOrQuote(i.name) } -type goImport struct { - Path string - Alias string -} - -type codeBlock struct { - Code string -} - type commonConfig struct { AdditionalTfVars []string WithRName bool @@ -628,12 +548,9 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { d := ResourceDatum{ FileName: v.fileName, - additionalTfVars: make(map[string]string), + CommonArgs: tests.InitCommonArgs(), IsGlobal: false, - HasExistsFunc: true, HasRegionOverrideTest: true, - plannableImportAction: importActionNoop, - PreIdentityVersion: version.Must(version.NewVersion("5.100.0")), } hasIdentity := false skip := false @@ -650,7 +567,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { break case "FrameworkResource": - d.Implementation = implementationFramework + d.Implementation = tests.ImplementationFramework args := common.ParseArgs(m[3]) if len(args.Positional) == 0 { v.errs = append(v.errs, fmt.Errorf("no type name: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) @@ -667,7 +584,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { break case "SDKResource": - d.Implementation = implementationSDK + d.Implementation = tests.ImplementationSDK args := common.ParseArgs(m[3]) if len(args.Positional) == 0 { v.errs = append(v.errs, fmt.Errorf("no type name: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) @@ -696,7 +613,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if attr, ok := args.Keyword["identityDuplicateAttributes"]; ok { attrs = strings.Split(attr, ";") } - if d.Implementation == implementationSDK { + if d.Implementation == tests.ImplementationSDK { attrs = append(attrs, "id") } slices.Sort(attrs) @@ -744,8 +661,8 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { } if attr, ok := args.Keyword["global"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid global value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("global", attr); err != nil { + v.errs = append(v.errs, err) continue } else { if b { @@ -781,11 +698,12 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { // TODO: allow underscore? case "V60SDKv2Fix": d.HasV6_0NullValuesError = true + d.PreIdentityVersion = v5_100_0 args := common.ParseArgs(m[3]) if attr, ok := args.Keyword["v60RefreshError"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid v60RefreshError value (%s): %s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + if b, err := tests.ParseBoolAttr("v60RefreshError", attr); err != nil { + v.errs = append(v.errs, err) } else { d.HasV6_0RefreshError = b } @@ -794,252 +712,28 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { case "Testing": args := common.ParseArgs(m[3]) - if attr, ok := args.Keyword["destroyTakesT"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid destroyTakesT value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.DestroyTakesT = b - } - } - if attr, ok := args.Keyword["checkDestroyNoop"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid checkDestroyNoop value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.CheckDestroyNoop = b - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", - }, - ) - } - } - if attr, ok := args.Keyword["emailAddress"]; ok { - varName := "address" - if len(attr) > 0 { - varName = attr - } - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", - }, - ) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf( - `domain := acctest.RandomDomainName() -%s := acctest.RandomEmailAddress(domain)`, varName), - }) - d.additionalTfVars[varName] = varName - } - if attr, ok := args.Keyword["domainTfVar"]; ok { - varName := "domain" - if len(attr) > 0 { - varName = attr - } - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", - }, - ) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf(`%s := acctest.RandomDomainName()`, varName), - }) - d.additionalTfVars[varName] = varName - } - if attr, ok := args.Keyword["subdomainTfVar"]; ok { - parentName := "domain" - varName := "subdomain" - parts := strings.Split(attr, ";") - if len(parts) > 1 { - if len(parts[0]) > 0 { - parentName = parts[0] - } - if len(parts[1]) > 0 { - varName = parts[1] - } - } - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", - }, - ) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf(`%s := acctest.RandomDomain()`, parentName), - }) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf(`%s := %s.RandomSubdomain()`, varName, parentName), - }) - d.additionalTfVars[parentName] = fmt.Sprintf("%s.String()", parentName) - d.additionalTfVars[varName] = fmt.Sprintf("%s.String()", varName) - } - if attr, ok := args.Keyword["hasExistsFunction"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid existsFunction value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.HasExistsFunc = b - } - } - if attr, ok := args.Keyword["existsType"]; ok { - if typeName, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.ExistsTypeName = typeName - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - } - } - if attr, ok := args.Keyword["existsTakesT"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid existsTakesT value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.ExistsTakesT = b - } + if err := tests.ParseTestingAnnotations(args, &d.CommonArgs); err != nil { + v.errs = append(v.errs, fmt.Errorf("%s: %w", fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + continue } - if attr, ok := args.Keyword["generator"]; ok { - if attr == "false" { - generatorSeen = true - } else if funcName, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.Generator = funcName - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - generatorSeen = true - } + + // This needs better handling + if _, ok := args.Keyword["generator"]; ok { + generatorSeen = true } + if attr, ok := args.Keyword["idAttrDuplicates"]; ok { d.idAttrDuplicates = attr d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-plugin-testing/config", }, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-plugin-testing/tfjsonpath", }, ) } - if attr, ok := args.Keyword["importIgnore"]; ok { - d.ImportIgnore = strings.Split(attr, ";") - for i, val := range d.ImportIgnore { - d.ImportIgnore[i] = namesgen.ConstOrQuote(val) - } - d.plannableImportAction = importActionUpdate - } - if attr, ok := args.Keyword["importStateId"]; ok { - d.ImportStateID = attr - } - if attr, ok := args.Keyword["importStateIdAttribute"]; ok { - d.importStateIDAttribute = attr - } - if attr, ok := args.Keyword["importStateIdFunc"]; ok { - d.ImportStateIDFunc = attr - } - if attr, ok := args.Keyword["name"]; ok { - d.Name = strings.ReplaceAll(attr, " ", "") - } - if attr, ok := args.Keyword["noImport"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid noImport value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.NoImport = b - } - } - if attr, ok := args.Keyword["plannableImportAction"]; ok { - switch attr { - case importActionNoop.String(): - d.plannableImportAction = importActionNoop - - case importActionUpdate.String(): - d.plannableImportAction = importActionUpdate - - case importActionReplace.String(): - d.plannableImportAction = importActionReplace - default: - v.errs = append(v.errs, fmt.Errorf("invalid plannableImportAction value: %q at %s. Must be one of %s.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), []string{importActionNoop.String(), importActionUpdate.String(), importActionReplace.String()})) - continue - } - } - if attr, ok := args.Keyword["preCheck"]; ok { - if code, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.PreChecks = append(d.PreChecks, codeBlock{ - Code: fmt.Sprintf("%s(ctx, t)", code), - }) - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - } - } - if attr, ok := args.Keyword["preCheckRegion"]; ok { - regions := strings.Split(attr, ";") - d.PreCheckRegions = tfslices.ApplyToAll(regions, func(s string) string { - return endpointsConstOrQuote(s) - }) - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/aws-sdk-go-base/v2/endpoints", - }, - ) - } - if attr, ok := args.Keyword["preCheckWithRegion"]; ok { - if code, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.PreChecksWithRegion = append(d.PreChecks, codeBlock{ - Code: code, - }) - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - } - } - if attr, ok := args.Keyword["useAlternateAccount"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid useAlternateAccount value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else if b { - d.UseAlternateAccount = true - d.PreChecks = append(d.PreChecks, codeBlock{ - Code: "acctest.PreCheckAlternateAccount(t)", - }) - } - } - if attr, ok := args.Keyword["serialize"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serialize value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.Serialize = b - } - } - if attr, ok := args.Keyword["serializeParallelTests"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serializeParallelTests value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.SerializeParallelTests = b - } - } - if attr, ok := args.Keyword["serializeDelay"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serializeDelay value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.SerializeDelay = b - } - } if attr, ok := args.Keyword["identityTest"]; ok { switch attr { case "true": @@ -1055,25 +749,31 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { } } if attr, ok := args.Keyword["identityRegionOverrideTest"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid identityRegionOverrideTest value: %q at %s. Should be duration value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("identityRegionOverrideTest", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.HasRegionOverrideTest = b } } if attr, ok := args.Keyword["v60NullValuesError"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid v60NullValuesError value (%s): %s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + if b, err := tests.ParseBoolAttr("v60NullValuesError", attr); err != nil { + v.errs = append(v.errs, err) } else { d.HasV6_0NullValuesError = b + if b { + d.PreIdentityVersion = v5_100_0 + } } } if attr, ok := args.Keyword["v60RefreshError"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid v60RefreshError value (%s): %s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + if b, err := tests.ParseBoolAttr("v60RefreshError", attr); err != nil { + v.errs = append(v.errs, err) } else { d.HasV6_0RefreshError = b + if b { + d.PreIdentityVersion = v5_100_0 + } } } if attr, ok := args.Keyword["preIdentityVersion"]; ok { @@ -1084,9 +784,16 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { } d.PreIdentityVersion = version } + if attr, ok := args.Keyword["hasNoPreExistingResource"]; ok { + if b, err := tests.ParseBoolAttr("hasNoPreExistingResource", attr); err != nil { + v.errs = append(v.errs, err) + } else { + d.HasNoPreExistingResource = b + } + } if attr, ok := args.Keyword["tlsKey"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid tlsKey value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("tlsKey", attr); err != nil { + v.errs = append(v.errs, err) continue } else { tlsKey = b @@ -1095,10 +802,6 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if attr, ok := args.Keyword["tlsKeyDomain"]; ok { tlsKeyCN = attr } - - if attr, ok := args.Keyword["requireEnvVar"]; ok { - d.RequiredEnvVars = append(d.RequiredEnvVars, attr) - } } } } @@ -1107,17 +810,23 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if len(tlsKeyCN) == 0 { tlsKeyCN = "acctest.RandomDomain().String()" d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", }, ) } - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ + d.InitCodeBlocks = append(d.InitCodeBlocks, tests.CodeBlock{ Code: fmt.Sprintf(`privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, %s)`, tlsKeyCN), }) - d.additionalTfVars["certificate_pem"] = "certificatePEM" - d.additionalTfVars["private_key_pem"] = "privateKeyPEM" + d.AdditionalTfVars_["certificate_pem"] = tests.TFVar{ + GoVarName: "certificatePEM", + Type: tests.TFVarTypeString, + } + d.AdditionalTfVars_["private_key_pem"] = tests.TFVar{ + GoVarName: "privateKeyPEM", + Type: tests.TFVarTypeString, + } } if d.IsRegionalSingleton() { @@ -1136,10 +845,10 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if !skip { if d.idAttrDuplicates != "" { d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-plugin-testing/config", }, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-plugin-testing/tfjsonpath", }, ) @@ -1148,14 +857,18 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { v.errs = append(v.errs, fmt.Errorf("no name parameter set: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) return } + if !d.HasNoPreExistingResource && d.PreIdentityVersion == nil { + v.errs = append(v.errs, fmt.Errorf("preIdentityVersion is required when hasNoPreExistingResource is false: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + return + } if !generatorSeen { d.Generator = "sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)" d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-plugin-testing/helper/acctest", Alias: "sdkacctest", }, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", }, ) @@ -1206,67 +919,3 @@ func generateTestConfig(g *common.Generator, dirPath, test string, tfTemplates * g.Fatalf("generating file (%s): %s", mainPath, err) } } - -func parseIdentifierSpec(s string) (string, *goImport, error) { - parts := strings.Split(s, ";") - switch len(parts) { - case 1: - return parts[0], nil, nil - - case 2: - return parts[1], &goImport{ - Path: parts[0], - }, nil - - case 3: - return parts[2], &goImport{ - Path: parts[0], - Alias: parts[1], - }, nil - - default: - return "", nil, fmt.Errorf("invalid generator value: %q", s) - } -} - -func generateDurationStatement(d time.Duration) string { - var buf strings.Builder - - d = d.Round(1 * time.Second) - - if d >= time.Minute { - mins := d / time.Minute - fmt.Fprintf(&buf, "%d*time.Minute", mins) - d = d - mins*time.Minute - if d != 0 { - fmt.Fprint(&buf, "+") - } - } - if d != 0 { - secs := d / time.Second - fmt.Fprintf(&buf, "%d*time.Second", secs) - } - - return buf.String() -} - -func count[T any](s iter.Seq[T], f func(T) bool) (c int) { - for v := range s { - if f(v) { - c++ - } - } - return c -} - -func endpointsConstOrQuote(region string) string { - var buf strings.Builder - buf.WriteString("endpoints.") - - for _, part := range strings.Split(region, "-") { - buf.WriteString(strings.Title(part)) - } - buf.WriteString("RegionID") - - return buf.String() -} diff --git a/internal/generate/identitytests/resource_test.go.gtpl b/internal/generate/identitytests/resource_test.go.gtpl index eafbbfc8778e..fb83b34f113f 100644 --- a/internal/generate/identitytests/resource_test.go.gtpl +++ b/internal/generate/identitytests/resource_test.go.gtpl @@ -1,13 +1,5 @@ // Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. -{{ define "Init" }} - ctx := acctest.Context(t) - {{ if .ExistsTypeName }} - var v {{ .ExistsTypeName }} - {{ end -}} - {{ template "commonInit" . }} -{{ end }} - {{/* This can be removed when the Exists check supports enhanced region support */}} {{ define "InitRegionOverride" }} ctx := acctest.Context(t) @@ -15,48 +7,11 @@ {{ template "commonInit" . }} {{ end }} -{{ define "commonInit" -}} -{{ range .RequiredEnvVars -}} - acctest.SkipIfEnvVarNotSet(t, "{{ . }}") -{{ end -}} - resourceName := "{{ .TypeName}}.test"{{ if .Generator }} - rName := {{ .Generator }} -{{- end }} -{{- range .InitCodeBlocks }} -{{ .Code }} -{{- end -}} -{{ if .UseAlternateAccount }} - providers := make(map[string]*schema.Provider) -{{ end }} -{{ end }} - -{{ define "Test" -}} -resource.{{ if and .Serialize (not .SerializeParallelTests) }}Test{{ else }}ParallelTest{{ end }} -{{- end }} - -{{ define "TestCaseSetup" -}} -{{ template "TestCaseSetupNoProviders" . }} -{{- if not .UseAlternateAccount }} - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, -{{- end -}} -{{- end }} - {{ define "TestCaseSetupNoProviders" -}} TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, - PreCheck: func() { acctest.PreCheck(ctx, t) - {{- if gt (len .PreCheckRegions) 0 }} - acctest.PreCheckRegion(t, {{ range .PreCheckRegions}}{{ . }}, {{ end }}) - {{- end -}} - {{- range .PreChecks }} - {{ .Code }} - {{- end -}} - {{- range .PreChecksWithRegion }} - {{ .Code }}(ctx, t, acctest.Region()) - {{- end -}} - }, - ErrorCheck: acctest.ErrorCheck(t, names.{{ .PackageProviderNameUpper }}ServiceID), + {{ template "CommonTestCaseChecks" . }} CheckDestroy: {{ if .CheckDestroyNoop }}acctest.CheckDestroyNoop{{ else }}testAccCheck{{ .Name }}Destroy(ctx{{ if .DestroyTakesT }}, t{{ end }}){{ end }}, {{- end }} @@ -64,8 +19,8 @@ resource.{{ if and .Serialize (not .SerializeParallelTests) }}Test{{ else }}Para TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, -PreCheck: func() { acctest.PreCheck(ctx, t) - {{- if gt (len .PreCheckRegions) 0 }} +PreCheck: func() { acctest.PreCheck(ctx, t) + {{- if .PreCheckRegions }} acctest.PreCheckAlternateRegion(t, {{ range .PreCheckRegions}}{{ . }}, {{ end }}) {{- end -}} {{- range .PreChecks }} @@ -242,31 +197,11 @@ ImportPlanChecks: resource.ImportPlanChecks{ }, {{- end }} -{{ define "testname" -}} -{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ResourceProviderNameUpper }}{{ .Name }} -{{- end }} - -{{ define "ExistsCheck" }} - testAccCheck{{ .Name }}Exists(ctx, {{ if .ExistsTakesT }}t,{{ end }} resourceName{{ if .ExistsTypeName}}, &v{{ end }}), -{{ end }} - -{{ define "AdditionalTfVars" -}} - {{ range $name, $value := .AdditionalTfVars -}} - {{ $name }}: config.StringVariable({{ $value }}), - {{ end -}} -{{ end }} - package {{ .ProviderPackage }}_test import ( - {{ if .OverrideIdentifier }} - "context" - {{- end }} "testing" - {{ if .UseAlternateAccount }} - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - {{- end }} "github.com/hashicorp/terraform-plugin-testing/compare" "github.com/hashicorp/terraform-plugin-testing/config" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -279,10 +214,6 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/names" - {{- if .OverrideIdentifier }} - tf{{ .ProviderPackage }} "github.com/hashicorp/terraform-provider-aws/internal/service/{{ .ProviderPackage }}" - "github.com/hashicorp/terraform-provider-aws/internal/types" - {{- end }} {{ range .GoImports -}} {{ if .Alias }}{{ .Alias }} {{ end }}"{{ .Path }}" {{ end }} @@ -310,7 +241,7 @@ func {{ template "testname" . }}_IdentitySerial(t *testing.T) { func {{ template "testname" . }}_Identity_Basic(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -439,7 +370,7 @@ func {{ template "testname" . }}_Identity_Basic(t *testing.T) { func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { {{- template "InitRegionOverride" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupRegionOverride" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -602,7 +533,7 @@ func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { func {{ template "testname" . }}_Identity_ExistingResource_fromV5(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -687,7 +618,7 @@ func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { func {{ template "testname" . }}_Identity_ExistingResource_fromV6(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -804,7 +735,7 @@ func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { func {{ template "testname" . }}_Identity_ExistingResource(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -931,13 +862,13 @@ func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { }, }) } -{{ else }} +{{ else if .PreIdentityVersion }} {{ if .PreIdentityVersion.GreaterThanOrEqual (NewVersion "6.0.0") }} // Resource Identity was added after v{{ .PreIdentityVersion }} func {{ template "testname" . }}_Identity_ExistingResource(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} @@ -1024,7 +955,7 @@ func {{ template "testname" . }}_Identity_RegionOverride(t *testing.T) { func {{ template "testname" . }}_Identity_ExistingResource(t *testing.T) { {{- template "Init" . }} - {{ template "Test" . }}(t, resource.TestCase{ + {{ template "Test" . }}(ctx, t, resource.TestCase{ {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ {{ $step := 1 -}} diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 301c7f3fb362..193985889d91 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -831,7 +831,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/generate/servicepackage/endpoint_resolver.go.gtpl b/internal/generate/servicepackage/endpoint_resolver.go.gtpl index d4fbc9a19672..838d99aedccd 100644 --- a/internal/generate/servicepackage/endpoint_resolver.go.gtpl +++ b/internal/generate/servicepackage/endpoint_resolver.go.gtpl @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params {{ .GoV2Package }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up {{ .GoV2Package }} endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up {{ .GoV2Package }} endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/generate/tagstests/data_source_test.go.gtpl b/internal/generate/tagstests/data_source_test.go.gtpl index 2c899c996cb1..7474cab3e787 100644 --- a/internal/generate/tagstests/data_source_test.go.gtpl +++ b/internal/generate/tagstests/data_source_test.go.gtpl @@ -1,33 +1,7 @@ // Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. -{{ define "Init" }} - ctx := acctest.Context(t) - dataSourceName := "data.{{ .TypeName}}.test"{{ if .Generator }} - rName := {{ .Generator }} -{{- end }} -{{ range .InitCodeBlocks -}} -{{ .Code }} -{{- end }} -{{ end }} - -{{ define "Test" -}} -acctest.{{ if and .Serialize (not .SerializeParallelTests) }}Test{{ else }}ParallelTest{{ end }} -{{- end }} - -{{ define "TestCaseSetup" -}} -{{ template "TestCaseSetupNoProviders" . -}} -{{ if not .AlternateRegionProvider }} - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, -{{- end -}} -{{- end }} - {{ define "TestCaseSetupNoProviders" -}} - PreCheck: func() { acctest.PreCheck(ctx, t) - {{- range .PreChecks }} - {{ .Code }} - {{ end -}} - }, - ErrorCheck: acctest.ErrorCheck(t, names.{{ .PackageProviderNameUpper }}ServiceID), + {{ template "CommonTestCaseChecks" . -}} {{- end }} {{ define "TagsKnownValueForNull" -}} @@ -50,44 +24,6 @@ plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), know {{- end }} {{- end }} -{{ define "ImportBody" }} - ResourceName: resourceName, - ImportState: true, -{{ if gt (len .ImportStateID) 0 -}} - ImportStateId: {{ .ImportStateID }}, -{{ end -}} -{{ if gt (len .ImportStateIDFunc) 0 -}} - ImportStateIdFunc: {{ .ImportStateIDFunc }}(resourceName), -{{ end -}} - ImportStateVerify: true, -{{ if gt (len .ImportIgnore) 0 -}} - ImportStateVerifyIgnore: []string{ - {{ range $i, $v := .ImportIgnore }}{{ $v }},{{ end }} - }, -{{- end }} -{{ end }} - -{{ define "testname" -}} -{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ResourceProviderNameUpper }}{{ .Name }}DataSource -{{- end }} - -{{ define "ExistsCheck" }} - testAccCheck{{ .Name }}Exists(ctx, {{ if .ExistsTakesT }}t,{{ end }} resourceName{{ if .ExistsTypeName}}, &v{{ end }}), -{{ end }} - -{{ define "AdditionalTfVars" -}} - {{ range $name, $value := .AdditionalTfVars -}} - {{ if eq $value.Type "string" -}} - {{ $name }}: config.StringVariable({{ $value.GoVarName }}), - {{- else if eq $value.Type "int" -}} - {{ $name }}: config.IntegerVariable({{ $value.GoVarName }}), - {{- end }} - {{ end -}} - {{ if .AlternateRegionProvider -}} - "alt_region": config.StringVariable(acctest.AlternateRegion()), - {{ end }} -{{ end }} - package {{ .ProviderPackage }}_test import ( diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index bad768b0ed81..e41ffefd55a5 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -19,17 +19,13 @@ import ( "path/filepath" "regexp" "slices" - "strconv" "strings" "text/template" - "time" "github.com/dlclark/regexp2" - acctestgen "github.com/hashicorp/terraform-provider-aws/internal/acctest/generate" "github.com/hashicorp/terraform-provider-aws/internal/generate/common" "github.com/hashicorp/terraform-provider-aws/internal/generate/tests" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" - tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/names/data" namesgen "github.com/hashicorp/terraform-provider-aws/names/generate" ) @@ -108,24 +104,31 @@ func main() { } for _, resource := range v.taggedResources { + resource.service = &svc + sourceName := resource.FileName ext := filepath.Ext(sourceName) sourceName = strings.TrimSuffix(sourceName, ext) sourceName = strings.TrimSuffix(sourceName, "_") - if name, err := svc.ProviderNameUpper(resource.TypeName); err != nil { - g.Fatalf("determining provider service name: %s", err) - } else { - resource.ResourceProviderNameUpper = name - } - resource.PackageProviderNameUpper = svc.PackageProviderNameUpper() - resource.ProviderPackage = servicePackage - if !resource.IsDataSource { filename := fmt.Sprintf("%s_tags_gen_test.go", sourceName) d := g.NewGoFileDestination(filename) - templates, err := template.New("taggingtests").Parse(resourceTestGoTmpl) + + templateFuncMap := template.FuncMap{ + "inc": func(i int) int { + return i + 1 + }, + } + templates := template.New("taggingtests").Funcs(templateFuncMap) + + templates, err = tests.AddCommonResourceTestTemplates(templates) + if err != nil { + g.Fatalf(err.Error()) + } + + templates, err = templates.Parse(resourceTestGoTmpl) if err != nil { g.Fatalf("parsing base Go test template: %w", err) } @@ -141,7 +144,15 @@ func main() { filename := fmt.Sprintf("%s_tags_gen_test.go", sourceName) d := g.NewGoFileDestination(filename) - templates, err := template.New("taggingtests").Parse(dataSourceTestGoTmpl) + + templates := template.New("taggingtests") + + templates, err = tests.AddCommonDataSourceTestTemplates(templates) + if err != nil { + g.Fatalf(err.Error()) + } + + templates, err = templates.Parse(dataSourceTestGoTmpl) if err != nil { g.Fatalf("parsing base Go test template: %w", err) } @@ -173,7 +184,7 @@ func main() { } if resource.GenerateConfig { - additionalTfVars := tfmaps.Keys(resource.additionalTfVars) + additionalTfVars := tfmaps.Keys(resource.AdditionalTfVars_) slices.Sort(additionalTfVars) testDirPath := path.Join("testdata", resource.Name) @@ -182,7 +193,7 @@ func main() { g.Fatalf("parsing base Terraform config template: %s", err) } - tfTemplates, err = tests.AddCommonTemplates(tfTemplates) + tfTemplates, err = tests.AddCommonTfTemplates(tfTemplates) if err != nil { g.Fatalf(err.Error()) } @@ -238,7 +249,7 @@ func main() { g.Fatalf("opening data source config template %q: %w", dataSourceConfigTmplFile, err) } - additionalTfVars := tfmaps.Keys(resource.additionalTfVars) + additionalTfVars := tfmaps.Keys(resource.AdditionalTfVars_) slices.Sort(additionalTfVars) testDirPath := path.Join("testdata", resource.Name) @@ -247,7 +258,7 @@ func main() { g.Fatalf("parsing base Terraform config template: %s", err) } - tfTemplates, err = tests.AddCommonTemplates(tfTemplates) + tfTemplates, err = tests.AddCommonTfTemplates(tfTemplates) if err != nil { g.Fatalf(err.Error()) } @@ -317,6 +328,10 @@ type serviceRecords struct { additional []data.ServiceRecord } +func (sr serviceRecords) ProviderPackage() string { + return sr.primary.ProviderPackage() +} + func (sr serviceRecords) ProviderNameUpper(typeName string) (string, error) { if len(sr.additional) == 0 { return sr.primary.ProviderNameUpper(), nil @@ -374,64 +389,32 @@ func (sr serviceRecords) PackageProviderNameUpper() string { return sr.primary.ProviderNameUpper() } -type implementation string - -const ( - implementationFramework implementation = "framework" - implementationSDK implementation = "sdk" -) - type ResourceDatum struct { - ProviderPackage string - ResourceProviderNameUpper string - PackageProviderNameUpper string - Name string - TypeName string - DestroyTakesT bool - ExistsTypeName string - ExistsTakesT bool + service *serviceRecords FileName string - Generator string - NoImport bool - ImportStateID string - importStateIDAttribute string - ImportStateIDFunc string - ImportIgnore []string - Implementation implementation - Serialize bool - SerializeDelay bool - SerializeParallelTests bool - PreChecks []codeBlock SkipEmptyTags bool // TODO: Remove when we have a strategy for resources that have a minimum tag value length of 1 SkipNullTags bool NoRemoveTags bool - GoImports []goImport GenerateConfig bool - InitCodeBlocks []codeBlock - additionalTfVars map[string]tfVar - AlternateRegionProvider bool TagsUpdateForceNew bool TagsUpdateGetTagsIn bool // TODO: Works around a bug when getTagsIn() is used to pass tags directly to Update call - CheckDestroyNoop bool IsDataSource bool - DataSourceResourceImplementation implementation + DataSourceResourceImplementation tests.Implementation overrideIdentifierAttribute string OverrideResourceType string - UseAlternateAccount bool + tests.CommonArgs } -func (d ResourceDatum) AdditionalTfVars() map[string]tfVar { - return tfmaps.ApplyToAllKeys(d.additionalTfVars, func(k string) string { - return acctestgen.ConstOrQuote(k) - }) +func (d ResourceDatum) ProviderPackage() string { + return d.service.ProviderPackage() } -func (d ResourceDatum) HasImportStateIDAttribute() bool { - return d.importStateIDAttribute != "" +func (d ResourceDatum) ResourceProviderNameUpper() (string, error) { + return d.service.ProviderNameUpper(d.TypeName) } -func (d ResourceDatum) ImportStateIDAttribute() string { - return namesgen.ConstOrQuote(d.importStateIDAttribute) +func (d ResourceDatum) PackageProviderNameUpper() string { + return d.service.PackageProviderNameUpper() } func (d ResourceDatum) OverrideIdentifier() bool { @@ -442,27 +425,6 @@ func (d ResourceDatum) OverrideIdentifierAttribute() string { return namesgen.ConstOrQuote(d.overrideIdentifierAttribute) } -type goImport struct { - Path string - Alias string -} - -type codeBlock struct { - Code string -} - -type tfVar struct { - GoVarName string - Type tfVarType -} - -type tfVarType string - -const ( - tfVarTypeString tfVarType = "string" - tfVarTypeInt tfVarType = "int" -) - type commonConfig struct { AdditionalTfVars []string WithRName bool @@ -549,8 +511,8 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { // Look first for tagging annotations. d := ResourceDatum{ - FileName: v.fileName, - additionalTfVars: make(map[string]tfVar), + FileName: v.fileName, + CommonArgs: tests.InitCommonArgs(), } tagged := false skip := false @@ -569,7 +531,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { fallthrough case "FrameworkResource": - d.Implementation = implementationFramework + d.Implementation = tests.ImplementationFramework args := common.ParseArgs(m[3]) if len(args.Positional) == 0 { v.errs = append(v.errs, fmt.Errorf("no type name: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) @@ -587,7 +549,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { fallthrough case "SDKResource": - d.Implementation = implementationSDK + d.Implementation = tests.ImplementationSDK args := common.ParseArgs(m[3]) if len(args.Positional) == 0 { v.errs = append(v.errs, fmt.Errorf("no type name: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) @@ -619,199 +581,17 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { case "Testing": args := common.ParseArgs(m[3]) - if attr, ok := args.Keyword["altRegionProvider"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid altRegionProvider value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.AlternateRegionProvider = b - } - } - if attr, ok := args.Keyword["destroyTakesT"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid destroyTakesT value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.DestroyTakesT = b - } - } - if attr, ok := args.Keyword["checkDestroyNoop"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid checkDestroyNoop value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.CheckDestroyNoop = b - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", - }, - ) - } - } - if attr, ok := args.Keyword["randomBgpAsn"]; ok { - parts := strings.Split(attr, ";") - varName := "rBgpAsn" - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-plugin-testing/helper/acctest", - Alias: "sdkacctest", - }, - ) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf("%s := sdkacctest.RandIntRange(%s,%s)", varName, parts[0], parts[1]), - }) - d.additionalTfVars[varName] = tfVar{ - GoVarName: varName, - Type: tfVarTypeInt, - } - } - if attr, ok := args.Keyword["randomIPv4Address"]; ok { - varName := "rIPv4Address" - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-plugin-testing/helper/acctest", - Alias: "sdkacctest", - }, - ) - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ - Code: fmt.Sprintf(`%s, err := sdkacctest.RandIpAddress("%s") -if err != nil { - t.Fatal(err) -} -`, varName, attr), - }) - d.additionalTfVars[varName] = tfVar{ - GoVarName: varName, - Type: tfVarTypeString, - } - } - if attr, ok := args.Keyword["existsType"]; ok { - if typeName, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.ExistsTypeName = typeName - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - } - } - if attr, ok := args.Keyword["existsTakesT"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid existsTakesT value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.ExistsTakesT = b - } - } - if attr, ok := args.Keyword["generator"]; ok { - if attr == "false" { - generatorSeen = true - } else if funcName, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.Generator = funcName - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - generatorSeen = true - } + if err := tests.ParseTestingAnnotations(args, &d.CommonArgs); err != nil { + v.errs = append(v.errs, fmt.Errorf("%s: %w", fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + continue } - if attr, ok := args.Keyword["importIgnore"]; ok { - d.ImportIgnore = strings.Split(attr, ";") - for i, val := range d.ImportIgnore { - d.ImportIgnore[i] = namesgen.ConstOrQuote(val) - } - } - if attr, ok := args.Keyword["importStateId"]; ok { - d.ImportStateID = attr - } - if attr, ok := args.Keyword["importStateIdAttribute"]; ok { - d.importStateIDAttribute = attr - } - if attr, ok := args.Keyword["importStateIdFunc"]; ok { - d.ImportStateIDFunc = attr - } - if attr, ok := args.Keyword["name"]; ok { - d.Name = strings.ReplaceAll(attr, " ", "") - } - if attr, ok := args.Keyword["noImport"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid noImport value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.NoImport = b - } - } - if attr, ok := args.Keyword["preCheck"]; ok { - if code, importSpec, err := parseIdentifierSpec(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) - continue - } else { - d.PreChecks = append(d.PreChecks, codeBlock{ - Code: fmt.Sprintf("%s(ctx, t)", code), - }) - if importSpec != nil { - d.GoImports = append(d.GoImports, *importSpec) - } - } - } - if attr, ok := args.Keyword["preCheckRegion"]; ok { - regions := strings.Split(attr, ";") - d.PreChecks = append(d.PreChecks, codeBlock{ - Code: fmt.Sprintf("acctest.PreCheckRegion(t, %s)", strings.Join(tfslices.ApplyToAll(regions, func(s string) string { - return endpointsConstOrQuote(s) - }), ", ")), - }) - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/aws-sdk-go-base/v2/endpoints", - }, - ) - } - if attr, ok := args.Keyword["useAlternateAccount"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid useAlternateAccount value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else if b { - d.UseAlternateAccount = true - d.PreChecks = append(d.PreChecks, codeBlock{ - Code: "acctest.PreCheckAlternateAccount(t)", - }) - d.GoImports = append(d.GoImports, - goImport{ - Path: "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema", - }, - ) - } - } - if attr, ok := args.Keyword["serialize"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serialize value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.Serialize = b - } - } - if attr, ok := args.Keyword["serializeParallelTests"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serializeParallelTests value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.SerializeParallelTests = b - } - } - if attr, ok := args.Keyword["serializeDelay"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid serializeDelay value: %q at %s. Should be duration value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else { - d.SerializeDelay = b - } + // This needs better handling + if _, ok := args.Keyword["generator"]; ok { + generatorSeen = true } + if attr, ok := args.Keyword["tagsIdentifierAttribute"]; ok { d.overrideIdentifierAttribute = attr } @@ -835,48 +615,48 @@ if err != nil { } // TODO: should probably be a parameter on @Tags if attr, ok := args.Keyword["tagsUpdateForceNew"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid tagsUpdateForceNew value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("tagsUpdateForceNew", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.TagsUpdateForceNew = b } } if attr, ok := args.Keyword["tagsUpdateGetTagsIn"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid tagsUpdateGetTagsIn value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("tagsUpdateGetTagsIn", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.TagsUpdateGetTagsIn = b } } if attr, ok := args.Keyword["skipEmptyTags"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid skipEmptyTags value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("skipEmptyTags", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.SkipEmptyTags = b } } if attr, ok := args.Keyword["skipNullTags"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid skipNullTags value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("skipNullTags", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.SkipNullTags = b } } if attr, ok := args.Keyword["noRemoveTags"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid noRemoveTags value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("noRemoveTags", attr); err != nil { + v.errs = append(v.errs, err) continue } else { d.NoRemoveTags = b } } if attr, ok := args.Keyword["tlsKey"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid tlsKey value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if b, err := tests.ParseBoolAttr("tlsKey", attr); err != nil { + v.errs = append(v.errs, err) continue } else { tlsKey = b @@ -893,22 +673,22 @@ if err != nil { if len(tlsKeyCN) == 0 { tlsKeyCN = "acctest.RandomDomain().String()" d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", }, ) } - d.InitCodeBlocks = append(d.InitCodeBlocks, codeBlock{ + d.InitCodeBlocks = append(d.InitCodeBlocks, tests.CodeBlock{ Code: fmt.Sprintf(`privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, %s)`, tlsKeyCN), }) - d.additionalTfVars["certificate_pem"] = tfVar{ + d.AdditionalTfVars_["certificate_pem"] = tests.TFVar{ GoVarName: "certificatePEM", - Type: tfVarTypeString, + Type: tests.TFVarTypeString, } - d.additionalTfVars["private_key_pem"] = tfVar{ + d.AdditionalTfVars_["private_key_pem"] = tests.TFVar{ GoVarName: "privateKeyPEM", - Type: tfVarTypeString, + Type: tests.TFVarTypeString, } } @@ -925,7 +705,7 @@ if err != nil { if !generatorSeen { d.Generator = "acctest.RandomWithPrefix(t, acctest.ResourcePrefix)" d.GoImports = append(d.GoImports, - goImport{ + tests.GoImport{ Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", }, ) @@ -975,49 +755,6 @@ func generateTestConfig(g *common.Generator, dirPath, test string, withDefaults } } -func parseIdentifierSpec(s string) (string, *goImport, error) { - parts := strings.Split(s, ";") - switch len(parts) { - case 1: - return parts[0], nil, nil - - case 2: - return parts[1], &goImport{ - Path: parts[0], - }, nil - - case 3: - return parts[2], &goImport{ - Path: parts[0], - Alias: parts[1], - }, nil - - default: - return "", nil, fmt.Errorf("invalid generator value: %q", s) - } -} - -func generateDurationStatement(d time.Duration) string { - var buf strings.Builder - - d = d.Round(1 * time.Second) - - if d >= time.Minute { - mins := d / time.Minute - fmt.Fprintf(&buf, "%d*time.Minute", mins) - d = d - mins*time.Minute - if d != 0 { - fmt.Fprint(&buf, "+") - } - } - if d != 0 { - secs := d / time.Second - fmt.Fprintf(&buf, "%d*time.Second", secs) - } - - return buf.String() -} - func count[T any](s iter.Seq[T], f func(T) bool) (c int) { for v := range s { if f(v) { @@ -1026,15 +763,3 @@ func count[T any](s iter.Seq[T], f func(T) bool) (c int) { } return c } - -func endpointsConstOrQuote(region string) string { - var buf strings.Builder - buf.WriteString("endpoints.") - - for _, part := range strings.Split(region, "-") { - buf.WriteString(strings.Title(part)) - } - buf.WriteString("RegionID") - - return buf.String() -} diff --git a/internal/generate/tagstests/resource_test.go.gtpl b/internal/generate/tagstests/resource_test.go.gtpl index 85ed7b5d8d70..e81e991736dc 100644 --- a/internal/generate/tagstests/resource_test.go.gtpl +++ b/internal/generate/tagstests/resource_test.go.gtpl @@ -1,39 +1,7 @@ // Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. -{{ define "Init" }} - ctx := acctest.Context(t) - {{ if .ExistsTypeName -}} - var v {{ .ExistsTypeName }} - {{ end -}} - resourceName := "{{ .TypeName}}.test"{{ if .Generator }} - rName := {{ .Generator }} -{{- end }} -{{- range .InitCodeBlocks }} - {{ .Code }} -{{- end }} -{{- if .UseAlternateAccount }} - providers := make(map[string]*schema.Provider) -{{ end }} -{{ end }} - -{{ define "Test" -}} -acctest.{{ if and .Serialize (not .SerializeParallelTests) }}Test{{ else }}ParallelTest{{ end }} -{{- end }} - -{{ define "TestCaseSetup" -}} -{{ template "TestCaseSetupNoProviders" . -}} -{{ if and (not .AlternateRegionProvider) (not .UseAlternateAccount) }} - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, -{{- end -}} -{{- end }} - {{ define "TestCaseSetupNoProviders" -}} - PreCheck: func() { acctest.PreCheck(ctx, t) - {{- range .PreChecks }} - {{ .Code }} - {{- end -}} - }, - ErrorCheck: acctest.ErrorCheck(t, names.{{ .PackageProviderNameUpper }}ServiceID), + {{ template "CommonTestCaseChecks" . }} CheckDestroy: {{ if .CheckDestroyNoop }}acctest.CheckDestroyNoop{{ else }}testAccCheck{{ .Name }}Destroy(ctx{{ if .DestroyTakesT }}, t{{ end }}){{ end }}, {{- end }} @@ -115,27 +83,6 @@ plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), know {{- end }} {{ end }} -{{ define "testname" -}} -{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ResourceProviderNameUpper }}{{ .Name }} -{{- end }} - -{{ define "ExistsCheck" }} - testAccCheck{{ .Name }}Exists(ctx, {{ if .ExistsTakesT }}t,{{ end }} resourceName{{ if .ExistsTypeName}}, &v{{ end }}), -{{ end }} - -{{ define "AdditionalTfVars" -}} - {{ range $name, $value := .AdditionalTfVars -}} - {{ if eq $value.Type "string" -}} - {{ $name }}: config.StringVariable({{ $value.GoVarName }}), - {{- else if eq $value.Type "int" -}} - {{ $name }}: config.IntegerVariable({{ $value.GoVarName }}), - {{- end }} - {{ end -}} - {{ if .AlternateRegionProvider -}} - "alt_region": config.StringVariable(acctest.AlternateRegion()), - {{ end }} -{{ end }} - package {{ .ProviderPackage }}_test import ( diff --git a/internal/generate/tests/annotations.go b/internal/generate/tests/annotations.go new file mode 100644 index 000000000000..62e4cb89bbfb --- /dev/null +++ b/internal/generate/tests/annotations.go @@ -0,0 +1,523 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tests + +import ( + "fmt" + "strconv" + "strings" + + acctestgen "github.com/hashicorp/terraform-provider-aws/internal/acctest/generate" + "github.com/hashicorp/terraform-provider-aws/internal/generate/common" + tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" + namesgen "github.com/hashicorp/terraform-provider-aws/names/generate" + "golang.org/x/text/cases" + "golang.org/x/text/language" +) + +type Implementation string + +const ( + ImplementationFramework Implementation = "framework" + ImplementationSDK Implementation = "sdk" +) + +type CommonArgs struct { + Name string // Resource Type Name + TypeName string // Terraform Type Name + Implementation Implementation + + // CheckDestroy + CheckDestroyNoop bool + DestroyTakesT bool + + // CheckExists + HasExistsFunc bool + ExistsTypeName string + ExistsTakesT bool + + // Import + NoImport bool + ImportStateID string + importStateIDAttribute string + ImportStateIDFunc string + ImportIgnore []string + plannableImportAction importAction + + // Serialization + Serialize bool + SerializeDelay bool + SerializeParallelTests bool + + // PreChecks + PreChecks []CodeBlock + PreCheckRegions []string + PreChecksWithRegion []CodeBlock + + UseAlternateAccount bool + AlternateRegionProvider bool + + Generator string + + RequiredEnvVars []string + + GoImports []GoImport + InitCodeBlocks []CodeBlock + AdditionalTfVars_ map[string]TFVar +} + +func InitCommonArgs() CommonArgs { + return CommonArgs{ + AdditionalTfVars_: make(map[string]TFVar), + HasExistsFunc: true, + } +} + +func (c CommonArgs) HasImportStateIDAttribute() bool { + return c.importStateIDAttribute != "" +} + +func (c CommonArgs) ImportStateIDAttribute() string { + return namesgen.ConstOrQuote(c.importStateIDAttribute) +} + +func (c CommonArgs) HasImportIgnore() bool { + return len(c.ImportIgnore) > 0 +} + +func (c CommonArgs) PlannableResourceAction() string { + return c.plannableImportAction.String() +} + +func (c CommonArgs) AdditionalTfVars() map[string]TFVar { + return tfmaps.ApplyToAllKeys(c.AdditionalTfVars_, func(k string) string { + return acctestgen.ConstOrQuote(k) + }) +} + +type importAction int + +const ( + importActionNoop importAction = iota + importActionUpdate + importActionReplace +) + +func (i importAction) String() string { + switch i { + case importActionNoop: + return "NoOp" + + case importActionUpdate: + return "Update" + + case importActionReplace: + return "Replace" + + default: + return "" + } +} + +type GoImport struct { + Path string + Alias string +} + +type CodeBlock struct { + Code string +} + +type TFVar struct { + GoVarName string + Type TFVarType +} + +type TFVarType string + +const ( + TFVarTypeString TFVarType = "string" + TFVarTypeInt TFVarType = "int" +) + +func ParseTestingAnnotations(args common.Args, stuff *CommonArgs) error { + if attr, ok := args.Keyword["name"]; ok { + stuff.Name = strings.ReplaceAll(attr, " ", "") + } + + // DestroyCheck + if attr, ok := args.Keyword["checkDestroyNoop"]; ok { + if b, err := ParseBoolAttr("checkDestroyNoop", attr); err != nil { + return err + } else { + stuff.CheckDestroyNoop = b + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", + }, + ) + } + } + + if attr, ok := args.Keyword["destroyTakesT"]; ok { + if b, err := ParseBoolAttr("destroyTakesT", attr); err != nil { + return err + } else { + stuff.DestroyTakesT = b + } + } + + // ExistsCheck + if attr, ok := args.Keyword["hasExistsFunction"]; ok { + if b, err := ParseBoolAttr("hasExistsFunction", attr); err != nil { + return err + } else { + stuff.HasExistsFunc = b + } + } + + if attr, ok := args.Keyword["existsType"]; ok { + if typeName, importSpec, err := ParseIdentifierSpec(attr); err != nil { + return fmt.Errorf("%s: %w", attr, err) + } else { + stuff.ExistsTypeName = typeName + if importSpec != nil { + stuff.GoImports = append(stuff.GoImports, *importSpec) + } + } + } + + if attr, ok := args.Keyword["existsTakesT"]; ok { + if b, err := ParseBoolAttr("existsTakesT", attr); err != nil { + return err + } else { + stuff.ExistsTakesT = b + } + } + + // Import + if attr, ok := args.Keyword["importIgnore"]; ok { + stuff.ImportIgnore = strings.Split(attr, ";") + for i, val := range stuff.ImportIgnore { + stuff.ImportIgnore[i] = namesgen.ConstOrQuote(val) + } + stuff.plannableImportAction = importActionUpdate + } + + if attr, ok := args.Keyword["importStateId"]; ok { + stuff.ImportStateID = attr + } + + if attr, ok := args.Keyword["importStateIdAttribute"]; ok { + stuff.importStateIDAttribute = attr + } + + if attr, ok := args.Keyword["importStateIdFunc"]; ok { + stuff.ImportStateIDFunc = attr + } + + if attr, ok := args.Keyword["noImport"]; ok { + if b, err := ParseBoolAttr("noImport", attr); err != nil { + return err + } else { + stuff.NoImport = b + } + } + + if attr, ok := args.Keyword["plannableImportAction"]; ok { + switch attr { + case importActionNoop.String(): + stuff.plannableImportAction = importActionNoop + + case importActionUpdate.String(): + stuff.plannableImportAction = importActionUpdate + + case importActionReplace.String(): + stuff.plannableImportAction = importActionReplace + + default: + return fmt.Errorf("invalid plannableImportAction value %q: Must be one of %s.", attr, []string{importActionNoop.String(), importActionUpdate.String(), importActionReplace.String()}) + } + } + + // Serialization + if attr, ok := args.Keyword["serialize"]; ok { + if b, err := ParseBoolAttr("serialize", attr); err != nil { + return err + } else { + stuff.Serialize = b + } + } + + if attr, ok := args.Keyword["serializeParallelTests"]; ok { + if b, err := ParseBoolAttr("serializeParallelTests", attr); err != nil { + return err + } else { + stuff.SerializeParallelTests = b + } + } + + if attr, ok := args.Keyword["serializeDelay"]; ok { + if b, err := ParseBoolAttr("serializeDelay", attr); err != nil { + return err + } else { + stuff.SerializeDelay = b + } + } + + // PreChecks + if attr, ok := args.Keyword["preCheck"]; ok { + if code, importSpec, err := ParseIdentifierSpec(attr); err != nil { + return fmt.Errorf("%s: %w", attr, err) + } else { + stuff.PreChecks = append(stuff.PreChecks, CodeBlock{ + Code: fmt.Sprintf("%s(ctx, t)", code), + }) + if importSpec != nil { + stuff.GoImports = append(stuff.GoImports, *importSpec) + } + } + } + + if attr, ok := args.Keyword["preCheckRegion"]; ok { + regions := strings.Split(attr, ";") + stuff.PreCheckRegions = tfslices.ApplyToAll(regions, func(s string) string { + return endpointsConstOrQuote(s) + }) + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/aws-sdk-go-base/v2/endpoints", + }, + ) + } + + if attr, ok := args.Keyword["preCheckWithRegion"]; ok { + if code, importSpec, err := ParseIdentifierSpec(attr); err != nil { + return fmt.Errorf("%s: %w", attr, err) + } else { + stuff.PreChecksWithRegion = append(stuff.PreChecksWithRegion, CodeBlock{ + Code: code, + }) + if importSpec != nil { + stuff.GoImports = append(stuff.GoImports, *importSpec) + } + } + } + + if attr, ok := args.Keyword["requireEnvVar"]; ok { + stuff.RequiredEnvVars = append(stuff.RequiredEnvVars, attr) + } + + if attr, ok := args.Keyword["useAlternateAccount"]; ok { + if b, err := ParseBoolAttr("useAlternateAccount", attr); err != nil { + return err + } else if b { + stuff.UseAlternateAccount = true + stuff.PreChecks = append(stuff.PreChecks, CodeBlock{ + Code: "acctest.PreCheckAlternateAccount(t)", + }) + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema", + }, + ) + } + } + + if attr, ok := args.Keyword["altRegionProvider"]; ok { + if b, err := ParseBoolAttr("altRegionProvider", attr); err != nil { + return err + } else { + stuff.AlternateRegionProvider = b + } + } + + // TF Variables + if attr, ok := args.Keyword["generator"]; ok { + if attr != "false" { + if funcName, importSpec, err := ParseIdentifierSpec(attr); err != nil { + return fmt.Errorf("%s: %w", attr, err) + } else { + stuff.Generator = funcName + if importSpec != nil { + stuff.GoImports = append(stuff.GoImports, *importSpec) + } + } + } + } + + if attr, ok := args.Keyword["emailAddress"]; ok { + varName := "address" + if len(attr) > 0 { + varName = attr + } + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", + }, + ) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf( + `domain := acctest.RandomDomainName() +%s := acctest.RandomEmailAddress(domain)`, varName), + }) + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: varName, + Type: TFVarTypeString, + } + } + + if attr, ok := args.Keyword["domainTfVar"]; ok { + varName := "domain" + if len(attr) > 0 { + varName = attr + } + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", + }, + ) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf(`%s := acctest.RandomDomainName()`, varName), + }) + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: varName, + Type: TFVarTypeString, + } + } + + if attr, ok := args.Keyword["subdomainTfVar"]; ok { + parentName := "domain" + varName := "subdomain" + parts := strings.Split(attr, ";") + if len(parts) > 1 { + if len(parts[0]) > 0 { + parentName = parts[0] + } + if len(parts[1]) > 0 { + varName = parts[1] + } + } + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-provider-aws/internal/acctest", + }, + ) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf(`%s := acctest.RandomDomain()`, parentName), + }) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf(`%s := %s.RandomSubdomain()`, varName, parentName), + }) + stuff.AdditionalTfVars_[parentName] = TFVar{ + GoVarName: fmt.Sprintf("%s.String()", parentName), + Type: TFVarTypeString, + } + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: fmt.Sprintf("%s.String()", varName), + Type: TFVarTypeString, + } + } + + if attr, ok := args.Keyword["randomBgpAsn"]; ok { + parts := strings.Split(attr, ";") + varName := "rBgpAsn" + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-plugin-testing/helper/acctest", + Alias: "sdkacctest", + }, + ) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf("%s := sdkacctest.RandIntRange(%s,%s)", varName, parts[0], parts[1]), + }) + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: varName, + Type: TFVarTypeInt, + } + } + + if attr, ok := args.Keyword["randomIPv4Address"]; ok { + varName := "rIPv4Address" + stuff.GoImports = append(stuff.GoImports, + GoImport{ + Path: "github.com/hashicorp/terraform-plugin-testing/helper/acctest", + Alias: "sdkacctest", + }, + ) + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf(`%s, err := sdkacctest.RandIpAddress("%s") +if err != nil { + t.Fatal(err) +} +`, varName, attr), + }) + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: varName, + Type: TFVarTypeString, + } + } + + if attr, ok := args.Keyword["tlsEcdsaPublicKeyPem"]; ok { + if _, err := ParseBoolAttr("tlsEcdsaPublicKeyPem", attr); err != nil { + return err + } else { + varName := "rTlsEcdsaPublicKeyPem" + stuff.InitCodeBlocks = append(stuff.InitCodeBlocks, CodeBlock{ + Code: fmt.Sprintf(`privateKey := acctest.TLSECDSAPrivateKeyPEM(t, "P-384") +%s, _ := acctest.TLSECDSAPublicKeyPEM(t, privateKey)`, varName), + }) + stuff.AdditionalTfVars_[varName] = TFVar{ + GoVarName: varName, + Type: TFVarTypeString, + } + } + } + + return nil +} + +func ParseBoolAttr(name, value string) (bool, error) { + if b, err := strconv.ParseBool(value); err != nil { + return b, fmt.Errorf("invalid %s value %q: Should be boolean value.", name, value) + } else { + return b, nil + } +} + +func ParseIdentifierSpec(s string) (string, *GoImport, error) { + parts := strings.Split(s, ";") + switch len(parts) { + case 1: + return parts[0], nil, nil + + case 2: + return parts[1], &GoImport{ + Path: parts[0], + }, nil + + case 3: + return parts[2], &GoImport{ + Path: parts[0], + Alias: parts[1], + }, nil + + default: + return "", nil, fmt.Errorf("invalid generator value: %q", s) + } +} + +func endpointsConstOrQuote(region string) string { + var buf strings.Builder + buf.WriteString("endpoints.") + + caser := cases.Title(language.Und, cases.NoLower) + for part := range strings.SplitSeq(region, "-") { + buf.WriteString(caser.String(part)) + } + buf.WriteString("RegionID") + + return buf.String() +} diff --git a/internal/generate/tests/common.go b/internal/generate/tests/common.go deleted file mode 100644 index 68994c6e567b..000000000000 --- a/internal/generate/tests/common.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package tests - -import ( - _ "embed" - "fmt" - "text/template" -) - -//go:embed acctest.tf.gtpl -var acctestTfTmpl string - -func AddCommonTemplates(template *template.Template) (*template.Template, error) { - result, err := template.Parse(acctestTfTmpl) - if err != nil { - return nil, fmt.Errorf("parsing common \"acctest.tf.gtpl\" config template: %s", err) - } - return result, nil -} diff --git a/internal/generate/tests/common_test.go.gtpl b/internal/generate/tests/common_test.go.gtpl new file mode 100644 index 000000000000..b4dbe4dfa382 --- /dev/null +++ b/internal/generate/tests/common_test.go.gtpl @@ -0,0 +1,62 @@ +{{ define "commonInit" -}} +{{ range .RequiredEnvVars -}} + acctest.SkipIfEnvVarNotSet(t, "{{ . }}") +{{ end -}} +{{ block "targetName" . }}Missing template "targetName"{{ end }} +{{- if .Generator }} + rName := {{ .Generator }} +{{- end -}} +{{- range .InitCodeBlocks }} + {{ .Code }} +{{- end -}} +{{ if .UseAlternateAccount }} + providers := make(map[string]*schema.Provider) +{{ end }} +{{ end }} + +{{ define "TestCaseSetup" -}} +{{ template "TestCaseSetupNoProviders" . }} +{{- if and (not .UseAlternateAccount) (not .AlternateRegionProvider) }} + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, +{{- end -}} +{{- end }} + +{{ define "CommonTestCaseChecks" -}} + PreCheck: func() { acctest.PreCheck(ctx, t) + {{- if .PreCheckRegions }} + acctest.PreCheckRegion(t, {{ range .PreCheckRegions}}{{ . }}, {{ end }}) + {{- end -}} + {{- range .PreChecks }} + {{ .Code }} + {{- end -}} + {{- range .PreChecksWithRegion }} + {{ .Code }}(ctx, t, acctest.Region()) + {{- end -}} + }, + ErrorCheck: acctest.ErrorCheck(t, names.{{ .PackageProviderNameUpper }}ServiceID), +{{- end }} + +{{ define "baseTestname" -}} +{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ResourceProviderNameUpper }}{{ .Name }} +{{- end }} + +{{ define "Test" -}} +acctest.{{ if and .Serialize (not .SerializeParallelTests) }}Test{{ else }}ParallelTest{{ end }} +{{- end }} + +{{ define "ExistsCheck" }} + testAccCheck{{ .Name }}Exists(ctx, {{ if .ExistsTakesT }}t,{{ end }} resourceName{{ if .ExistsTypeName}}, &v{{ end }}), +{{ end }} + +{{ define "AdditionalTfVars" -}} + {{ range $name, $value := .AdditionalTfVars -}} + {{ if eq $value.Type "string" -}} + {{ $name }}: config.StringVariable({{ $value.GoVarName }}), + {{- else if eq $value.Type "int" -}} + {{ $name }}: config.IntegerVariable({{ $value.GoVarName }}), + {{- end }} + {{ end -}} + {{ if .AlternateRegionProvider -}} + "alt_region": config.StringVariable(acctest.AlternateRegion()), + {{ end -}} +{{ end }} diff --git a/internal/generate/tests/data_source_test.go.gtpl b/internal/generate/tests/data_source_test.go.gtpl new file mode 100644 index 000000000000..6045042b6e09 --- /dev/null +++ b/internal/generate/tests/data_source_test.go.gtpl @@ -0,0 +1,13 @@ +{{ define "testname" -}} +{{ template "baseTestname" . }}DataSource +{{- end }} + +{{ define "targetName" -}} +dataSourceName := "data.{{ .TypeName}}.test" +{{- end }} + +{{ define "Init" }} + ctx := acctest.Context(t) + + {{ template "commonInit" . }} +{{ end }} diff --git a/internal/generate/tests/resource_test.go.gtpl b/internal/generate/tests/resource_test.go.gtpl new file mode 100644 index 000000000000..39d0697721ba --- /dev/null +++ b/internal/generate/tests/resource_test.go.gtpl @@ -0,0 +1,16 @@ +{{ define "testname" -}} +{{ template "baseTestname" . }} +{{- end }} + +{{ define "targetName" -}} +resourceName := "{{ .TypeName}}.test" +{{- end }} + +{{ define "Init" }} + ctx := acctest.Context(t) + + {{ if .ExistsTypeName -}} + var v {{ .ExistsTypeName }} + {{ end -}} + {{ template "commonInit" . }} +{{ end }} diff --git a/internal/generate/tests/templates.go b/internal/generate/tests/templates.go new file mode 100644 index 000000000000..4e2f868edcc5 --- /dev/null +++ b/internal/generate/tests/templates.go @@ -0,0 +1,58 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tests + +import ( + _ "embed" + "fmt" + "text/template" +) + +//go:embed common_test.go.gtpl +var commonTestGoTmpl string + +//go:embed resource_test.go.gtpl +var resourceTestGoTmpl string + +func AddCommonResourceTestTemplates(template *template.Template) (*template.Template, error) { + result, err := template.Parse(commonTestGoTmpl) + if err != nil { + return nil, fmt.Errorf("parsing common \"common_test.go.gtpl\" test template: %s", err) + } + + result, err = result.Parse(resourceTestGoTmpl) + if err != nil { + return nil, fmt.Errorf("parsing common \"resource_test.go.gtpl\" test template: %s", err) + } + + return result, nil +} + +//go:embed data_source_test.go.gtpl +var dataSourceTestGoTmpl string + +func AddCommonDataSourceTestTemplates(template *template.Template) (*template.Template, error) { + result, err := template.Parse(commonTestGoTmpl) + if err != nil { + return nil, fmt.Errorf("parsing common \"common_test.go.gtpl\" test template: %s", err) + } + + result, err = result.Parse(dataSourceTestGoTmpl) + if err != nil { + return nil, fmt.Errorf("parsing common \"datasource_test.go.gtpl\" test template: %s", err) + } + + return result, nil +} + +//go:embed acctest.tf.gtpl +var acctestTfTmpl string + +func AddCommonTfTemplates(template *template.Template) (*template.Template, error) { + result, err := template.Parse(acctestTfTmpl) + if err != nil { + return nil, fmt.Errorf("parsing common \"acctest.tf.gtpl\" config template: %s", err) + } + return result, nil +} diff --git a/internal/iters/README.md b/internal/iter/README.md similarity index 100% rename from internal/iters/README.md rename to internal/iter/README.md diff --git a/internal/iter/apply_to_each.go b/internal/iter/apply_to_each.go new file mode 100644 index 000000000000..f5eccffa5b46 --- /dev/null +++ b/internal/iter/apply_to_each.go @@ -0,0 +1,19 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package iter + +import ( + "iter" +) + +// Filtered returns an iterator over the filtered elements of the sequence. +func AppliedToEach[E, T any](seq iter.Seq[E], f func(E) T) iter.Seq[T] { + return func(yield func(T) bool) { + for v := range seq { + if !yield(f(v)) { + return + } + } + } +} diff --git a/internal/iter/apply_to_each_test.go b/internal/iter/apply_to_each_test.go new file mode 100644 index 000000000000..02932aa9a1ac --- /dev/null +++ b/internal/iter/apply_to_each_test.go @@ -0,0 +1,49 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package iter + +import ( + "slices" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestAppliedToEach(t *testing.T) { + t.Parallel() + + type testCase struct { + input []string + expected []string + } + tests := map[string]testCase{ + "three elements": { + input: []string{"one", "two", "3"}, + expected: []string{"ONE", "TWO", "3"}, + }, + "one element": { + input: []string{"abcdEFGH"}, + expected: []string{"ABCDEFGH"}, + }, + "zero elements": { + input: []string{}, + expected: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + iter := AppliedToEach(slices.Values(test.input), strings.ToUpper) + + got := slices.Collect(iter) + + if diff := cmp.Diff(got, test.expected); diff != "" { + t.Errorf("unexpected diff (+wanted, -got): %s", diff) + } + }) + } +} diff --git a/internal/iters/concat.go b/internal/iter/concat.go similarity index 96% rename from internal/iters/concat.go rename to internal/iter/concat.go index 24d11d942d32..1329dad66869 100644 --- a/internal/iters/concat.go +++ b/internal/iter/concat.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package iters +package iter import ( "iter" diff --git a/internal/iters/concat_test.go b/internal/iter/concat_test.go similarity index 98% rename from internal/iters/concat_test.go rename to internal/iter/concat_test.go index 43219e9ba84b..f68c68bda8e3 100644 --- a/internal/iters/concat_test.go +++ b/internal/iter/concat_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package iters +package iter import ( "iter" diff --git a/internal/iter/filter.go b/internal/iter/filter.go new file mode 100644 index 000000000000..2f93f1445aa4 --- /dev/null +++ b/internal/iter/filter.go @@ -0,0 +1,22 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package iter + +import ( + "iter" +) + +// Predicate represents a predicate (boolean-valued function) of one argument. +type Predicate[T any] func(T) bool + +// Filtered returns an iterator over the filtered elements of the sequence. +func Filtered[T any](seq iter.Seq[T], pred Predicate[T]) iter.Seq[T] { + return func(yield func(T) bool) { + for e := range seq { + if pred(e) && !yield(e) { + return + } + } + } +} diff --git a/internal/iter/filter_test.go b/internal/iter/filter_test.go new file mode 100644 index 000000000000..09f0f9e4ed5b --- /dev/null +++ b/internal/iter/filter_test.go @@ -0,0 +1,51 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package iter + +import ( + "slices" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestFiltered(t *testing.T) { + t.Parallel() + + type testCase struct { + input []string + expected []string + } + tests := map[string]testCase{ + "three elements": { + input: []string{"one", "two", "3", "a0"}, + expected: []string{"a0"}, + }, + "one element": { + input: []string{"abcdEFGH"}, + expected: []string{"abcdEFGH"}, + }, + "zero elements": { + input: []string{}, + expected: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + iter := Filtered(slices.Values(test.input), func(v string) bool { + return strings.HasPrefix(v, "a") + }) + + got := slices.Collect(iter) + + if diff := cmp.Diff(got, test.expected); diff != "" { + t.Errorf("unexpected diff (+wanted, -got): %s", diff) + } + }) + } +} diff --git a/internal/provider/framework/identity_interceptor.go b/internal/provider/framework/identity_interceptor.go index d55944b8e725..2048d3630360 100644 --- a/internal/provider/framework/identity_interceptor.go +++ b/internal/provider/framework/identity_interceptor.go @@ -7,7 +7,6 @@ import ( "context" "github.com/hashicorp/terraform-plugin-framework/attr" - "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -20,8 +19,7 @@ type identityInterceptor struct { attributes []inttypes.IdentityAttribute } -func (r identityInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) diag.Diagnostics { - var diags diag.Diagnostics +func (r identityInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) { awsClient := opts.c switch response, when := opts.response, opts.when; when { @@ -34,37 +32,34 @@ func (r identityInterceptor) create(ctx context.Context, opts interceptorOptions for _, att := range r.attributes { switch att.Name() { case names.AttrAccountID: - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.AccountID(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.AccountID(ctx))...) + if opts.response.Diagnostics.HasError() { + return } case names.AttrRegion: - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.Region(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.Region(ctx))...) + if opts.response.Diagnostics.HasError() { + return } default: var attrVal attr.Value - diags.Append(response.State.GetAttribute(ctx, path.Root(att.ResourceAttributeName()), &attrVal)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.GetAttribute(ctx, path.Root(att.ResourceAttributeName()), &attrVal)...) + if opts.response.Diagnostics.HasError() { + return } - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), attrVal)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), attrVal)...) + if opts.response.Diagnostics.HasError() { + return } } } } - - return diags } -func (r identityInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) diag.Diagnostics { - var diags diag.Diagnostics +func (r identityInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) { awsClient := opts.c switch response, when := opts.response, opts.when; when { @@ -80,43 +75,37 @@ func (r identityInterceptor) read(ctx context.Context, opts interceptorOptions[r for _, att := range r.attributes { switch att.Name() { case names.AttrAccountID: - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.AccountID(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.AccountID(ctx))...) + if opts.response.Diagnostics.HasError() { + return } case names.AttrRegion: - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.Region(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), awsClient.Region(ctx))...) + if opts.response.Diagnostics.HasError() { + return } default: var attrVal attr.Value - diags.Append(response.State.GetAttribute(ctx, path.Root(att.ResourceAttributeName()), &attrVal)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.GetAttribute(ctx, path.Root(att.ResourceAttributeName()), &attrVal)...) + if opts.response.Diagnostics.HasError() { + return } - diags.Append(identity.SetAttribute(ctx, path.Root(att.Name()), attrVal)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(identity.SetAttribute(ctx, path.Root(att.Name()), attrVal)...) + if opts.response.Diagnostics.HasError() { + return } } } } - - return diags } -func (r identityInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) diag.Diagnostics { - var diags diag.Diagnostics - return diags +func (r identityInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) { } -func (r identityInterceptor) delete(ctx context.Context, opts interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) diag.Diagnostics { - var diags diag.Diagnostics - return diags +func (r identityInterceptor) delete(ctx context.Context, opts interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) { } func newIdentityInterceptor(attributes []inttypes.IdentityAttribute) identityInterceptor { diff --git a/internal/provider/framework/identity_interceptor_test.go b/internal/provider/framework/identity_interceptor_test.go index da6eab77ace4..bd53b564d578 100644 --- a/internal/provider/framework/identity_interceptor_test.go +++ b/internal/provider/framework/identity_interceptor_test.go @@ -133,11 +133,11 @@ func create(ctx context.Context, interceptor identityInterceptor, resourceSchema when: After, } - diags := interceptor.create(ctx, opts) - if diags.HasError() { - return nil, diags + interceptor.create(ctx, opts) + if response.Diagnostics.HasError() { + return nil, response.Diagnostics } - return response.Identity, diags + return response.Identity, response.Diagnostics } func read(ctx context.Context, interceptor identityInterceptor, resourceSchema schema.Schema, stateAttrs map[string]string, identity *tfsdk.ResourceIdentity, client awsClient) (*tfsdk.ResourceIdentity, diag.Diagnostics) { @@ -156,11 +156,11 @@ func read(ctx context.Context, interceptor identityInterceptor, resourceSchema s when: After, } - diags := interceptor.read(ctx, opts) - if diags.HasError() { - return nil, diags + interceptor.read(ctx, opts) + if response.Diagnostics.HasError() { + return nil, response.Diagnostics } - return response.Identity, diags + return response.Identity, response.Diagnostics } func getIdentityAttributeValue(ctx context.Context, t *testing.T, identity *tfsdk.ResourceIdentity, path path.Path) string { diff --git a/internal/provider/framework/intercept.go b/internal/provider/framework/intercept.go index b741d95f63d3..9d88fb5f6e6b 100644 --- a/internal/provider/framework/intercept.go +++ b/internal/provider/framework/intercept.go @@ -5,10 +5,10 @@ package framework import ( "context" + "slices" "github.com/aws/aws-sdk-go-v2/aws" "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" @@ -34,7 +34,7 @@ type interceptorOptions[Request, Response any] struct { when when } -type interceptorFunc[Request, Response any] func(context.Context, interceptorOptions[Request, Response]) diag.Diagnostics +type interceptorFunc[Request, Response any] func(context.Context, interceptorOptions[Request, Response]) type interceptorInvocations []any @@ -44,7 +44,7 @@ type interceptorInvocations []any // In other cases all interceptors in the chain are run. type dataSourceCRUDInterceptor interface { // read is invoked for a Read call. - read(context.Context, interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) diag.Diagnostics + read(context.Context, interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) } // dataSourceRead returns a slice of interceptors that run on data source Read. @@ -59,7 +59,7 @@ func (s interceptorInvocations) dataSourceRead() []interceptorFunc[datasource.Re type dataSourceSchemaInterceptor interface { // schema is invoked for a Schema call. - schema(context.Context, interceptorOptions[datasource.SchemaRequest, datasource.SchemaResponse]) diag.Diagnostics + schema(context.Context, interceptorOptions[datasource.SchemaRequest, datasource.SchemaResponse]) } // dataSourceSchema returns a slice of interceptors that run on data source Schema. @@ -74,11 +74,11 @@ func (s interceptorInvocations) dataSourceSchema() []interceptorFunc[datasource. type ephemeralResourceORCInterceptor interface { // open is invoked for an Open call. - open(context.Context, interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) diag.Diagnostics + open(context.Context, interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) // renew is invoked for a Renew call. - renew(context.Context, interceptorOptions[ephemeral.RenewRequest, ephemeral.RenewResponse]) diag.Diagnostics + renew(context.Context, interceptorOptions[ephemeral.RenewRequest, ephemeral.RenewResponse]) // close is invoked for a Close call. - close(context.Context, interceptorOptions[ephemeral.CloseRequest, ephemeral.CloseResponse]) diag.Diagnostics + close(context.Context, interceptorOptions[ephemeral.CloseRequest, ephemeral.CloseResponse]) } // ephemeralResourceOpen returns a slice of interceptors that run on ephemeral resource Open. @@ -115,27 +115,18 @@ func (s interceptorInvocations) ephemeralResourceClose() []interceptorFunc[ephem // It can be embedded into a struct to provide default behavior for the open, renew, and close methods. type ephemeralResourceNoOpORCInterceptor struct{} -func (r ephemeralResourceNoOpORCInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r ephemeralResourceNoOpORCInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) { } -func (r ephemeralResourceNoOpORCInterceptor) renew(ctx context.Context, opts interceptorOptions[ephemeral.RenewRequest, ephemeral.RenewResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r ephemeralResourceNoOpORCInterceptor) renew(ctx context.Context, opts interceptorOptions[ephemeral.RenewRequest, ephemeral.RenewResponse]) { } -func (r ephemeralResourceNoOpORCInterceptor) close(ctx context.Context, opts interceptorOptions[ephemeral.CloseRequest, ephemeral.CloseResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r ephemeralResourceNoOpORCInterceptor) close(ctx context.Context, opts interceptorOptions[ephemeral.CloseRequest, ephemeral.CloseResponse]) { } type ephemeralResourceSchemaInterceptor interface { // schema is invoked for a Schema call. - schema(context.Context, interceptorOptions[ephemeral.SchemaRequest, ephemeral.SchemaResponse]) diag.Diagnostics + schema(context.Context, interceptorOptions[ephemeral.SchemaRequest, ephemeral.SchemaResponse]) } // ephemeralResourceSchema returns a slice of interceptors that run on ephemeral resource Schema. @@ -154,13 +145,13 @@ func (s interceptorInvocations) ephemeralResourceSchema() []interceptorFunc[ephe // In other cases all interceptors in the chain are run. type resourceCRUDInterceptor interface { // create is invoked for a Create call. - create(context.Context, interceptorOptions[resource.CreateRequest, resource.CreateResponse]) diag.Diagnostics + create(context.Context, interceptorOptions[resource.CreateRequest, resource.CreateResponse]) // read is invoked for a Read call. - read(context.Context, interceptorOptions[resource.ReadRequest, resource.ReadResponse]) diag.Diagnostics + read(context.Context, interceptorOptions[resource.ReadRequest, resource.ReadResponse]) // update is invoked for an Update call. - update(context.Context, interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) diag.Diagnostics + update(context.Context, interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) // delete is invoked for a Delete call. - delete(context.Context, interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) diag.Diagnostics + delete(context.Context, interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) } // resourceCreate returns a slice of interceptors that run on resource Create. @@ -207,33 +198,21 @@ func (s interceptorInvocations) resourceDelete() []interceptorFunc[resource.Dele // It can be embedded into a struct to provide default behavior for the create, read, update, and delete methods. type resourceNoOpCRUDInterceptor struct{} -func (r resourceNoOpCRUDInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r resourceNoOpCRUDInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) { } -func (r resourceNoOpCRUDInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r resourceNoOpCRUDInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) { } -func (r resourceNoOpCRUDInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r resourceNoOpCRUDInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) { } -func (r resourceNoOpCRUDInterceptor) delete(ctx context.Context, opts interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) diag.Diagnostics { - var diags diag.Diagnostics - - return diags +func (r resourceNoOpCRUDInterceptor) delete(ctx context.Context, opts interceptorOptions[resource.DeleteRequest, resource.DeleteResponse]) { } type resourceSchemaInterceptor interface { // schema is invoked for a Schema call. - schema(context.Context, interceptorOptions[resource.SchemaRequest, resource.SchemaResponse]) diag.Diagnostics + schema(context.Context, interceptorOptions[resource.SchemaRequest, resource.SchemaResponse]) } // resourceSchema returns a slice of interceptors that run on resource Schema. @@ -248,7 +227,7 @@ func (s interceptorInvocations) resourceSchema() []interceptorFunc[resource.Sche type resourceModifyPlanInterceptor interface { // modifyPlan is invoked for a ModifyPlan call. - modifyPlan(context.Context, interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) diag.Diagnostics + modifyPlan(context.Context, interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) } // resourceModifyPlan returns a slice of interceptors that run on resource ModifyPlan. @@ -263,7 +242,7 @@ func (s interceptorInvocations) resourceModifyPlan() []interceptorFunc[resource. type resourceImportStateInterceptor interface { // importState is invoked for an ImportState call. - importState(context.Context, interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) diag.Diagnostics + importState(context.Context, interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) } // resourceSchema returns a slice of interceptors that run on resource Schema. @@ -276,6 +255,9 @@ func (s interceptorInvocations) resourceImportState() []interceptorFunc[resource }) } +// Only generate strings for use in tests +//go:generate stringer -type=when -output=when_string_test.go + // when represents the point in the CRUD request lifecycle that an interceptor is run. // Multiple values can be ORed together. type when uint16 @@ -321,59 +303,97 @@ type interceptedResponse interface { resource.ImportStateResponse } +type innerFunc[Request, Response any] func(ctx context.Context, request Request, response *Response) + // interceptedHandler returns a handler that runs any interceptors. -func interceptedHandler[Request interceptedRequest, Response interceptedResponse](interceptors []interceptorFunc[Request, Response], f func(context.Context, *Request, *Response) diag.Diagnostics, c *conns.AWSClient) func(context.Context, *Request, *Response) diag.Diagnostics { - return func(ctx context.Context, request *Request, response *Response) diag.Diagnostics { - var diags diag.Diagnostics +func interceptedHandler[Request interceptedRequest, Response interceptedResponse](interceptors []interceptorFunc[Request, Response], f innerFunc[Request, Response], hasError hasErrorFn[Response], c awsClient) func(context.Context, Request, *Response) { + return func(ctx context.Context, request Request, response *Response) { + opts := interceptorOptions[Request, Response]{ + c: c, + request: &request, + response: response, + } + // Before interceptors are run first to last. - forward := interceptors - - when := Before - for _, v := range forward { - opts := interceptorOptions[Request, Response]{ - c: c, - request: request, - response: response, - when: when, - } - diags.Append(v(ctx, opts)...) + opts.when = Before + for v := range slices.Values(interceptors) { + v(ctx, opts) // Short circuit if any Before interceptor errors. - if diags.HasError() { - return diags + if hasError(response) { + return } } - // All other interceptors are run last to first. - reverse := tfslices.Reverse(forward) - diags = f(ctx, request, response) + f(ctx, request, response) - if diags.HasError() { - when = OnError + // All other interceptors are run last to first. + if hasError(response) { + opts.when = OnError } else { - when = After + opts.when = After } - for _, v := range reverse { - opts := interceptorOptions[Request, Response]{ - c: c, - request: request, - response: response, - when: when, - } - diags.Append(v(ctx, opts)...) + for v := range tfslices.BackwardValues(interceptors) { + v(ctx, opts) } - when = Finally - for _, v := range reverse { - opts := interceptorOptions[Request, Response]{ - c: c, - request: request, - response: response, - when: when, - } - diags.Append(v(ctx, opts)...) + opts.when = Finally + for v := range tfslices.BackwardValues(interceptors) { + v(ctx, opts) } - - return diags } } + +type hasErrorFn[Response interceptedResponse] func(response *Response) bool + +func dataSourceSchemaHasError(response *datasource.SchemaResponse) bool { + return response.Diagnostics.HasError() +} + +func dataSourceReadHasError(response *datasource.ReadResponse) bool { + return response.Diagnostics.HasError() +} + +func ephemeralSchemaHasError(response *ephemeral.SchemaResponse) bool { + return response.Diagnostics.HasError() +} + +func ephemeralOpenHasError(response *ephemeral.OpenResponse) bool { + return response.Diagnostics.HasError() +} + +func ephemeralRenewHasError(response *ephemeral.RenewResponse) bool { + return response.Diagnostics.HasError() +} + +func ephemeralCloseHasError(response *ephemeral.CloseResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceSchemaHasError(response *resource.SchemaResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceCreateHasError(response *resource.CreateResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceReadHasError(response *resource.ReadResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceUpdateHasError(response *resource.UpdateResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceDeleteHasError(response *resource.DeleteResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceModifyPlanHasError(response *resource.ModifyPlanResponse) bool { + return response.Diagnostics.HasError() +} + +func resourceImportStateHasError(response *resource.ImportStateResponse) bool { + return response.Diagnostics.HasError() +} diff --git a/internal/provider/framework/intercept_test.go b/internal/provider/framework/intercept_test.go new file mode 100644 index 000000000000..995dae00f38d --- /dev/null +++ b/internal/provider/framework/intercept_test.go @@ -0,0 +1,619 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package framework + +import ( + "context" + "slices" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" +) + +func TestInterceptedHandler_Diags_FirstHasBeforeError(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewErrorDiagnostic("First interceptor Before error", "An error occurred in the first interceptor Before handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewErrorDiagnostic("First interceptor Before error", "An error occurred in the first interceptor Before handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{}) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before}) { + t.Errorf("expected first interceptor to be called once, got %v", first.called) + } + if !slices.Equal(second.called, []when{}) { + t.Errorf("expected second interceptor to not be called, got %v", second.called) + } + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_SecondHasBeforeError(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{}) + second := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before}) { + t.Errorf("expected first interceptor to be called once, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before}) { + t.Errorf("expected second interceptor to be called once, got %v", second.called) + } + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_FirstHasBeforeWarning(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{}) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, After, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, After, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_SecondHasBeforeWarning(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{}) + second := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + }) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, After, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, After, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_FirstHasBeforeWarning_SecondHasBeforeError(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + diag.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before}) { + t.Errorf("expected first interceptor to be called once, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before}) { + t.Errorf("expected second interceptor to be called once, got %v", second.called) + } + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_InnerHasError(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + } + + first := mockInterceptor{} + second := mockInterceptor{} + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + f.diags = diag.Diagnostics{ + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + } + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, OnError, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, OnError, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_InnerHasWarning(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + } + + first := mockInterceptor{} + second := mockInterceptor{} + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + f.diags = diag.Diagnostics{ + diag.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + } + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, After, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, After, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_InnerHasError_FirstHasBeforeWarning(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{}) + + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + f.diags = diag.Diagnostics{ + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + } + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, OnError, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, OnError, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_AllHaveWarnings(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + diag.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + diag.NewWarningDiagnostic("Second interceptor After warning", "A warning occurred in the second interceptor After handler"), + diag.NewWarningDiagnostic("First interceptor After warning", "A warning occurred in the first interceptor After handler"), + diag.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + diag.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + After: { + diag.NewWarningDiagnostic("First interceptor After warning", "A warning occurred in the first interceptor After handler"), + }, + Finally: { + diag.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + After: { + diag.NewWarningDiagnostic("Second interceptor After warning", "A warning occurred in the second interceptor After handler"), + }, + Finally: { + diag.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + }, + }) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + f.diags = diag.Diagnostics{ + diag.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + } + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, After, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, After, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +func TestInterceptedHandler_Diags_InnerHasError_HandlersHaveWarnings(t *testing.T) { + t.Parallel() + + expectedDiags := diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + diag.NewWarningDiagnostic("Second interceptor OnError warning", "A warning occurred in the second interceptor OnError handler"), + diag.NewWarningDiagnostic("First interceptor OnError warning", "A warning occurred in the first interceptor OnError handler"), + diag.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + diag.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + } + + first := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + OnError: { + diag.NewWarningDiagnostic("First interceptor OnError warning", "A warning occurred in the first interceptor OnError handler"), + }, + Finally: { + diag.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }) + second := newMockInterceptor(map[when]diag.Diagnostics{ + Before: { + diag.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + OnError: { + diag.NewWarningDiagnostic("Second interceptor OnError warning", "A warning occurred in the second interceptor OnError handler"), + }, + Finally: { + diag.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + }, + }) + interceptors := []interceptorFunc[resource.SchemaRequest, resource.SchemaResponse]{ + first.Intercept, + second.Intercept, + } + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + var f mockInnerFunc + f.diags = diag.Diagnostics{ + diag.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + } + handler := interceptedHandler(interceptors, f.Call, resourceSchemaHasError, client) + + ctx := t.Context() + var request resource.SchemaRequest + response := resource.SchemaResponse{ + Diagnostics: diag.Diagnostics{ + diag.NewWarningDiagnostic("Pre-existing warning", "This is a pre-existing warning that should not be affected by the interceptors"), + }, + } + + handler(ctx, request, &response) + + if diff := cmp.Diff(response.Diagnostics, expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if !slices.Equal(first.called, []when{Before, OnError, Finally}) { + t.Errorf("expected first interceptor to be called three times, got %v", first.called) + } + if !slices.Equal(second.called, []when{Before, OnError, Finally}) { + t.Errorf("expected second interceptor to be called three times, got %v", second.called) + } + if f.count != 1 { + t.Errorf("expected inner function to be called once, got %d", f.count) + } +} + +type mockInterceptor struct { + diags map[when]diag.Diagnostics + called []when +} + +func newMockInterceptor(diags map[when]diag.Diagnostics) *mockInterceptor { + return &mockInterceptor{ + diags: diags, + } +} + +func (m *mockInterceptor) Intercept(ctx context.Context, opts interceptorOptions[resource.SchemaRequest, resource.SchemaResponse]) { + m.called = append(m.called, opts.when) + // return m.diags[opts.when] + opts.response.Diagnostics.Append(m.diags[opts.when]...) +} + +type mockInnerFunc struct { + diags diag.Diagnostics + count int +} + +func (m *mockInnerFunc) Call(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + m.count++ + response.Diagnostics.Append(m.diags...) +} diff --git a/internal/provider/framework/provider.go b/internal/provider/framework/provider.go index 6e1d2b6be902..0745fe4329a6 100644 --- a/internal/provider/framework/provider.go +++ b/internal/provider/framework/provider.go @@ -9,25 +9,27 @@ import ( "fmt" "iter" "log" + "reflect" "slices" + "sync" + "unique" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/diag" + datasourceschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/ephemeral" + empemeralschema "github.com/hashicorp/terraform-plugin-framework/ephemeral/schema" "github.com/hashicorp/terraform-plugin-framework/function" - "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" + resourceschema "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/framework" - fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tffunction "github.com/hashicorp/terraform-provider-aws/internal/function" - "github.com/hashicorp/terraform-provider-aws/internal/logging" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" tfunique "github.com/hashicorp/terraform-provider-aws/internal/unique" @@ -35,7 +37,7 @@ import ( ) var ( - resourceSchemasValidated bool + resourceSchemasValidated sync.Once ) var ( @@ -65,28 +67,18 @@ func NewProvider(ctx context.Context, primary interface{ Meta() any }) (provider servicePackages: primary.Meta().(*conns.AWSClient).ServicePackages(ctx), } - // Acceptance tests call this function multiple times, potentially in parallel. - // To avoid "fatal error: concurrent map writes", take a lock. - const ( - mutexKVKey = "provider.New" - ) - conns.GlobalMutexKV.Lock(mutexKVKey) - defer conns.GlobalMutexKV.Unlock(mutexKVKey) - // Because we try and share resource schemas as much as possible, // we need to ensure that we only validate the resource schemas once. - if !resourceSchemasValidated { - if err := provider.validateResourceSchemas(ctx); err != nil { - return nil, err - } - - resourceSchemasValidated = true - } - - if err := provider.initialize(ctx); err != nil { + var err error + resourceSchemasValidated.Do(func() { + err = provider.validateResourceSchemas(ctx) + }) + if err != nil { return nil, err } + provider.initialize(ctx) + return provider, nil } @@ -392,231 +384,32 @@ func (p *frameworkProvider) Functions(_ context.Context) []func() function.Funct } // initialize is called from `New` to perform any Terraform Framework-style initialization. -func (p *frameworkProvider) initialize(ctx context.Context) error { +func (p *frameworkProvider) initialize(ctx context.Context) { log.Printf("Initializing Terraform AWS Provider (Framework-style)...") - var errs []error - for sp := range p.servicePackages { servicePackageName := sp.ServicePackageName() - for _, v := range sp.FrameworkDataSources(ctx) { - typeName := v.TypeName - inner, err := v.Factory(ctx) - - if err != nil { - errs = append(errs, fmt.Errorf("creating data source (%s): %w", typeName, err)) - continue - } - - var isRegionOverrideEnabled bool - if v := v.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - isRegionOverrideEnabled = true - } - - var interceptors interceptorInvocations - - if isRegionOverrideEnabled { - v := v.Region.Value() - - interceptors = append(interceptors, dataSourceInjectRegionAttribute()) - if v.IsValidateOverrideInPartition { - interceptors = append(interceptors, dataSourceValidateRegion()) - } - interceptors = append(interceptors, dataSourceSetRegionInState()) - } - - if !tfunique.IsHandleNil(v.Tags) { - interceptors = append(interceptors, dataSourceTransparentTagging(v.Tags)) - } - - opts := wrappedDataSourceOptions{ - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext: func(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { - var diags diag.Diagnostics - var overrideRegion string - - if isRegionOverrideEnabled && getAttribute != nil { - var target types.String - diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) - if diags.HasError() { - return ctx, diags - } - - overrideRegion = target.ValueString() - } - - ctx = conns.NewResourceContext(ctx, servicePackageName, v.Name, overrideRegion) - if c != nil { - ctx = tftags.NewContext(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx)) - ctx = c.RegisterLogger(ctx) - ctx = fwflex.RegisterLogger(ctx) - } - - return ctx, diags - }, - interceptors: interceptors, - typeName: typeName, - } - p.dataSources = append(p.dataSources, func() datasource.DataSource { - return newWrappedDataSource(inner, opts) + for _, dataSourceSpec := range sp.FrameworkDataSources(ctx) { + p.dataSources = append(p.dataSources, func() datasource.DataSource { //nolint:contextcheck // must be a func() + return newWrappedDataSource(dataSourceSpec, servicePackageName) }) } if v, ok := sp.(conns.ServicePackageWithEphemeralResources); ok { - for _, v := range v.EphemeralResources(ctx) { - typeName := v.TypeName - inner, err := v.Factory(ctx) - - if err != nil { - errs = append(errs, fmt.Errorf("creating ephemeral resource (%s): %w", typeName, err)) - continue - } - - var isRegionOverrideEnabled bool - if v := v.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - isRegionOverrideEnabled = true - } - - var interceptors interceptorInvocations - - if isRegionOverrideEnabled { - v := v.Region.Value() - - interceptors = append(interceptors, ephemeralResourceInjectRegionAttribute()) - if v.IsValidateOverrideInPartition { - interceptors = append(interceptors, ephemeralResourceValidateRegion()) - } - interceptors = append(interceptors, ephemeralResourceSetRegionInResult()) - } - - opts := wrappedEphemeralResourceOptions{ - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext: func(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { - var diags diag.Diagnostics - var overrideRegion string - - if isRegionOverrideEnabled && getAttribute != nil { - var target types.String - diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) - if diags.HasError() { - return ctx, diags - } - - overrideRegion = target.ValueString() - } - - ctx = conns.NewResourceContext(ctx, servicePackageName, v.Name, overrideRegion) - if c != nil { - ctx = c.RegisterLogger(ctx) - ctx = fwflex.RegisterLogger(ctx) - ctx = logging.MaskSensitiveValuesByKey(ctx, logging.HTTPKeyRequestBody, logging.HTTPKeyResponseBody) - } - return ctx, diags - }, - interceptors: interceptors, - typeName: v.TypeName, - } - p.ephemeralResources = append(p.ephemeralResources, func() ephemeral.EphemeralResource { - return newWrappedEphemeralResource(inner, opts) + for _, ephemeralResourceSpec := range v.EphemeralResources(ctx) { + p.ephemeralResources = append(p.ephemeralResources, func() ephemeral.EphemeralResource { //nolint:contextcheck // must be a func() + return newWrappedEphemeralResource(ephemeralResourceSpec, servicePackageName) }) } } - for _, res := range sp.FrameworkResources(ctx) { - typeName := res.TypeName - inner, err := res.Factory(ctx) - - if err != nil { - errs = append(errs, fmt.Errorf("creating resource (%s): %w", typeName, err)) - continue - } - - var isRegionOverrideEnabled bool - if v := res.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - isRegionOverrideEnabled = true - } - - var interceptors interceptorInvocations - - if isRegionOverrideEnabled { - v := res.Region.Value() - - interceptors = append(interceptors, resourceInjectRegionAttribute()) - if v.IsValidateOverrideInPartition { - interceptors = append(interceptors, resourceValidateRegion()) - } - interceptors = append(interceptors, resourceDefaultRegion()) - interceptors = append(interceptors, resourceForceNewIfRegionChanges()) - interceptors = append(interceptors, resourceSetRegionInState()) - if res.Identity.HasInherentRegion() { - interceptors = append(interceptors, resourceImportRegionNoDefault()) - } else { - interceptors = append(interceptors, resourceImportRegion()) - } - } - - if !tfunique.IsHandleNil(res.Tags) { - interceptors = append(interceptors, resourceTransparentTagging(res.Tags)) - } - - if res.Import.WrappedImport { - if res.Import.SetIDAttr { - if _, ok := res.Import.ImportID.(inttypes.FrameworkImportIDCreator); !ok { - errs = append(errs, fmt.Errorf("resource type %s: importer sets \"id\" attribute, but creator isn't configured", typeName)) - continue - } - } - switch v := inner.(type) { - case framework.ImportByIdentityer: - v.SetIdentitySpec(res.Identity, res.Import) - - default: - errs = append(errs, fmt.Errorf("resource type %s: cannot configure importer", typeName)) - continue - } - } - - opts := wrappedResourceOptions{ - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext: func(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { - var diags diag.Diagnostics - var overrideRegion string - - if isRegionOverrideEnabled && getAttribute != nil { - var target types.String - diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) - if diags.HasError() { - return ctx, diags - } - - overrideRegion = target.ValueString() - } - - ctx = conns.NewResourceContext(ctx, servicePackageName, res.Name, overrideRegion) - if c != nil { - ctx = tftags.NewContext(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx)) - ctx = c.RegisterLogger(ctx) - ctx = fwflex.RegisterLogger(ctx) - } - - return ctx, diags - }, - interceptors: interceptors, - typeName: typeName, - } - if len(res.Identity.Attributes) > 0 { - opts.identity = res.Identity - opts.interceptors = append(opts.interceptors, newIdentityInterceptor(res.Identity.Attributes)) - } - - p.resources = append(p.resources, func() resource.Resource { - return newWrappedResource(inner, opts) + for _, resourceSpec := range sp.FrameworkResources(ctx) { + p.resources = append(p.resources, func() resource.Resource { //nolint:contextcheck // must be a func() + return newWrappedResource(resourceSpec, servicePackageName) }) } } - - return errors.Join(errs...) } // validateResourceSchemas is called from `New` to validate Terraform Plugin Framework-style resource schemas. @@ -624,100 +417,81 @@ func (p *frameworkProvider) validateResourceSchemas(ctx context.Context) error { var errs []error for sp := range p.servicePackages { - for _, v := range sp.FrameworkDataSources(ctx) { - typeName := v.TypeName - ds, err := v.Factory(ctx) + for _, dataSourceSpec := range sp.FrameworkDataSources(ctx) { + typeName := dataSourceSpec.TypeName + inner, err := dataSourceSpec.Factory(ctx) if err != nil { - errs = append(errs, fmt.Errorf("creating data source (%s): %w", typeName, err)) + errs = append(errs, fmt.Errorf("creating data source type (%s): %w", typeName, err)) continue } schemaResponse := datasource.SchemaResponse{} - ds.Schema(ctx, datasource.SchemaRequest{}, &schemaResponse) + inner.Schema(ctx, datasource.SchemaRequest{}, &schemaResponse) - if v := v.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - if _, ok := schemaResponse.Schema.Attributes[names.AttrRegion]; ok { - errs = append(errs, fmt.Errorf("`%s` attribute is defined: %s data source", names.AttrRegion, typeName)) - continue - } + if err := validateSchemaRegionForDataSource(dataSourceSpec.Region, schemaResponse.Schema); err != nil { + errs = append(errs, fmt.Errorf("data source type %q: %w", typeName, err)) + continue } - if !tfunique.IsHandleNil(v.Tags) { - // The data source has opted in to transparent tagging. - // Ensure that the schema look OK. - if v, ok := schemaResponse.Schema.Attributes[names.AttrTags]; ok { - if !v.IsComputed() { - errs = append(errs, fmt.Errorf("`%s` attribute must be Computed: %s data source", names.AttrTags, typeName)) - continue - } - } else { - errs = append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s data source", names.AttrTags, typeName)) - continue - } + if err := validateSchemaTagsForDataSource(dataSourceSpec.Tags, schemaResponse.Schema); err != nil { + errs = append(errs, fmt.Errorf("data source type %q: %w", typeName, err)) + continue } } if v, ok := sp.(conns.ServicePackageWithEphemeralResources); ok { - for _, v := range v.EphemeralResources(ctx) { - typeName := v.TypeName - er, err := v.Factory(ctx) + for _, ephemeralResourceSpec := range v.EphemeralResources(ctx) { + typeName := ephemeralResourceSpec.TypeName + inner, err := ephemeralResourceSpec.Factory(ctx) if err != nil { - errs = append(errs, fmt.Errorf("creating ephemeral resource (%s): %w", typeName, err)) + errs = append(errs, fmt.Errorf("creating ephemeral resource type (%s): %w", typeName, err)) continue } schemaResponse := ephemeral.SchemaResponse{} - er.Schema(ctx, ephemeral.SchemaRequest{}, &schemaResponse) + inner.Schema(ctx, ephemeral.SchemaRequest{}, &schemaResponse) - if v := v.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - if _, ok := schemaResponse.Schema.Attributes[names.AttrRegion]; ok { - errs = append(errs, fmt.Errorf("`%s` attribute is defined: %s ephemeral resource", names.AttrRegion, typeName)) - continue - } + if err := validateSchemaRegionForEphemeralResource(ephemeralResourceSpec.Region, schemaResponse.Schema); err != nil { + errs = append(errs, fmt.Errorf("ephemeral resource type %q: %w", typeName, err)) + continue } } } - for _, v := range sp.FrameworkResources(ctx) { - typeName := v.TypeName - r, err := v.Factory(ctx) + for _, resourceSpec := range sp.FrameworkResources(ctx) { + typeName := resourceSpec.TypeName + inner, err := resourceSpec.Factory(ctx) if err != nil { - errs = append(errs, fmt.Errorf("creating resource (%s): %w", typeName, err)) + errs = append(errs, fmt.Errorf("creating resource type (%s): %w", typeName, err)) continue } schemaResponse := resource.SchemaResponse{} - r.Schema(ctx, resource.SchemaRequest{}, &schemaResponse) + inner.Schema(ctx, resource.SchemaRequest{}, &schemaResponse) - if v := v.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { - if _, ok := schemaResponse.Schema.Attributes[names.AttrRegion]; ok { - errs = append(errs, fmt.Errorf("`%s` attribute is defined: %s resource", names.AttrRegion, typeName)) - continue - } + if err := validateSchemaRegionForResource(resourceSpec.Region, schemaResponse.Schema); err != nil { + errs = append(errs, fmt.Errorf("resource type %q: %w", typeName, err)) + continue } - if !tfunique.IsHandleNil(v.Tags) { - // The resource has opted in to transparent tagging. - // Ensure that the schema look OK. - if v, ok := schemaResponse.Schema.Attributes[names.AttrTags]; ok { - if v.IsComputed() { - errs = append(errs, fmt.Errorf("`%s` attribute cannot be Computed: %s resource", names.AttrTags, typeName)) + if err := validateSchemaTagsForResource(resourceSpec.Tags, schemaResponse.Schema); err != nil { + errs = append(errs, fmt.Errorf("resource type %q: %w", typeName, err)) + continue + } + + if resourceSpec.Import.WrappedImport { + if resourceSpec.Import.SetIDAttr { + if _, ok := resourceSpec.Import.ImportID.(inttypes.FrameworkImportIDCreator); !ok { + errs = append(errs, fmt.Errorf("resource type %q: importer sets `%s` attribute, but creator isn't configured", resourceSpec.TypeName, names.AttrID)) continue } - } else { - errs = append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s resource", names.AttrTags, typeName)) - continue } - if v, ok := schemaResponse.Schema.Attributes[names.AttrTagsAll]; ok { - if !v.IsComputed() { - errs = append(errs, fmt.Errorf("`%s` attribute must be Computed: %s resource", names.AttrTagsAll, typeName)) - continue - } - } else { - errs = append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s resource", names.AttrTagsAll, typeName)) + + if _, ok := inner.(framework.ImportByIdentityer); !ok { + errs = append(errs, fmt.Errorf("resource type %q: cannot configure importer, does not implement %q", resourceSpec.TypeName, reflect.TypeFor[framework.ImportByIdentityer]())) continue } } @@ -726,3 +500,63 @@ func (p *frameworkProvider) validateResourceSchemas(ctx context.Context) error { return errors.Join(errs...) } + +func validateSchemaRegionForDataSource(regionSpec unique.Handle[inttypes.ServicePackageResourceRegion], schema datasourceschema.Schema) error { + if !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + if _, ok := schema.Attributes[names.AttrRegion]; ok { + return fmt.Errorf("configured for enhanced regions but defines `%s` attribute in schema", names.AttrRegion) + } + } + return nil +} + +func validateSchemaRegionForEphemeralResource(regionSpec unique.Handle[inttypes.ServicePackageResourceRegion], schema empemeralschema.Schema) error { + if !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + if _, ok := schema.Attributes[names.AttrRegion]; ok { + return fmt.Errorf("configured for enhanced regions but defines `%s` attribute in schema", names.AttrRegion) + } + } + return nil +} + +func validateSchemaRegionForResource(regionSpec unique.Handle[inttypes.ServicePackageResourceRegion], schema resourceschema.Schema) error { + if !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + if _, ok := schema.Attributes[names.AttrRegion]; ok { + return fmt.Errorf("configured for enhanced regions but defines `%s` attribute in schema", names.AttrRegion) + } + } + return nil +} + +func validateSchemaTagsForDataSource(tagsSpec unique.Handle[inttypes.ServicePackageResourceTags], schema datasourceschema.Schema) error { + if !tfunique.IsHandleNil(tagsSpec) { + if v, ok := schema.Attributes[names.AttrTags]; ok { + if !v.IsComputed() { + return fmt.Errorf("`%s` attribute must be Computed", names.AttrTags) + } + } else { + return fmt.Errorf("configured for tags but no `%s` attribute defined in schema", names.AttrTags) + } + } + return nil +} + +func validateSchemaTagsForResource(tagsSpec unique.Handle[inttypes.ServicePackageResourceTags], schema resourceschema.Schema) error { + if !tfunique.IsHandleNil(tagsSpec) { + if v, ok := schema.Attributes[names.AttrTags]; ok { + if v.IsComputed() { + return fmt.Errorf("`%s` attribute cannot be Computed", names.AttrTags) + } + } else { + return fmt.Errorf("configured for tags but no `%s` attribute defined in schema", names.AttrTags) + } + if v, ok := schema.Attributes[names.AttrTagsAll]; ok { + if !v.IsComputed() { + return fmt.Errorf("`%s` attribute must be Computed", names.AttrTagsAll) + } + } else { + return fmt.Errorf("configured for tags but no `%s` attribute defined in schema", names.AttrTagsAll) + } + } + return nil +} diff --git a/internal/provider/framework/provider_gen.go b/internal/provider/framework/provider_gen.go index b0c5d9c5af7d..b9ef915c359c 100644 --- a/internal/provider/framework/provider_gen.go +++ b/internal/provider/framework/provider_gen.go @@ -226,6 +226,13 @@ func endpointsBlock() schema.SetNestedBlock { Description: "Use this to override the default service endpoint URL", }, + // bedrockagentcore + + "bedrockagentcore": schema.StringAttribute{ + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // billing "billing": schema.StringAttribute{ @@ -1354,6 +1361,13 @@ func endpointsBlock() schema.SetNestedBlock { Description: "Use this to override the default service endpoint URL", }, + // odb + + "odb": schema.StringAttribute{ + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // opensearch "opensearch": schema.StringAttribute{ @@ -1662,6 +1676,13 @@ func endpointsBlock() schema.SetNestedBlock { Description: "Use this to override the default service endpoint URL", }, + // s3vectors + + "s3vectors": schema.StringAttribute{ + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // sagemaker "sagemaker": schema.StringAttribute{ diff --git a/internal/provider/framework/region.go b/internal/provider/framework/region.go index cb7fcac435c5..9b132ad9a73e 100644 --- a/internal/provider/framework/region.go +++ b/internal/provider/framework/region.go @@ -31,9 +31,7 @@ func validateInContextRegionInPartition(ctx context.Context, c awsClient) diag.D type dataSourceInjectRegionAttributeInterceptor struct{} -func (r dataSourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[datasource.SchemaRequest, datasource.SchemaResponse]) diag.Diagnostics { - var diags diag.Diagnostics - +func (r dataSourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[datasource.SchemaRequest, datasource.SchemaResponse]) { switch response, when := opts.response, opts.when; when { case After: if _, ok := response.Schema.Attributes[names.AttrRegion]; !ok { @@ -45,8 +43,6 @@ func (r dataSourceInjectRegionAttributeInterceptor) schema(ctx context.Context, } } } - - return diags } // dataSourceInjectRegionAttribute injects a top-level "region" attribute into a data source's schema. @@ -56,20 +52,17 @@ func dataSourceInjectRegionAttribute() dataSourceSchemaInterceptor { type dataSourceValidateRegionInterceptor struct{} -func (r dataSourceValidateRegionInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) diag.Diagnostics { +func (r dataSourceValidateRegionInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) { c := opts.c - var diags diag.Diagnostics switch when := opts.when; when { case Before: // As data sources have no ModifyPlan functionality we validate the per-resource Region override value before R. - diags.Append(validateInContextRegionInPartition(ctx, c)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(validateInContextRegionInPartition(ctx, c)...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } // dataSourceValidateRegion validates that the value of the top-level `region` attribute is in the configured AWS partition. @@ -79,28 +72,25 @@ func dataSourceValidateRegion() dataSourceCRUDInterceptor { type dataSourceSetRegionInStateInterceptor struct{} -func (r dataSourceSetRegionInStateInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) diag.Diagnostics { +func (r dataSourceSetRegionInStateInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) { c := opts.c - var diags diag.Diagnostics switch response, when := opts.response, opts.when; when { case After: // Set region in state after R, but only if the data source didn't explicitly set it (e.g. aws_region). var target types.String - diags.Append(response.State.GetAttribute(ctx, path.Root(names.AttrRegion), &target)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.GetAttribute(ctx, path.Root(names.AttrRegion), &target)...) + if opts.response.Diagnostics.HasError() { + return } if target.IsNull() { - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) + if opts.response.Diagnostics.HasError() { + return } } } - - return diags } // dataSourceSetRegionInState set the value of the top-level `region` attribute in state after Read. @@ -110,9 +100,7 @@ func dataSourceSetRegionInState() dataSourceCRUDInterceptor { type ephemeralResourceInjectRegionAttributeInterceptor struct{} -func (r ephemeralResourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[ephemeral.SchemaRequest, ephemeral.SchemaResponse]) diag.Diagnostics { - var diags diag.Diagnostics - +func (r ephemeralResourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[ephemeral.SchemaRequest, ephemeral.SchemaResponse]) { switch response, when := opts.response, opts.when; when { case After: if _, ok := response.Schema.Attributes[names.AttrRegion]; !ok { @@ -124,8 +112,6 @@ func (r ephemeralResourceInjectRegionAttributeInterceptor) schema(ctx context.Co } } } - - return diags } // ephemeralResourceInjectRegionAttribute injects a top-level "region" attribute into an ephemeral resource's schema. @@ -137,20 +123,17 @@ type ephemeralResourceSetRegionInStateInterceptor struct { ephemeralResourceNoOpORCInterceptor } -func (r ephemeralResourceSetRegionInStateInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) diag.Diagnostics { +func (r ephemeralResourceSetRegionInStateInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) { c := opts.c - var diags diag.Diagnostics switch response, when := opts.response, opts.when; when { case After: // Set region in state after R. - diags.Append(response.Result.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.Result.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } // ephemeralResourceSetRegionInResult set the value of the top-level `region` attribute in the result after Open. @@ -162,20 +145,17 @@ type ephemeralResourceValidateRegionInterceptor struct { ephemeralResourceNoOpORCInterceptor } -func (r ephemeralResourceValidateRegionInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) diag.Diagnostics { +func (r ephemeralResourceValidateRegionInterceptor) open(ctx context.Context, opts interceptorOptions[ephemeral.OpenRequest, ephemeral.OpenResponse]) { c := opts.c - var diags diag.Diagnostics switch when := opts.when; when { case Before: // As ephemeral resources have no ModifyPlan functionality we validate the per-resource Region override value here. - diags.Append(validateInContextRegionInPartition(ctx, c)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(validateInContextRegionInPartition(ctx, c)...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } // ephemeralResourceValidateRegion validates that the value of the top-level `region` attribute is in the configured AWS partition. @@ -185,9 +165,7 @@ func ephemeralResourceValidateRegion() ephemeralResourceORCInterceptor { type resourceInjectRegionAttributeInterceptor struct{} -func (r resourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[resource.SchemaRequest, resource.SchemaResponse]) diag.Diagnostics { - var diags diag.Diagnostics - +func (r resourceInjectRegionAttributeInterceptor) schema(ctx context.Context, opts interceptorOptions[resource.SchemaRequest, resource.SchemaResponse]) { switch response, when := opts.response, opts.when; when { case After: if _, ok := response.Schema.Attributes[names.AttrRegion]; !ok { @@ -195,8 +173,6 @@ func (r resourceInjectRegionAttributeInterceptor) schema(ctx context.Context, op response.Schema.Attributes[names.AttrRegion] = resourceattribute.Region() } } - - return diags } // resourceInjectRegionAttribute injects a top-level "region" attribute into a resource's schema. @@ -206,19 +182,16 @@ func resourceInjectRegionAttribute() resourceSchemaInterceptor { type resourceValidateRegionInterceptor struct{} -func (r resourceValidateRegionInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) diag.Diagnostics { +func (r resourceValidateRegionInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) { c := opts.c - var diags diag.Diagnostics switch when := opts.when; when { case Before: - diags.Append(validateInContextRegionInPartition(ctx, c)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(validateInContextRegionInPartition(ctx, c)...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } // resourceValidateRegion validates that the value of the top-level `region` attribute is in the configured AWS partition. @@ -228,33 +201,30 @@ func resourceValidateRegion() resourceModifyPlanInterceptor { type resourceDefaultRegionInterceptor struct{} -func (r resourceDefaultRegionInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) diag.Diagnostics { +func (r resourceDefaultRegionInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) { c := opts.c - var diags diag.Diagnostics switch request, response, when := opts.request, opts.response, opts.when; when { case Before: // If the entire plan is null, the resource is planned for destruction. if request.Plan.Raw.IsNull() { - return diags + return } var target types.String - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrRegion), &target)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrRegion), &target)...) + if opts.response.Diagnostics.HasError() { + return } if target.IsNull() || target.IsUnknown() { // Set the region to the provider's configured region - diags.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrRegion), c.AwsConfig(ctx).Region)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrRegion), c.AwsConfig(ctx).Region)...) + if opts.response.Diagnostics.HasError() { + return } } } - - return diags } // resourceDefaultRegion sets the value of the top-level `region` attribute to the provider's configured Region if it is not set. @@ -264,48 +234,47 @@ func resourceDefaultRegion() resourceModifyPlanInterceptor { type resourceForceNewIfRegionChangesInterceptor struct{} -func (r resourceForceNewIfRegionChangesInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) diag.Diagnostics { +func (r resourceForceNewIfRegionChangesInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) { c := opts.c - var diags diag.Diagnostics switch request, response, when := opts.request, opts.response, opts.when; when { case Before: // If the entire plan is null, the resource is planned for destruction. if request.Plan.Raw.IsNull() { - return diags + return } // If the entire state is null, the resource is new. if request.State.Raw.IsNull() { - return diags + return } var configRegion types.String - diags.Append(request.Config.GetAttribute(ctx, path.Root(names.AttrRegion), &configRegion)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Config.GetAttribute(ctx, path.Root(names.AttrRegion), &configRegion)...) + if opts.response.Diagnostics.HasError() { + return } var planRegion types.String - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrRegion), &planRegion)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrRegion), &planRegion)...) + if opts.response.Diagnostics.HasError() { + return } var stateRegion types.String - diags.Append(request.State.GetAttribute(ctx, path.Root(names.AttrRegion), &stateRegion)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.State.GetAttribute(ctx, path.Root(names.AttrRegion), &stateRegion)...) + if opts.response.Diagnostics.HasError() { + return } if stateRegion.IsNull() { // Upgrade from pre-v6.0.0 provider and '-refresh=false' in effect. if configRegion.IsNull() { - return diags + return } if providerRegion := c.AwsConfig(ctx).Region; planRegion.ValueString() == providerRegion { - return diags + return } } @@ -313,8 +282,6 @@ func (r resourceForceNewIfRegionChangesInterceptor) modifyPlan(ctx context.Conte response.RequiresReplace = path.Paths{path.Root(names.AttrRegion)} } } - - return diags } // resourceForceNewIfRegionChanges forces resource replacement if the value of the top-level `region` attribute changes. @@ -326,20 +293,22 @@ type resourceSetRegionInStateInterceptor struct { resourceNoOpCRUDInterceptor } -func (r resourceSetRegionInStateInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) diag.Diagnostics { +func (r resourceSetRegionInStateInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) { c := opts.c - var diags diag.Diagnostics switch response, when := opts.response, opts.when; when { case After: + // Will occur on a refresh when the resource does not exist in AWS and needs to be recreated, e.g. "_disappears" tests. + if response.State.Raw.IsNull() { + return + } + // Set region in state after R. - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.Region(ctx))...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } // resourceSetRegionInState set the value of the top-level `region` attribute in state after Read. @@ -349,28 +318,25 @@ func resourceSetRegionInState() resourceCRUDInterceptor { type resourceImportRegionInterceptor struct{} -func (r resourceImportRegionInterceptor) importState(ctx context.Context, opts interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) diag.Diagnostics { +func (r resourceImportRegionInterceptor) importState(ctx context.Context, opts interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) { c := opts.c - var diags diag.Diagnostics switch request, response, when := opts.request, opts.response, opts.when; when { case Before: // Import ID optionally ends with "@". if matches := regexache.MustCompile(`^(.+)@([a-z]{2}(?:-[a-z]+)+-\d{1,2})$`).FindStringSubmatch(request.ID); len(matches) == 3 { request.ID = matches[1] - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), matches[2])...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), matches[2])...) + if opts.response.Diagnostics.HasError() { + return } } else { - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.AwsConfig(ctx).Region)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), c.AwsConfig(ctx).Region)...) + if opts.response.Diagnostics.HasError() { + return } } } - - return diags } // resourceImportRegion sets the value of the top-level `region` attribute during import. @@ -380,22 +346,18 @@ func resourceImportRegion() resourceImportStateInterceptor { type resourceImportRegionNoDefaultInterceptor struct{} -func (r resourceImportRegionNoDefaultInterceptor) importState(ctx context.Context, opts interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) diag.Diagnostics { - var diags diag.Diagnostics - +func (r resourceImportRegionNoDefaultInterceptor) importState(ctx context.Context, opts interceptorOptions[resource.ImportStateRequest, resource.ImportStateResponse]) { switch request, response, when := opts.request, opts.response, opts.when; when { case Before: // Import ID optionally ends with "@". if matches := regexache.MustCompile(`^(.+)@([a-z]{2}(?:-[a-z]+)+-\d{1,2})$`).FindStringSubmatch(request.ID); len(matches) == 3 { request.ID = matches[1] - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), matches[2])...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRegion), matches[2])...) + if opts.response.Diagnostics.HasError() { + return } } } - - return diags } // resourceImportRegionNoDefault sets the value of the top-level `region` attribute during import. diff --git a/internal/provider/framework/region_test.go b/internal/provider/framework/region_test.go new file mode 100644 index 000000000000..765c374e9222 --- /dev/null +++ b/internal/provider/framework/region_test.go @@ -0,0 +1,95 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package framework + +import ( + "context" + "testing" + + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-go/tftypes" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/provider/framework/resourceattribute" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestResourceSetRegionInStateInterceptor_Read(t *testing.T) { + t.Parallel() + + const name = "example" + + region := "a_region" + + ctx := context.Background() + client := mockClient{region: region} + icpt := resourceSetRegionInStateInterceptor{} + + s := schema.Schema{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{Required: true}, + names.AttrRegion: resourceattribute.Region(), + }, + } + + tests := map[string]struct { + startState tfsdk.State + expectSet bool + }{ + "when state is present then region is set": { + startState: stateFromSchema(ctx, s, map[string]string{"name": name}), + expectSet: true, + }, + "when state is null then it remains null": { + startState: tfsdk.State{ + Raw: tftypes.NewValue(s.Type().TerraformType(ctx), nil), + Schema: s, + }, + expectSet: false, + }, + } + + for tn, tc := range tests { + t.Run(tn, func(t *testing.T) { + t.Parallel() + + req := resource.ReadRequest{State: tc.startState} + resp := resource.ReadResponse{State: tc.startState} + + icpt.read(ctx, interceptorOptions[resource.ReadRequest, resource.ReadResponse]{ + c: client, + request: &req, + response: &resp, + when: After, + }) + if resp.Diagnostics.HasError() { + t.Fatalf("unexpected diags: %s", resp.Diagnostics) + } + + if tc.expectSet { + got := getStateAttributeValue(ctx, t, resp.State, path.Root("region")) + if got != region { + t.Errorf("expected region %q, got %q", region, got) + } + } else { + if !resp.State.Raw.IsNull() { + t.Errorf("expected State.Raw to stay null, got %#v", resp.State.Raw) + } + } + }) + } +} + +func getStateAttributeValue(ctx context.Context, t *testing.T, st tfsdk.State, p path.Path) string { + t.Helper() + + var v types.String + if diags := st.GetAttribute(ctx, p, &v); diags.HasError() { + t.Fatalf("unexpected error getting State attribute %q: %s", p, fwdiag.DiagnosticsError(diags)) + } + return v.ValueString() +} diff --git a/internal/provider/framework/tags_interceptor.go b/internal/provider/framework/tags_interceptor.go index 287968ffd171..93330f785de1 100644 --- a/internal/provider/framework/tags_interceptor.go +++ b/internal/provider/framework/tags_interceptor.go @@ -9,7 +9,6 @@ import ( "unique" "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" @@ -25,25 +24,24 @@ type tagsDataSourceInterceptor struct { interceptors.HTags } -func (r tagsDataSourceInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) diag.Diagnostics { +func (r tagsDataSourceInterceptor) read(ctx context.Context, opts interceptorOptions[datasource.ReadRequest, datasource.ReadResponse]) { c := opts.c - var diags diag.Diagnostics if !r.Enabled() { - return diags + return } sp, serviceName, resourceName, tagsInContext, ok := interceptors.InfoFromContext(ctx, c) if !ok { - return diags + return } switch request, response, when := opts.request, opts.response, opts.when; when { case Before: var configTags tftags.Map - diags.Append(request.Config.GetAttribute(ctx, path.Root(names.AttrTags), &configTags)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Config.GetAttribute(ctx, path.Root(names.AttrTags), &configTags)...) + if opts.response.Diagnostics.HasError() { + return } tags := tftags.New(ctx, configTags) @@ -53,8 +51,8 @@ func (r tagsDataSourceInterceptor) read(ctx context.Context, opts interceptorOpt if tagsInContext.TagsOut.IsNone() { if identifier := r.GetIdentifierFramework(ctx, response.State); identifier != "" { if err := r.ListTags(ctx, sp, c, identifier); err != nil { - diags.AddError(fmt.Sprintf("listing tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) - return diags + opts.response.Diagnostics.AddError(fmt.Sprintf("listing tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) + return } } } @@ -62,13 +60,11 @@ func (r tagsDataSourceInterceptor) read(ctx context.Context, opts interceptorOpt tags := tagsInContext.TagsOut.UnwrapOrDefault() // Remove any provider configured ignore_tags and system tags from those returned from the service API. stateTags := fwflex.FlattenFrameworkStringValueMapLegacy(ctx, tags.IgnoreSystem(sp.ServicePackageName()).IgnoreConfig(c.IgnoreTagsConfig(ctx)).Map()) - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTags), tftags.NewMapFromMapValue(stateTags))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTags), tftags.NewMapFromMapValue(stateTags))...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } func dataSourceTransparentTagging(servicePackageResourceTags unique.Handle[inttypes.ServicePackageResourceTags]) dataSourceCRUDInterceptor { @@ -83,25 +79,24 @@ type tagsResourceInterceptor struct { interceptors.HTags } -func (r tagsResourceInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) diag.Diagnostics { +func (r tagsResourceInterceptor) create(ctx context.Context, opts interceptorOptions[resource.CreateRequest, resource.CreateResponse]) { c := opts.c - var diags diag.Diagnostics if !r.Enabled() { - return diags + return } sp, _, _, tagsInContext, ok := interceptors.InfoFromContext(ctx, c) if !ok { - return diags + return } switch request, response, when := opts.request, opts.response, opts.when; when { case Before: var planTags tftags.Map - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) + if opts.response.Diagnostics.HasError() { + return } // Merge the resource's configured tags with any provider configured default_tags. @@ -114,33 +109,30 @@ func (r tagsResourceInterceptor) create(ctx context.Context, opts interceptorOpt // Remove any provider configured ignore_tags and system tags from those passed to the service API. // Computed tags_all include any provider configured default_tags. stateTagsAll := fwflex.FlattenFrameworkStringValueMapLegacy(ctx, tagsInContext.TagsIn.MustUnwrap().IgnoreSystem(sp.ServicePackageName()).IgnoreConfig(c.IgnoreTagsConfig(ctx)).Map()) - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.NewMapFromMapValue(stateTagsAll))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.NewMapFromMapValue(stateTagsAll))...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } -func (r tagsResourceInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) diag.Diagnostics { +func (r tagsResourceInterceptor) read(ctx context.Context, opts interceptorOptions[resource.ReadRequest, resource.ReadResponse]) { c := opts.c - var diags diag.Diagnostics if !r.Enabled() { - return diags + return } sp, serviceName, resourceName, tagsInContext, ok := interceptors.InfoFromContext(ctx, c) if !ok { - return diags + return } switch response, when := opts.response, opts.when; when { case After: // Will occur on a refresh when the resource does not exist in AWS and needs to be recreated, e.g. "_disappears" tests. if response.State.Raw.IsNull() { - return diags + return } // If the R handler didn't set tags, try and read them from the service API. @@ -149,9 +141,9 @@ func (r tagsResourceInterceptor) read(ctx context.Context, opts interceptorOptio // https://github.com/hashicorp/terraform-provider-aws/issues/31180 if identifier := r.GetIdentifierFramework(ctx, response.State); identifier != "" { if err := r.ListTags(ctx, sp, c, identifier); err != nil { - diags.AddError(fmt.Sprintf("listing tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) + opts.response.Diagnostics.AddError(fmt.Sprintf("listing tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) - return diags + return } } } @@ -163,44 +155,41 @@ func (r tagsResourceInterceptor) read(ctx context.Context, opts interceptorOptio response.State.GetAttribute(ctx, path.Root(names.AttrTags), &stateTags) // Remove any provider configured ignore_tags and system tags from those returned from the service API. // The resource's configured tags do not include any provider configured default_tags. - if v := apiTags.IgnoreSystem(sp.ServicePackageName()).IgnoreConfig(c.IgnoreTagsConfig(ctx)).ResolveDuplicatesFramework(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx), response, &diags).Map(); len(v) > 0 { + if v := apiTags.IgnoreSystem(sp.ServicePackageName()).IgnoreConfig(c.IgnoreTagsConfig(ctx)).ResolveDuplicatesFramework(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx), stateTags, &opts.response.Diagnostics).Map(); len(v) > 0 { stateTags = tftags.NewMapFromMapValue(fwflex.FlattenFrameworkStringValueMapLegacy(ctx, v)) } - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTags), &stateTags)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTags), &stateTags)...) + if opts.response.Diagnostics.HasError() { + return } // Computed tags_all do. stateTagsAll := fwflex.FlattenFrameworkStringValueMapLegacy(ctx, apiTags.IgnoreSystem(sp.ServicePackageName()).IgnoreConfig(c.IgnoreTagsConfig(ctx)).Map()) - diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.NewMapFromMapValue(stateTagsAll))...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.NewMapFromMapValue(stateTagsAll))...) + if opts.response.Diagnostics.HasError() { + return } } - - return diags } -func (r tagsResourceInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) diag.Diagnostics { +func (r tagsResourceInterceptor) update(ctx context.Context, opts interceptorOptions[resource.UpdateRequest, resource.UpdateResponse]) { c := opts.c - var diags diag.Diagnostics if !r.Enabled() { - return diags + return } sp, serviceName, resourceName, tagsInContext, ok := interceptors.InfoFromContext(ctx, c) if !ok { - return diags + return } switch request, when := opts.request, opts.when; when { case Before: var planTags tftags.Map - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) + if opts.response.Diagnostics.HasError() { + return } // Merge the resource's configured tags with any provider configured default_tags. @@ -210,13 +199,13 @@ func (r tagsResourceInterceptor) update(ctx context.Context, opts interceptorOpt tagsInContext.TagsIn = option.Some(tags) var oldTagsAll, newTagsAll tftags.Map - diags.Append(request.State.GetAttribute(ctx, path.Root(names.AttrTagsAll), &oldTagsAll)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.State.GetAttribute(ctx, path.Root(names.AttrTagsAll), &oldTagsAll)...) + if opts.response.Diagnostics.HasError() { + return } - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTagsAll), &newTagsAll)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTagsAll), &newTagsAll)...) + if opts.response.Diagnostics.HasError() { + return } if !newTagsAll.Equal(oldTagsAll) { @@ -224,49 +213,44 @@ func (r tagsResourceInterceptor) update(ctx context.Context, opts interceptorOpt // https://github.com/hashicorp/terraform-provider-aws/issues/31180 if identifier := r.GetIdentifierFramework(ctx, request.Plan); identifier != "" { if err := r.UpdateTags(ctx, sp, c, identifier, oldTagsAll, newTagsAll); err != nil { - diags.AddError(fmt.Sprintf("updating tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) + opts.response.Diagnostics.AddError(fmt.Sprintf("updating tags for %s %s (%s)", serviceName, resourceName, identifier), err.Error()) - return diags + return } } // TODO If the only change was to tags it would be nice to not call the resource's U handler. } } - - return diags } -func (r tagsResourceInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) diag.Diagnostics { +func (r tagsResourceInterceptor) modifyPlan(ctx context.Context, opts interceptorOptions[resource.ModifyPlanRequest, resource.ModifyPlanResponse]) { c := opts.c - var diags diag.Diagnostics switch request, response, when := opts.request, opts.response, opts.when; when { case Before: // If the entire plan is null, the resource is planned for destruction. if request.Plan.Raw.IsNull() { - return diags + return } // Calculate the new value for the `tags_all` attribute. var planTags tftags.Map - diags.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) - if diags.HasError() { - return diags + opts.response.Diagnostics.Append(request.Plan.GetAttribute(ctx, path.Root(names.AttrTags), &planTags)...) + if opts.response.Diagnostics.HasError() { + return } if planTags.IsWhollyKnown() { allTags := c.DefaultTagsConfig(ctx).MergeTags(tftags.New(ctx, planTags)).IgnoreConfig(c.IgnoreTagsConfig(ctx)) - diags.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrTagsAll), fwflex.FlattenFrameworkStringValueMapLegacy(ctx, allTags.Map()))...) + opts.response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrTagsAll), fwflex.FlattenFrameworkStringValueMapLegacy(ctx, allTags.Map()))...) } else { - diags.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.Unknown)...) + opts.response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root(names.AttrTagsAll), tftags.Unknown)...) } - if diags.HasError() { - return diags + if opts.response.Diagnostics.HasError() { + return } } - - return diags } func resourceTransparentTagging(servicePackageResourceTags unique.Handle[inttypes.ServicePackageResourceTags]) interface { diff --git a/internal/provider/framework/when_string_test.go b/internal/provider/framework/when_string_test.go new file mode 100644 index 000000000000..30a19a106a18 --- /dev/null +++ b/internal/provider/framework/when_string_test.go @@ -0,0 +1,39 @@ +// Code generated by "stringer -type=when -output=when_string_test.go"; DO NOT EDIT. + +package framework + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Before-1] + _ = x[After-2] + _ = x[OnError-4] + _ = x[Finally-8] +} + +const ( + _when_name_0 = "BeforeAfter" + _when_name_1 = "OnError" + _when_name_2 = "Finally" +) + +var ( + _when_index_0 = [...]uint8{0, 6, 11} +) + +func (i when) String() string { + switch { + case 1 <= i && i <= 2: + i -= 1 + return _when_name_0[_when_index_0[i]:_when_index_0[i+1]] + case i == 4: + return _when_name_1 + case i == 8: + return _when_name_2 + default: + return "when(" + strconv.FormatInt(int64(i), 10) + ")" + } +} diff --git a/internal/provider/framework/wrap.go b/internal/provider/framework/wrap.go index e6c17c236a4c..19b5c10034ee 100644 --- a/internal/provider/framework/wrap.go +++ b/internal/provider/framework/wrap.go @@ -11,59 +11,108 @@ import ( "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/logging" "github.com/hashicorp/terraform-provider-aws/internal/provider/framework/identity" "github.com/hashicorp/terraform-provider-aws/internal/provider/framework/importer" - "github.com/hashicorp/terraform-provider-aws/internal/types" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" + tfunique "github.com/hashicorp/terraform-provider-aws/internal/unique" + "github.com/hashicorp/terraform-provider-aws/names" ) // Implemented by (Config|Plan|State).GetAttribute(). type getAttributeFunc func(context.Context, path.Path, any) diag.Diagnostics -// contextFunc augments Context. -type contextFunc func(context.Context, getAttributeFunc, *conns.AWSClient) (context.Context, diag.Diagnostics) - -type wrappedDataSourceOptions struct { - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext contextFunc - interceptors interceptorInvocations - typeName string -} - // wrappedDataSource represents an interceptor dispatcher for a Plugin Framework data source. type wrappedDataSource struct { - inner datasource.DataSourceWithConfigure - meta *conns.AWSClient - opts wrappedDataSourceOptions + inner datasource.DataSourceWithConfigure + meta *conns.AWSClient + servicePackageName string + spec *inttypes.ServicePackageFrameworkDataSource + interceptors interceptorInvocations } -func newWrappedDataSource(inner datasource.DataSourceWithConfigure, opts wrappedDataSourceOptions) datasource.DataSourceWithConfigure { +func newWrappedDataSource(spec *inttypes.ServicePackageFrameworkDataSource, servicePackageName string) datasource.DataSourceWithConfigure { + var isRegionOverrideEnabled bool + if regionSpec := spec.Region; !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + var interceptors interceptorInvocations + + if isRegionOverrideEnabled { + v := spec.Region.Value() + + interceptors = append(interceptors, dataSourceInjectRegionAttribute()) + if v.IsValidateOverrideInPartition { + interceptors = append(interceptors, dataSourceValidateRegion()) + } + interceptors = append(interceptors, dataSourceSetRegionInState()) + } + + if !tfunique.IsHandleNil(spec.Tags) { + interceptors = append(interceptors, dataSourceTransparentTagging(spec.Tags)) + } + + inner, _ := spec.Factory(context.TODO()) + return &wrappedDataSource{ - inner: inner, - opts: opts, + inner: inner, + servicePackageName: servicePackageName, + spec: spec, + interceptors: interceptors, } } +// context is run on all wrapped methods before any interceptors. +func (w *wrappedDataSource) context(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { + var diags diag.Diagnostics + var overrideRegion string + + var isRegionOverrideEnabled bool + if regionSpec := w.spec.Region; !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + if isRegionOverrideEnabled && getAttribute != nil { + var target types.String + diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) + if diags.HasError() { + return ctx, diags + } + + overrideRegion = target.ValueString() + } + + ctx = conns.NewResourceContext(ctx, w.servicePackageName, w.spec.Name, overrideRegion) + if c != nil { + ctx = tftags.NewContext(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx)) + ctx = c.RegisterLogger(ctx) + ctx = fwflex.RegisterLogger(ctx) + } + + return ctx, diags +} + func (w *wrappedDataSource) Metadata(ctx context.Context, request datasource.MetadataRequest, response *datasource.MetadataResponse) { // This method does not call down to the inner data source. - response.TypeName = w.opts.typeName + response.TypeName = w.spec.TypeName } func (w *wrappedDataSource) Schema(ctx context.Context, request datasource.SchemaRequest, response *datasource.SchemaResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *datasource.SchemaRequest, response *datasource.SchemaResponse) diag.Diagnostics { - w.inner.Schema(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.dataSourceSchema(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.dataSourceSchema(), w.inner.Schema, dataSourceSchemaHasError, w.meta)(ctx, request, response) if response.Diagnostics.HasError() { return } @@ -72,26 +121,22 @@ func (w *wrappedDataSource) Schema(ctx context.Context, request datasource.Schem if v, ok := w.inner.(framework.DataSourceValidateModel); ok { response.Diagnostics.Append(v.ValidateModel(ctx, &response.Schema)...) if response.Diagnostics.HasError() { - response.Diagnostics.AddError("data source model validation error", w.opts.typeName) + response.Diagnostics.AddError("data source model validation error", w.spec.TypeName) return } } else { - response.Diagnostics.AddError("missing framework.DataSourceValidateModel", w.opts.typeName) + response.Diagnostics.AddError("missing framework.DataSourceValidateModel", w.spec.TypeName) } } func (w *wrappedDataSource) Read(ctx context.Context, request datasource.ReadRequest, response *datasource.ReadResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *datasource.ReadRequest, response *datasource.ReadResponse) diag.Diagnostics { - w.inner.Read(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.dataSourceRead(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.dataSourceRead(), w.inner.Read, dataSourceReadHasError, w.meta)(ctx, request, response) } func (w *wrappedDataSource) Configure(ctx context.Context, request datasource.ConfigureRequest, response *datasource.ConfigureResponse) { @@ -99,7 +144,7 @@ func (w *wrappedDataSource) Configure(ctx context.Context, request datasource.Co w.meta = v } - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -110,10 +155,10 @@ func (w *wrappedDataSource) Configure(ctx context.Context, request datasource.Co func (w *wrappedDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator { if v, ok := w.inner.(datasource.DataSourceWithConfigValidators); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) if diags.HasError() { tflog.Warn(ctx, "wrapping ConfigValidators", map[string]any{ - "data source": w.opts.typeName, + "data source": w.spec.TypeName, "bootstrapContext error": fwdiag.DiagnosticsString(diags), }) @@ -128,7 +173,7 @@ func (w *wrappedDataSource) ConfigValidators(ctx context.Context) []datasource.C func (w *wrappedDataSource) ValidateConfig(ctx context.Context, request datasource.ValidateConfigRequest, response *datasource.ValidateConfigResponse) { if v, ok := w.inner.(datasource.DataSourceWithValidateConfig); ok { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -138,69 +183,107 @@ func (w *wrappedDataSource) ValidateConfig(ctx context.Context, request datasour } } -type wrappedEphemeralResourceOptions struct { - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext contextFunc - interceptors interceptorInvocations - typeName string -} - // wrappedEphemeralResource represents an interceptor dispatcher for a Plugin Framework ephemeral resource. type wrappedEphemeralResource struct { - inner ephemeral.EphemeralResourceWithConfigure - meta *conns.AWSClient - opts wrappedEphemeralResourceOptions + inner ephemeral.EphemeralResourceWithConfigure + meta *conns.AWSClient + servicePackageName string + spec *inttypes.ServicePackageEphemeralResource + interceptors interceptorInvocations } -func newWrappedEphemeralResource(inner ephemeral.EphemeralResourceWithConfigure, opts wrappedEphemeralResourceOptions) ephemeral.EphemeralResourceWithConfigure { +func newWrappedEphemeralResource(spec *inttypes.ServicePackageEphemeralResource, servicePackageName string) ephemeral.EphemeralResourceWithConfigure { + var isRegionOverrideEnabled bool + if regionSpec := spec.Region; !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + var interceptors interceptorInvocations + + if isRegionOverrideEnabled { + v := spec.Region.Value() + + interceptors = append(interceptors, ephemeralResourceInjectRegionAttribute()) + if v.IsValidateOverrideInPartition { + interceptors = append(interceptors, ephemeralResourceValidateRegion()) + } + interceptors = append(interceptors, ephemeralResourceSetRegionInResult()) + } + + inner, _ := spec.Factory(context.TODO()) + return &wrappedEphemeralResource{ - inner: inner, - opts: opts, + inner: inner, + servicePackageName: servicePackageName, + spec: spec, + interceptors: interceptors, } } +// context is run on all wrapped methods before any interceptors. +func (w *wrappedEphemeralResource) context(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { + var diags diag.Diagnostics + var overrideRegion string + + var isRegionOverrideEnabled bool + if regionSpec := w.spec.Region; !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + if isRegionOverrideEnabled && getAttribute != nil { + var target types.String + diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) + if diags.HasError() { + return ctx, diags + } + + overrideRegion = target.ValueString() + } + + ctx = conns.NewResourceContext(ctx, w.servicePackageName, w.spec.Name, overrideRegion) + if c != nil { + ctx = c.RegisterLogger(ctx) + ctx = fwflex.RegisterLogger(ctx) + ctx = logging.MaskSensitiveValuesByKey(ctx, logging.HTTPKeyRequestBody, logging.HTTPKeyResponseBody) + } + + return ctx, diags +} + func (w *wrappedEphemeralResource) Metadata(ctx context.Context, request ephemeral.MetadataRequest, response *ephemeral.MetadataResponse) { // This method does not call down to the inner ephemeral resource. - response.TypeName = w.opts.typeName + response.TypeName = w.spec.TypeName } func (w *wrappedEphemeralResource) Schema(ctx context.Context, request ephemeral.SchemaRequest, response *ephemeral.SchemaResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *ephemeral.SchemaRequest, response *ephemeral.SchemaResponse) diag.Diagnostics { - w.inner.Schema(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.ephemeralResourceSchema(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.ephemeralResourceSchema(), w.inner.Schema, ephemeralSchemaHasError, w.meta)(ctx, request, response) // Validate the ephemeral resource's model against the schema. if v, ok := w.inner.(framework.EphemeralResourceValidateModel); ok { response.Diagnostics.Append(v.ValidateModel(ctx, &response.Schema)...) if response.Diagnostics.HasError() { - response.Diagnostics.AddError("ephemeral resource model validation error", w.opts.typeName) + response.Diagnostics.AddError("ephemeral resource model validation error", w.spec.TypeName) return } } else { - response.Diagnostics.AddError("missing framework.EphemeralResourceValidateModel", w.opts.typeName) + response.Diagnostics.AddError("missing framework.EphemeralResourceValidateModel", w.spec.TypeName) } } func (w *wrappedEphemeralResource) Open(ctx context.Context, request ephemeral.OpenRequest, response *ephemeral.OpenResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *ephemeral.OpenRequest, response *ephemeral.OpenResponse) diag.Diagnostics { - w.inner.Open(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.ephemeralResourceOpen(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.ephemeralResourceOpen(), w.inner.Open, ephemeralOpenHasError, w.meta)(ctx, request, response) } func (w *wrappedEphemeralResource) Configure(ctx context.Context, request ephemeral.ConfigureRequest, response *ephemeral.ConfigureResponse) { @@ -208,7 +291,7 @@ func (w *wrappedEphemeralResource) Configure(ctx context.Context, request epheme w.meta = v } - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -219,42 +302,34 @@ func (w *wrappedEphemeralResource) Configure(ctx context.Context, request epheme func (w *wrappedEphemeralResource) Renew(ctx context.Context, request ephemeral.RenewRequest, response *ephemeral.RenewResponse) { if v, ok := w.inner.(ephemeral.EphemeralResourceWithRenew); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *ephemeral.RenewRequest, response *ephemeral.RenewResponse) diag.Diagnostics { - v.Renew(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.ephemeralResourceRenew(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.ephemeralResourceRenew(), v.Renew, ephemeralRenewHasError, w.meta)(ctx, request, response) } } func (w *wrappedEphemeralResource) Close(ctx context.Context, request ephemeral.CloseRequest, response *ephemeral.CloseResponse) { if v, ok := w.inner.(ephemeral.EphemeralResourceWithClose); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *ephemeral.CloseRequest, response *ephemeral.CloseResponse) diag.Diagnostics { - v.Close(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.ephemeralResourceClose(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.ephemeralResourceClose(), v.Close, ephemeralCloseHasError, w.meta)(ctx, request, response) } } func (w *wrappedEphemeralResource) ConfigValidators(ctx context.Context) []ephemeral.ConfigValidator { if v, ok := w.inner.(ephemeral.EphemeralResourceWithConfigValidators); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) if diags.HasError() { tflog.Warn(ctx, "wrapping ConfigValidators", map[string]any{ - "ephemeral resource": w.opts.typeName, + "ephemeral resource": w.spec.TypeName, "bootstrapContext error": fwdiag.DiagnosticsString(diags), }) @@ -269,7 +344,7 @@ func (w *wrappedEphemeralResource) ConfigValidators(ctx context.Context) []ephem func (w *wrappedEphemeralResource) ValidateConfig(ctx context.Context, request ephemeral.ValidateConfigRequest, response *ephemeral.ValidateConfigResponse) { if v, ok := w.inner.(ephemeral.EphemeralResourceWithValidateConfig); ok { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -279,116 +354,163 @@ func (w *wrappedEphemeralResource) ValidateConfig(ctx context.Context, request e } } -type wrappedResourceOptions struct { - // bootstrapContext is run on all wrapped methods before any interceptors. - bootstrapContext contextFunc - interceptors interceptorInvocations - typeName string - identity types.Identity -} - // wrappedResource represents an interceptor dispatcher for a Plugin Framework resource. type wrappedResource struct { - inner resource.ResourceWithConfigure - meta *conns.AWSClient - opts wrappedResourceOptions + inner resource.ResourceWithConfigure + meta *conns.AWSClient + servicePackageName string + spec *inttypes.ServicePackageFrameworkResource + interceptors interceptorInvocations } -func newWrappedResource(inner resource.ResourceWithConfigure, opts wrappedResourceOptions) resource.ResourceWithConfigure { +func newWrappedResource(spec *inttypes.ServicePackageFrameworkResource, servicePackageName string) resource.ResourceWithConfigure { + var isRegionOverrideEnabled bool + if v := spec.Region; !tfunique.IsHandleNil(v) && v.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + var interceptors interceptorInvocations + + if isRegionOverrideEnabled { + v := spec.Region.Value() + + interceptors = append(interceptors, resourceInjectRegionAttribute()) + if v.IsValidateOverrideInPartition { + interceptors = append(interceptors, resourceValidateRegion()) + } + interceptors = append(interceptors, resourceDefaultRegion()) + interceptors = append(interceptors, resourceForceNewIfRegionChanges()) + interceptors = append(interceptors, resourceSetRegionInState()) + if spec.Identity.HasInherentRegion() { + interceptors = append(interceptors, resourceImportRegionNoDefault()) + } else { + interceptors = append(interceptors, resourceImportRegion()) + } + } + + if !tfunique.IsHandleNil(spec.Tags) { + interceptors = append(interceptors, resourceTransparentTagging(spec.Tags)) + } + + if len(spec.Identity.Attributes) > 0 { + interceptors = append(interceptors, newIdentityInterceptor(spec.Identity.Attributes)) + } + + inner, _ := spec.Factory(context.TODO()) + + if spec.Import.WrappedImport { + if v, ok := inner.(framework.ImportByIdentityer); ok { + v.SetIdentitySpec(spec.Identity, spec.Import) + } + // If the resource does not implement framework.ImportByIdentityer, + // it will be caught by `validateResourceSchemas`, so we can ignore it here. + } return &wrappedResource{ - inner: inner, - opts: opts, + inner: inner, + servicePackageName: servicePackageName, + spec: spec, + interceptors: interceptors, + } +} + +// context is run on all wrapped methods before any interceptors. +func (w *wrappedResource) context(ctx context.Context, getAttribute getAttributeFunc, c *conns.AWSClient) (context.Context, diag.Diagnostics) { + var diags diag.Diagnostics + var overrideRegion string + + var isRegionOverrideEnabled bool + if regionSpec := w.spec.Region; !tfunique.IsHandleNil(regionSpec) && regionSpec.Value().IsOverrideEnabled { + isRegionOverrideEnabled = true + } + + if isRegionOverrideEnabled && getAttribute != nil { + var target types.String + diags.Append(getAttribute(ctx, path.Root(names.AttrRegion), &target)...) + if diags.HasError() { + return ctx, diags + } + + overrideRegion = target.ValueString() + } + + ctx = conns.NewResourceContext(ctx, w.servicePackageName, w.spec.Name, overrideRegion) + if c != nil { + ctx = tftags.NewContext(ctx, c.DefaultTagsConfig(ctx), c.IgnoreTagsConfig(ctx)) + ctx = c.RegisterLogger(ctx) + ctx = fwflex.RegisterLogger(ctx) } + + return ctx, diags } func (w *wrappedResource) Metadata(ctx context.Context, request resource.MetadataRequest, response *resource.MetadataResponse) { // This method does not call down to the inner resource. - response.TypeName = w.opts.typeName + response.TypeName = w.spec.TypeName - if w.opts.identity.IsMutable { + if w.spec.Identity.IsMutable { response.ResourceBehavior.MutableIdentity = true } } func (w *wrappedResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *resource.SchemaRequest, response *resource.SchemaResponse) diag.Diagnostics { - w.inner.Schema(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceSchema(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceSchema(), w.inner.Schema, resourceSchemaHasError, w.meta)(ctx, request, response) // Validate the resource's model against the schema. if v, ok := w.inner.(framework.ResourceValidateModel); ok { response.Diagnostics.Append(v.ValidateModel(ctx, &response.Schema)...) if response.Diagnostics.HasError() { - response.Diagnostics.AddError("resource model validation error", w.opts.typeName) + response.Diagnostics.AddError("resource model validation error", w.spec.TypeName) return } - } else if w.opts.typeName != "aws_lexv2models_bot_version" { // Hacky yukkery caused by attribute of type map[string]Object. - response.Diagnostics.AddError("missing framework.ResourceValidateModel", w.opts.typeName) + } else if w.spec.TypeName != "aws_lexv2models_bot_version" { // Hacky yukkery caused by attribute of type map[string]Object. + response.Diagnostics.AddError("missing framework.ResourceValidateModel", w.spec.TypeName) } } func (w *wrappedResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Plan.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Plan.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *resource.CreateRequest, response *resource.CreateResponse) diag.Diagnostics { - w.inner.Create(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceCreate(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceCreate(), w.inner.Create, resourceCreateHasError, w.meta)(ctx, request, response) } func (w *wrappedResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.State.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.State.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *resource.ReadRequest, response *resource.ReadResponse) diag.Diagnostics { - w.inner.Read(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceRead(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceRead(), w.inner.Read, resourceReadHasError, w.meta)(ctx, request, response) } func (w *wrappedResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Plan.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Plan.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *resource.UpdateRequest, response *resource.UpdateResponse) diag.Diagnostics { - w.inner.Update(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceUpdate(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceUpdate(), w.inner.Update, resourceUpdateHasError, w.meta)(ctx, request, response) } func (w *wrappedResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.State.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.State.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } - f := func(ctx context.Context, request *resource.DeleteRequest, response *resource.DeleteResponse) diag.Diagnostics { - w.inner.Delete(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceDelete(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceDelete(), w.inner.Delete, resourceDeleteHasError, w.meta)(ctx, request, response) } func (w *wrappedResource) Configure(ctx context.Context, request resource.ConfigureRequest, response *resource.ConfigureResponse) { @@ -396,7 +518,7 @@ func (w *wrappedResource) Configure(ctx context.Context, request resource.Config w.meta = v } - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -407,18 +529,14 @@ func (w *wrappedResource) Configure(ctx context.Context, request resource.Config func (w *wrappedResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { if v, ok := w.inner.(resource.ResourceWithImportState); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } ctx = importer.Context(ctx, w.meta) - f := func(ctx context.Context, request *resource.ImportStateRequest, response *resource.ImportStateResponse) diag.Diagnostics { - v.ImportState(ctx, *request, response) - return response.Diagnostics - } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceImportState(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceImportState(), v.ImportState, resourceImportStateHasError, w.meta)(ctx, request, response) return } @@ -430,31 +548,27 @@ func (w *wrappedResource) ImportState(ctx context.Context, request resource.Impo } func (w *wrappedResource) ModifyPlan(ctx context.Context, request resource.ModifyPlanRequest, response *resource.ModifyPlanResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return } // We run ModifyPlan interceptors even if the resource has not defined a ModifyPlan method. - f := func(ctx context.Context, request *resource.ModifyPlanRequest, response *resource.ModifyPlanResponse) diag.Diagnostics { - return response.Diagnostics + f := func(ctx context.Context, request resource.ModifyPlanRequest, response *resource.ModifyPlanResponse) { } if v, ok := w.inner.(resource.ResourceWithModifyPlan); ok { - f = func(ctx context.Context, request *resource.ModifyPlanRequest, response *resource.ModifyPlanResponse) diag.Diagnostics { - v.ModifyPlan(ctx, *request, response) - return response.Diagnostics - } + f = v.ModifyPlan } - response.Diagnostics.Append(interceptedHandler(w.opts.interceptors.resourceModifyPlan(), f, w.meta)(ctx, &request, response)...) + interceptedHandler(w.interceptors.resourceModifyPlan(), f, resourceModifyPlanHasError, w.meta)(ctx, request, response) } func (w *wrappedResource) ConfigValidators(ctx context.Context) []resource.ConfigValidator { if v, ok := w.inner.(resource.ResourceWithConfigValidators); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) if diags.HasError() { tflog.Warn(ctx, "wrapping ConfigValidators", map[string]any{ - "resource": w.opts.typeName, + "resource": w.spec.TypeName, "bootstrapContext error": fwdiag.DiagnosticsString(diags), }) @@ -468,7 +582,7 @@ func (w *wrappedResource) ConfigValidators(ctx context.Context) []resource.Confi } func (w *wrappedResource) ValidateConfig(ctx context.Context, request resource.ValidateConfigRequest, response *resource.ValidateConfigResponse) { - ctx, diags := w.opts.bootstrapContext(ctx, request.Config.GetAttribute, w.meta) + ctx, diags := w.context(ctx, request.Config.GetAttribute, w.meta) response.Diagnostics.Append(diags...) if response.Diagnostics.HasError() { return @@ -481,10 +595,10 @@ func (w *wrappedResource) ValidateConfig(ctx context.Context, request resource.V func (w *wrappedResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader { if v, ok := w.inner.(resource.ResourceWithUpgradeState); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) if diags.HasError() { tflog.Warn(ctx, "wrapping UpgradeState", map[string]any{ - "resource": w.opts.typeName, + "resource": w.spec.TypeName, "bootstrapContext error": fwdiag.DiagnosticsString(diags), }) @@ -499,10 +613,10 @@ func (w *wrappedResource) UpgradeState(ctx context.Context) map[int64]resource.S func (w *wrappedResource) MoveState(ctx context.Context) []resource.StateMover { if v, ok := w.inner.(resource.ResourceWithMoveState); ok { - ctx, diags := w.opts.bootstrapContext(ctx, nil, w.meta) + ctx, diags := w.context(ctx, nil, w.meta) if diags.HasError() { tflog.Warn(ctx, "wrapping MoveState", map[string]any{ - "resource": w.opts.typeName, + "resource": w.spec.TypeName, "bootstrapContext error": fwdiag.DiagnosticsString(diags), }) @@ -516,7 +630,7 @@ func (w *wrappedResource) MoveState(ctx context.Context) []resource.StateMover { } func (w *wrappedResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, resp *resource.IdentitySchemaResponse) { - if len(w.opts.identity.Attributes) > 0 { - resp.IdentitySchema = identity.NewIdentitySchema(w.opts.identity) + if len(w.spec.Identity.Attributes) > 0 { + resp.IdentitySchema = identity.NewIdentitySchema(w.spec.Identity) } } diff --git a/internal/provider/sdkv2/intercept.go b/internal/provider/sdkv2/intercept.go index 7bd1bf537395..0dc5f957781d 100644 --- a/internal/provider/sdkv2/intercept.go +++ b/internal/provider/sdkv2/intercept.go @@ -6,6 +6,7 @@ package sdkv2 import ( "context" "errors" + "slices" "github.com/aws/aws-sdk-go-v2/aws" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -57,28 +58,18 @@ type interceptor1[D, E any] interface { run(context.Context, interceptorOptions[D]) E } -type interceptor2[D, R, E any] interface { - run(context.Context, interceptorOptions[D]) (R, E) -} - type ( // crudInterceptor is functionality invoked during a CRUD request lifecycle. crudInterceptor = interceptor1[schemaResourceData, diag.Diagnostics] // customizeDiffInterceptor is functionality invoked during a CustomizeDiff request lifecycle. customizeDiffInterceptor = interceptor1[*schema.ResourceDiff, error] // importInterceptor is functionality invoked during an Import request lifecycle. - importInterceptor = interceptor2[*schema.ResourceData, []*schema.ResourceData, error] + importInterceptor = interceptor1[*schema.ResourceData, error] ) type interceptorFunc1[D, E any] func(context.Context, interceptorOptions[D]) E -func (f interceptorFunc1[D, E]) run(ctx context.Context, opts interceptorOptions[D]) E { //nolint:unused // used via crudInterceptor/customizeDiffInterceptor - return f(ctx, opts) -} - -type interceptorFunc2[D, R, E any] func(context.Context, interceptorOptions[D]) (R, E) - -func (f interceptorFunc2[D, R, E]) run(ctx context.Context, opts interceptorOptions[D]) (R, E) { //nolint:unused // used via importInterceptor +func (f interceptorFunc1[D, E]) run(ctx context.Context, opts interceptorOptions[D]) E { //nolint:unused // used via crudInterceptor/customizeDiffInterceptor/importInterceptor return f(ctx, opts) } @@ -95,18 +86,15 @@ type typedInterceptorInvocation[D, E any] struct { interceptor interceptor1[D, E] } -type typedInterceptor2Invocation[D, R, E any] struct { - when when - why why - interceptor interceptor2[D, R, E] -} - type ( crudInterceptorInvocation = typedInterceptorInvocation[schemaResourceData, diag.Diagnostics] customizeDiffInterceptorInvocation = typedInterceptorInvocation[*schema.ResourceDiff, error] - importInterceptorInvocation = typedInterceptor2Invocation[*schema.ResourceData, []*schema.ResourceData, error] + importInterceptorInvocation = typedInterceptorInvocation[*schema.ResourceData, error] ) +// Only generate strings for use in tests +//go:generate stringer -type=when -output=when_string_test.go + // when represents the point in the request lifecycle that an interceptor is run. // Multiple values can be ORed together. type when uint16 @@ -148,19 +136,18 @@ func interceptedCRUDHandler[F ~func(context.Context, *schema.ResourceData, any) return nil } - return func(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + return func(ctx context.Context, rd *schema.ResourceData, meta any) diag.Diagnostics { var diags diag.Diagnostics - ctx, err := bootstrapContext(ctx, d.GetOk, meta) + ctx, err := bootstrapContext(ctx, rd.GetOk, meta) if err != nil { return sdkdiag.AppendFromErr(diags, err) } - // Before interceptors are run first to last. - forward := make([]crudInterceptorInvocation, 0) + var interceptors []crudInterceptorInvocation for _, v := range interceptorInvocations.why(why) { if interceptor, ok := v.interceptor.(crudInterceptor); ok { - forward = append(forward, crudInterceptorInvocation{ + interceptors = append(interceptors, crudInterceptorInvocation{ when: v.when, why: v.why, interceptor: interceptor, @@ -168,15 +155,16 @@ func interceptedCRUDHandler[F ~func(context.Context, *schema.ResourceData, any) } } - when := Before - for _, v := range forward { - if v.when&when != 0 { - opts := crudInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + opts := crudInterceptorOptions{ + c: meta.(awsClient), + d: rd, + why: why, + } + + // Before interceptors are run first to last. + opts.when = Before + for v := range slices.Values(interceptors) { + if v.when&opts.when != 0 { diags = append(diags, v.interceptor.run(ctx, opts)...) // Short circuit if any Before interceptor errors. @@ -186,36 +174,24 @@ func interceptedCRUDHandler[F ~func(context.Context, *schema.ResourceData, any) } } - // All other interceptors are run last to first. - reverse := tfslices.Reverse(forward) - diags = f(ctx, d, meta) + d := f(ctx, rd, meta) + diags = append(diags, d...) - if diags.HasError() { - when = OnError + // All other interceptors are run last to first. + if d.HasError() { + opts.when = OnError } else { - when = After + opts.when = After } - for _, v := range reverse { - if v.when&when != 0 { - opts := crudInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { diags = append(diags, v.interceptor.run(ctx, opts)...) } } - when = Finally - for _, v := range reverse { - if v.when&when != 0 { - opts := crudInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + opts.when = Finally + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { diags = append(diags, v.interceptor.run(ctx, opts)...) } } @@ -235,11 +211,10 @@ func interceptedCustomizeDiffHandler(bootstrapContext contextFunc, interceptorIn why := CustomizeDiff - // Before interceptors are run first to last. - forward := make([]customizeDiffInterceptorInvocation, 0) + var interceptors []customizeDiffInterceptorInvocation for _, v := range interceptorInvocations.why(why) { if interceptor, ok := v.interceptor.(customizeDiffInterceptor); ok { - forward = append(forward, customizeDiffInterceptorInvocation{ + interceptors = append(interceptors, customizeDiffInterceptorInvocation{ when: v.when, why: v.why, interceptor: interceptor, @@ -247,15 +222,16 @@ func interceptedCustomizeDiffHandler(bootstrapContext contextFunc, interceptorIn } } - when := Before - for _, v := range forward { - if v.when&when != 0 { - opts := customizeDiffInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + opts := customizeDiffInterceptorOptions{ + c: meta.(awsClient), + d: d, + why: why, + } + + // Before interceptors are run first to last. + opts.when = Before + for v := range slices.Values(interceptors) { + if v.when&opts.when != 0 { // Short circuit if any Before interceptor errors. if err := v.interceptor.run(ctx, opts); err != nil { return err @@ -263,41 +239,28 @@ func interceptedCustomizeDiffHandler(bootstrapContext contextFunc, interceptorIn } } - // All other interceptors are run last to first. - reverse := tfslices.Reverse(forward) var errs []error - when = After + opts.when = After if f != nil { if err := f(ctx, d, meta); err != nil { - when = OnError + opts.when = OnError errs = append(errs, err) } } - for _, v := range reverse { - if v.when&when != 0 { - opts := customizeDiffInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + // All other interceptors are run last to first. + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { if err := v.interceptor.run(ctx, opts); err != nil { errs = append(errs, err) } } } - when = Finally - for _, v := range reverse { - if v.when&when != 0 { - opts := customizeDiffInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + opts.when = Finally + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { if err := v.interceptor.run(ctx, opts); err != nil { errs = append(errs, err) } @@ -323,11 +286,10 @@ func interceptedImportHandler(bootstrapContext contextFunc, interceptorInvocatio why := Import - // Before interceptors are run first to last. - forward := make([]importInterceptorInvocation, 0) + var interceptors []importInterceptorInvocation for _, v := range interceptorInvocations.why(why) { if interceptor, ok := v.interceptor.(importInterceptor); ok { - forward = append(forward, importInterceptorInvocation{ + interceptors = append(interceptors, importInterceptorInvocation{ when: v.when, why: v.why, interceptor: interceptor, @@ -335,58 +297,46 @@ func interceptedImportHandler(bootstrapContext contextFunc, interceptorInvocatio } } - when := Before - for _, v := range forward { - if v.when&when != 0 { - opts := importInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } + opts := importInterceptorOptions{ + c: meta.(awsClient), + d: d, + why: why, + } + + // Before interceptors are run first to last. + opts.when = Before + for v := range slices.Values(interceptors) { + if v.when&opts.when != 0 { // Short circuit if any Before interceptor errors. - if _, err := v.interceptor.run(ctx, opts); err != nil { + if err := v.interceptor.run(ctx, opts); err != nil { return nil, err } } } - // All other interceptors are run last to first. - reverse := tfslices.Reverse(forward) var errs []error r, err := f(ctx, d, meta) if err != nil { - when = OnError + opts.when = OnError errs = append(errs, err) } else { - when = After + opts.when = After } - for _, v := range reverse { - if v.when&when != 0 { - opts := importInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } - if _, err := v.interceptor.run(ctx, opts); err != nil { + // All other interceptors are run last to first. + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { + if err := v.interceptor.run(ctx, opts); err != nil { errs = append(errs, err) } } } - when = Finally - for _, v := range reverse { - if v.when&when != 0 { - opts := importInterceptorOptions{ - c: meta.(*conns.AWSClient), - d: d, - when: when, - why: why, - } - if _, err := v.interceptor.run(ctx, opts); err != nil { + opts.when = Finally + for v := range tfslices.BackwardValues(interceptors) { + if v.when&opts.when != 0 { + if err := v.interceptor.run(ctx, opts); err != nil { errs = append(errs, err) } } diff --git a/internal/provider/sdkv2/intercept_test.go b/internal/provider/sdkv2/intercept_test.go index e28139757e42..25f80fcee76c 100644 --- a/internal/provider/sdkv2/intercept_test.go +++ b/internal/provider/sdkv2/intercept_test.go @@ -5,11 +5,13 @@ package sdkv2 import ( "context" + "errors" "testing" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/errs" ) type ( @@ -59,46 +61,669 @@ func TestInterceptorsWhy(t *testing.T) { } } -func TestInterceptedHandler(t *testing.T) { +func TestInterceptedCRUDHandler(t *testing.T) { t.Parallel() - var interceptors interceptorInvocations + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } - interceptors = append(interceptors, interceptorInvocation{ - when: Before, - why: Create, - interceptor: crudInterceptorFunc(func(ctx context.Context, opts crudInterceptorOptions) diag.Diagnostics { - var diags diag.Diagnostics - return diags - }), - }) - interceptors = append(interceptors, interceptorInvocation{ - when: After, - why: Delete, - interceptor: crudInterceptorFunc(func(ctx context.Context, opts crudInterceptorOptions) diag.Diagnostics { - var diags diag.Diagnostics - return diags - }), - }) - interceptors = append(interceptors, interceptorInvocation{ - when: Before, - why: Create, - interceptor: crudInterceptorFunc(func(ctx context.Context, opts crudInterceptorOptions) diag.Diagnostics { - var diags diag.Diagnostics - return diags - }), - }) + contextFunc := func(ctx context.Context, _ getAttributeFunc, meta any) (context.Context, error) { + return ctx, nil + } + + testcases := map[string]struct { + firstInterceptorDiags map[when]diag.Diagnostics + secondInterceptorDiags map[when]diag.Diagnostics + innerFuncDiags diag.Diagnostics + expectedFirstCalls []when + expectedSecondCalls []when + expectedInnerCalls int + expectedDiags diag.Diagnostics + }{ + "First has Before error": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewErrorDiagnostic("First interceptor Before error", "An error occurred in the first interceptor Before handler"), + }, + }, + expectedFirstCalls: []when{Before}, + expectedInnerCalls: 0, + expectedDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("First interceptor Before error", "An error occurred in the first interceptor Before handler"), + }, + }, + + "Second has Before error": { + secondInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }, + expectedFirstCalls: []when{Before}, + expectedSecondCalls: []when{Before}, + expectedInnerCalls: 0, + expectedDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }, + + "First has Before warning": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }, + + "Second has Before warning": { + secondInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + }, + + "First has Before warning Second has Before error": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }, + secondInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }, + expectedFirstCalls: []when{Before}, + expectedSecondCalls: []when{Before}, + expectedInnerCalls: 0, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + errs.NewErrorDiagnostic("Second interceptor Before error", "An error occurred in the second interceptor Before handler"), + }, + }, + + "Inner has error": { + innerFuncDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + }, + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + }, + }, + + "Inner has warning": { + innerFuncDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + }, + }, - var read schema.ReadContextFunc = func(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { - var diags diag.Diagnostics - return sdkdiag.AppendErrorf(diags, "read error") + "Inner has error First has Before warning": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + }, + innerFuncDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + }, + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + }, + }, + + "All have warnings": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + After: { + errs.NewWarningDiagnostic("First interceptor After warning", "A warning occurred in the first interceptor After handler"), + }, + Finally: { + errs.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }, + secondInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + After: { + errs.NewWarningDiagnostic("Second interceptor After warning", "A warning occurred in the second interceptor After handler"), + }, + Finally: { + errs.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + }, + }, + innerFuncDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + errs.NewWarningDiagnostic("Inner function warning", "A warning occurred in the inner function"), + errs.NewWarningDiagnostic("Second interceptor After warning", "A warning occurred in the second interceptor After handler"), + errs.NewWarningDiagnostic("First interceptor After warning", "A warning occurred in the first interceptor After handler"), + errs.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + errs.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }, + + "Inner has error Handlers have warnings": { + firstInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + }, + OnError: { + errs.NewWarningDiagnostic("First interceptor OnError warning", "A warning occurred in the first interceptor OnError handler"), + }, + Finally: { + errs.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }, + secondInterceptorDiags: map[when]diag.Diagnostics{ + Before: { + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + }, + OnError: { + errs.NewWarningDiagnostic("Second interceptor OnError warning", "A warning occurred in the second interceptor OnError handler"), + }, + Finally: { + errs.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + }, + }, + innerFuncDiags: diag.Diagnostics{ + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + }, + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedDiags: diag.Diagnostics{ + errs.NewWarningDiagnostic("First interceptor Before warning", "A warning occurred in the first interceptor Before handler"), + errs.NewWarningDiagnostic("Second interceptor Before warning", "A warning occurred in the second interceptor Before handler"), + errs.NewErrorDiagnostic("Inner function error", "An error occurred in the inner function"), + errs.NewWarningDiagnostic("Second interceptor OnError warning", "A warning occurred in the second interceptor OnError handler"), + errs.NewWarningDiagnostic("First interceptor OnError warning", "A warning occurred in the first interceptor OnError handler"), + errs.NewWarningDiagnostic("Second interceptor Finally warning", "A warning occurred in the second interceptor Finally handler"), + errs.NewWarningDiagnostic("First interceptor Finally warning", "A warning occurred in the first interceptor Finally handler"), + }, + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + t.Parallel() + + first := newMockCRUDInterceptor(tc.firstInterceptorDiags) + second := newMockCRUDInterceptor(tc.secondInterceptorDiags) + interceptors := append( + first.Invocations(), + second.Invocations()..., + ) + + f := newMockInnerCRUDFunc(tc.innerFuncDiags) + + handler := interceptedCRUDHandler(contextFunc, interceptors, f.Call, Create) + + ctx := t.Context() + diags := handler(ctx, nil, client) + + if diff := cmp.Diff(diags, tc.expectedDiags); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if diff := cmp.Diff(first.called, tc.expectedFirstCalls); diff != "" { + t.Errorf("unexpected first interceptor calls difference: %s", diff) + } + if diff := cmp.Diff(second.called, tc.expectedSecondCalls); diff != "" { + t.Errorf("unexpected second interceptor calls difference: %s", diff) + } + if tc.expectedInnerCalls == 0 { + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } + } else { + if f.count != tc.expectedInnerCalls { + t.Errorf("expected inner function to be called %d times, got %d", tc.expectedInnerCalls, f.count) + } + } + }) } - bootstrapContext := func(ctx context.Context, _ getAttributeFunc, meta any) (context.Context, error) { +} + +type mockCRUDInterceptor struct { + diags map[when]diag.Diagnostics + called []when +} + +func newMockCRUDInterceptor(diags map[when]diag.Diagnostics) *mockCRUDInterceptor { + if diags == nil { + diags = make(map[when]diag.Diagnostics) + } + return &mockCRUDInterceptor{ + diags: diags, + } +} + +func (m *mockCRUDInterceptor) Invocations() interceptorInvocations { + return interceptorInvocations{ + { + why: AllCRUDOps, + when: Before | After | OnError | Finally, + interceptor: m, + }, + } +} + +func (m *mockCRUDInterceptor) run(_ context.Context, opts crudInterceptorOptions) diag.Diagnostics { + m.called = append(m.called, opts.when) + return m.diags[opts.when] +} + +type mockInnerCRUDFunc struct { + diags diag.Diagnostics + count int +} + +func newMockInnerCRUDFunc(diags diag.Diagnostics) mockInnerCRUDFunc { + return mockInnerCRUDFunc{ + diags: diags, + } +} + +func (m *mockInnerCRUDFunc) Call(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + m.count++ + return m.diags +} + +func TestInterceptedCustomizeDiffHandler(t *testing.T) { + t.Parallel() + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + contextFunc := func(ctx context.Context, _ getAttributeFunc, meta any) (context.Context, error) { return ctx, nil } - diags := interceptedCRUDHandler(bootstrapContext, interceptors, read, Read)(context.Background(), nil, 42) - if got, want := len(diags), 1; got != want { - t.Errorf("length of diags = %v, want %v", got, want) + testcases := map[string]struct { + firstInterceptorErrors map[when]error + secondInterceptorErrors map[when]error + innerFuncError error + expectedFirstCalls []when + expectedSecondCalls []when + expectedInnerCalls int + expectedError error + }{ + "First has Before error": { + firstInterceptorErrors: map[when]error{ + Before: errors.New("First interceptor Before error"), + }, + expectedFirstCalls: []when{Before}, + expectedInnerCalls: 0, + expectedError: errors.New("First interceptor Before error"), + }, + + "Second has Before error": { + secondInterceptorErrors: map[when]error{ + Before: errors.New("Second interceptor Before error"), + }, + expectedFirstCalls: []when{Before}, + expectedSecondCalls: []when{Before}, + expectedInnerCalls: 0, + expectedError: errors.New("Second interceptor Before error"), + }, + + "Inner has error": { + innerFuncError: errors.New("Inner function error"), + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Inner function error"), + ), + }, + + "All have errors": { + firstInterceptorErrors: map[when]error{ + OnError: errors.New("First interceptor OnError error"), + Finally: errors.New("First interceptor Finally error"), + }, + secondInterceptorErrors: map[when]error{ + OnError: errors.New("Second interceptor OnError error"), + Finally: errors.New("Second interceptor Finally error"), + }, + innerFuncError: errors.New("Inner function error"), + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Inner function error"), + errors.New("Second interceptor OnError error"), + errors.New("First interceptor OnError error"), + errors.New("Second interceptor Finally error"), + errors.New("First interceptor Finally error"), + ), + }, + + "Handlers have errors": { + firstInterceptorErrors: map[when]error{ + After: errors.New("First interceptor After error"), + Finally: errors.New("First interceptor Finally error"), + }, + secondInterceptorErrors: map[when]error{ + After: errors.New("Second interceptor After error"), + Finally: errors.New("Second interceptor Finally error"), + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Second interceptor After error"), + errors.New("First interceptor After error"), + errors.New("Second interceptor Finally error"), + errors.New("First interceptor Finally error"), + ), + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + t.Parallel() + + first := newMockCustomizeDiffInterceptor(tc.firstInterceptorErrors) + second := newMockCustomizeDiffInterceptor(tc.secondInterceptorErrors) + interceptors := append( + first.Invocations(), + second.Invocations()..., + ) + + f := newMockInnerCustomizeDiffFunc(tc.innerFuncError) + + handler := interceptedCustomizeDiffHandler(contextFunc, interceptors, f.Call) + + ctx := t.Context() + err := handler(ctx, nil, client) + + if diff := cmp.Diff(err, tc.expectedError, cmp.Comparer(func(x, y error) bool { + return x.Error() == y.Error() + })); diff != "" { + t.Errorf("unexpected error difference: %s", diff) + } + + if diff := cmp.Diff(first.called, tc.expectedFirstCalls); diff != "" { + t.Errorf("unexpected first interceptor calls difference: %s", diff) + } + if diff := cmp.Diff(second.called, tc.expectedSecondCalls); diff != "" { + t.Errorf("unexpected second interceptor calls difference: %s", diff) + } + if tc.expectedInnerCalls == 0 { + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } + } else { + if f.count != tc.expectedInnerCalls { + t.Errorf("expected inner function to be called %d times, got %d", tc.expectedInnerCalls, f.count) + } + } + }) } } + +type mockCustomizeDiffInterceptor struct { + errors map[when]error + called []when +} + +func newMockCustomizeDiffInterceptor(errors map[when]error) *mockCustomizeDiffInterceptor { + if errors == nil { + errors = make(map[when]error) + } + return &mockCustomizeDiffInterceptor{ + errors: errors, + } +} + +func (m *mockCustomizeDiffInterceptor) Invocations() interceptorInvocations { + return interceptorInvocations{ + { + why: CustomizeDiff, + when: Before | After | OnError | Finally, + interceptor: m, + }, + } +} + +func (m *mockCustomizeDiffInterceptor) run(_ context.Context, opts customizeDiffInterceptorOptions) error { + m.called = append(m.called, opts.when) + return m.errors[opts.when] +} + +type mockInnerCustomizeDiffFunc struct { + err error + count int +} + +func newMockInnerCustomizeDiffFunc(err error) mockInnerCustomizeDiffFunc { + return mockInnerCustomizeDiffFunc{ + err: err, + } +} + +func (m *mockInnerCustomizeDiffFunc) Call(ctx context.Context, d *schema.ResourceDiff, meta any) error { + m.count++ + return m.err +} + +func TestInterceptedImportHandler(t *testing.T) { + t.Parallel() + + client := mockClient{ + accountID: "123456789012", + region: "us-west-2", //lintignore:AWSAT003 + } + + contextFunc := func(ctx context.Context, _ getAttributeFunc, meta any) (context.Context, error) { + return ctx, nil + } + + testcases := map[string]struct { + firstInterceptorErrors map[when]error + secondInterceptorErrors map[when]error + innerFuncError error + expectedFirstCalls []when + expectedSecondCalls []when + expectedInnerCalls int + expectedError error + }{ + "First has Before error": { + firstInterceptorErrors: map[when]error{ + Before: errors.New("First interceptor Before error"), + }, + expectedFirstCalls: []when{Before}, + expectedInnerCalls: 0, + expectedError: errors.New("First interceptor Before error"), + }, + + "Second has Before error": { + secondInterceptorErrors: map[when]error{ + Before: errors.New("Second interceptor Before error"), + }, + expectedFirstCalls: []when{Before}, + expectedSecondCalls: []when{Before}, + expectedInnerCalls: 0, + expectedError: errors.New("Second interceptor Before error"), + }, + + "Inner has error": { + innerFuncError: errors.New("Inner function error"), + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Inner function error"), + ), + }, + + "All have errors": { + firstInterceptorErrors: map[when]error{ + OnError: errors.New("First interceptor OnError error"), + Finally: errors.New("First interceptor Finally error"), + }, + secondInterceptorErrors: map[when]error{ + OnError: errors.New("Second interceptor OnError error"), + Finally: errors.New("Second interceptor Finally error"), + }, + innerFuncError: errors.New("Inner function error"), + expectedFirstCalls: []when{Before, OnError, Finally}, + expectedSecondCalls: []when{Before, OnError, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Inner function error"), + errors.New("Second interceptor OnError error"), + errors.New("First interceptor OnError error"), + errors.New("Second interceptor Finally error"), + errors.New("First interceptor Finally error"), + ), + }, + + "Handlers have errors": { + firstInterceptorErrors: map[when]error{ + After: errors.New("First interceptor After error"), + Finally: errors.New("First interceptor Finally error"), + }, + secondInterceptorErrors: map[when]error{ + After: errors.New("Second interceptor After error"), + Finally: errors.New("Second interceptor Finally error"), + }, + expectedFirstCalls: []when{Before, After, Finally}, + expectedSecondCalls: []when{Before, After, Finally}, + expectedInnerCalls: 1, + expectedError: errors.Join( + errors.New("Second interceptor After error"), + errors.New("First interceptor After error"), + errors.New("Second interceptor Finally error"), + errors.New("First interceptor Finally error"), + ), + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + t.Parallel() + + first := newMockImportInterceptor(tc.firstInterceptorErrors) + second := newMockImportInterceptor(tc.secondInterceptorErrors) + interceptors := append( + first.Invocations(), + second.Invocations()..., + ) + + f := newMockInnerImportFunc(tc.innerFuncError) + + handler := interceptedImportHandler(contextFunc, interceptors, f.Call) + + ctx := t.Context() + _, err := handler(ctx, nil, client) + + if diff := cmp.Diff(err, tc.expectedError, cmp.Comparer(func(x, y error) bool { + return x.Error() == y.Error() + })); diff != "" { + t.Errorf("unexpected error difference: %s", diff) + } + + if diff := cmp.Diff(first.called, tc.expectedFirstCalls); diff != "" { + t.Errorf("unexpected first interceptor calls difference: %s", diff) + } + if diff := cmp.Diff(second.called, tc.expectedSecondCalls); diff != "" { + t.Errorf("unexpected second interceptor calls difference: %s", diff) + } + if tc.expectedInnerCalls == 0 { + if f.count != 0 { + t.Errorf("expected inner function to not be called, got %d", f.count) + } + } else { + if f.count != tc.expectedInnerCalls { + t.Errorf("expected inner function to be called %d times, got %d", tc.expectedInnerCalls, f.count) + } + } + }) + } +} + +type mockImportInterceptor struct { + errors map[when]error + called []when +} + +func newMockImportInterceptor(errors map[when]error) *mockImportInterceptor { + if errors == nil { + errors = make(map[when]error) + } + return &mockImportInterceptor{ + errors: errors, + } +} + +func (m *mockImportInterceptor) Invocations() interceptorInvocations { + return interceptorInvocations{ + { + why: Import, + when: Before | After | OnError | Finally, + interceptor: m, + }, + } +} + +func (m *mockImportInterceptor) run(_ context.Context, opts importInterceptorOptions) error { + m.called = append(m.called, opts.when) + return m.errors[opts.when] +} + +type mockInnerImportFunc struct { + err error + count int +} + +func newMockInnerImportFunc(err error) mockInnerImportFunc { + return mockInnerImportFunc{ + err: err, + } +} + +func (m *mockInnerImportFunc) Call(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) { + m.count++ + return nil, m.err +} diff --git a/internal/provider/sdkv2/provider_gen.go b/internal/provider/sdkv2/provider_gen.go index b4e5810e444c..80f5ccb2a225 100644 --- a/internal/provider/sdkv2/provider_gen.go +++ b/internal/provider/sdkv2/provider_gen.go @@ -267,6 +267,14 @@ func endpointsSchema() *schema.Schema { Description: "Use this to override the default service endpoint URL", }, + // bedrockagentcore + + "bedrockagentcore": { + Type: schema.TypeString, + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // billing "billing": { @@ -1565,6 +1573,14 @@ func endpointsSchema() *schema.Schema { Description: "Use this to override the default service endpoint URL", }, + // odb + + "odb": { + Type: schema.TypeString, + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // opensearch "opensearch": { @@ -1919,6 +1935,14 @@ func endpointsSchema() *schema.Schema { Description: "Use this to override the default service endpoint URL", }, + // s3vectors + + "s3vectors": { + Type: schema.TypeString, + Optional: true, + Description: "Use this to override the default service endpoint URL", + }, + // sagemaker "sagemaker": { diff --git a/internal/provider/sdkv2/region.go b/internal/provider/sdkv2/region.go index ab61f7d105a8..9c92055ebaff 100644 --- a/internal/provider/sdkv2/region.go +++ b/internal/provider/sdkv2/region.go @@ -78,6 +78,11 @@ func setRegionInState() crudInterceptor { // Set region in state after R. switch why { case Read: + // Will occur on a refresh when the resource does not exist in AWS and needs to be recreated, e.g. "_disappears" tests. + if d.Id() == "" { + return diags + } + if err := d.Set(names.AttrRegion, c.Region(ctx)); err != nil { return sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrRegion, err) } @@ -113,7 +118,7 @@ func forceNewIfRegionChanges() customizeDiffInterceptor { } func importRegion() importInterceptor { - return interceptorFunc2[*schema.ResourceData, []*schema.ResourceData, error](func(ctx context.Context, opts importInterceptorOptions) ([]*schema.ResourceData, error) { + return interceptorFunc1[*schema.ResourceData, error](func(ctx context.Context, opts importInterceptorOptions) error { c, d := opts.c, opts.d switch when, why := opts.when, opts.why; when { @@ -130,7 +135,7 @@ func importRegion() importInterceptor { } } - return []*schema.ResourceData{d}, nil + return nil }) } @@ -144,7 +149,7 @@ func resourceImportRegion() interceptorInvocation { // importRegionNoDefault does not provide a default value for `region`. This should be used when the import ID is or contains a region. func importRegionNoDefault() importInterceptor { - return interceptorFunc2[*schema.ResourceData, []*schema.ResourceData, error](func(ctx context.Context, opts importInterceptorOptions) ([]*schema.ResourceData, error) { + return interceptorFunc1[*schema.ResourceData, error](func(ctx context.Context, opts importInterceptorOptions) error { d := opts.d switch when, why := opts.when, opts.why; when { @@ -159,7 +164,7 @@ func importRegionNoDefault() importInterceptor { } } - return []*schema.ResourceData{d}, nil + return nil }) } diff --git a/internal/provider/sdkv2/service_packages_gen.go b/internal/provider/sdkv2/service_packages_gen.go index fa6119d49328..a62b3b8dd0d3 100644 --- a/internal/provider/sdkv2/service_packages_gen.go +++ b/internal/provider/sdkv2/service_packages_gen.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/bcmdataexports" "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" + "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore" "github.com/hashicorp/terraform-provider-aws/internal/service/billing" "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" "github.com/hashicorp/terraform-provider-aws/internal/service/ce" @@ -175,6 +176,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" "github.com/hashicorp/terraform-provider-aws/internal/service/notificationscontacts" "github.com/hashicorp/terraform-provider-aws/internal/service/oam" + "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" @@ -214,6 +216,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" "github.com/hashicorp/terraform-provider-aws/internal/service/s3outposts" "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" + "github.com/hashicorp/terraform-provider-aws/internal/service/s3vectors" "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" "github.com/hashicorp/terraform-provider-aws/internal/service/scheduler" "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" @@ -290,6 +293,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { bcmdataexports.ServicePackage(ctx), bedrock.ServicePackage(ctx), bedrockagent.ServicePackage(ctx), + bedrockagentcore.ServicePackage(ctx), billing.ServicePackage(ctx), budgets.ServicePackage(ctx), ce.ServicePackage(ctx), @@ -430,6 +434,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { notifications.ServicePackage(ctx), notificationscontacts.ServicePackage(ctx), oam.ServicePackage(ctx), + odb.ServicePackage(ctx), opensearch.ServicePackage(ctx), opensearchserverless.ServicePackage(ctx), organizations.ServicePackage(ctx), @@ -469,6 +474,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { s3control.ServicePackage(ctx), s3outposts.ServicePackage(ctx), s3tables.ServicePackage(ctx), + s3vectors.ServicePackage(ctx), sagemaker.ServicePackage(ctx), scheduler.ServicePackage(ctx), schemas.ServicePackage(ctx), diff --git a/internal/provider/sdkv2/when_string_test.go b/internal/provider/sdkv2/when_string_test.go new file mode 100644 index 000000000000..14224a38f3ac --- /dev/null +++ b/internal/provider/sdkv2/when_string_test.go @@ -0,0 +1,39 @@ +// Code generated by "stringer -type=when -output=when_string_test.go"; DO NOT EDIT. + +package sdkv2 + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Before-1] + _ = x[After-2] + _ = x[OnError-4] + _ = x[Finally-8] +} + +const ( + _when_name_0 = "BeforeAfter" + _when_name_1 = "OnError" + _when_name_2 = "Finally" +) + +var ( + _when_index_0 = [...]uint8{0, 6, 11} +) + +func (i when) String() string { + switch { + case 1 <= i && i <= 2: + i -= 1 + return _when_name_0[_when_index_0[i]:_when_index_0[i+1]] + case i == 4: + return _when_name_1 + case i == 8: + return _when_name_2 + default: + return "when(" + strconv.FormatInt(int64(i), 10) + ")" + } +} diff --git a/internal/retry/state.go b/internal/retry/state.go index cf9f0ddceb9f..87bf3884f2ca 100644 --- a/internal/retry/state.go +++ b/internal/retry/state.go @@ -78,13 +78,13 @@ func (conf *StateChangeConfOf[T, S]) WaitForStateContext(ctx context.Context) (T conf.ContinuousTargetOccurence = 1 } - // Set a default DelayFunc using the StateChangeConf values - delayFunc := backoff.SDKv2HelperRetryCompatibleDelay(conf.Delay, conf.PollInterval, conf.MinTimeout) + // Set a default Delay using the StateChangeConf values + delay := backoff.SDKv2HelperRetryCompatibleDelay(conf.Delay, conf.PollInterval, conf.MinTimeout) - // When VCR testing in replay mode, override the default DelayFunc + // When VCR testing in replay mode, override the default Delay if inContext, ok := conns.FromContext(ctx); ok && inContext.VCREnabled() { if mode, _ := vcr.Mode(); mode == recorder.ModeReplayOnly { - delayFunc = backoff.ZeroDelay + delay = backoff.ZeroDelay } } @@ -95,7 +95,7 @@ func (conf *StateChangeConfOf[T, S]) WaitForStateContext(ctx context.Context) (T notFoundTick, targetOccurence int l *backoff.Loop ) - for l = backoff.NewLoopWithOptions(conf.Timeout, backoff.WithDelay(delayFunc)); l.Continue(ctx); { + for l = backoff.NewLoopWithOptions(conf.Timeout, backoff.WithDelay(delay)); l.Continue(ctx); { t, currentState, err = conf.refreshWithTimeout(ctx, l.Remaining()) if errors.Is(err, context.DeadlineExceeded) { @@ -151,6 +151,12 @@ func (conf *StateChangeConfOf[T, S]) WaitForStateContext(ctx context.Context) (T ExpectedState: tfslices.Strings(conf.Target), } } + + // Wait between refreshes using exponential backoff, except when + // waiting for the target state to reoccur. + if v, ok := delay.(backoff.DelayWithSetIncrementDelay); ok { + v.SetIncrementDelay(targetOccurence == 0) + } } } diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 4b3e9efab0a6..1bad17c535b8 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAccessAnalyzerAnalyzer_tagsSerial(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -232,6 +233,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -368,6 +371,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyMap(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -452,6 +456,7 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -544,6 +549,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -684,6 +690,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -776,6 +783,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -960,6 +968,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1123,6 +1132,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1302,6 +1312,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1395,6 +1406,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1499,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1555,6 +1568,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1615,6 +1629,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyProviderOnlyTag(t *test func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1680,6 +1695,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1745,6 +1761,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1803,6 +1820,7 @@ func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1903,6 +1921,7 @@ func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1993,6 +2012,7 @@ func testAccAccessAnalyzerAnalyzer_tags_ComputedTag_OnUpdate_Replace(t *testing. func testAccAccessAnalyzerAnalyzer_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2158,6 +2178,7 @@ func testAccAccessAnalyzerAnalyzer_tags_IgnoreTags_Overlap_DefaultTag(t *testing func testAccAccessAnalyzerAnalyzer_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AnalyzerSummary resourceName := "aws_accessanalyzer_analyzer.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/accessanalyzer/service_endpoint_resolver_gen.go b/internal/service/accessanalyzer/service_endpoint_resolver_gen.go index 4faed4295d83..a795eca60589 100644 --- a/internal/service/accessanalyzer/service_endpoint_resolver_gen.go +++ b/internal/service/accessanalyzer/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params accessanalyzer.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up accessanalyzer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up accessanalyzer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index c5499d67f5c5..d1726139b2d1 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/account/service_endpoint_resolver_gen.go b/internal/service/account/service_endpoint_resolver_gen.go index 55e9cb6c98ff..9e7dca937084 100644 --- a/internal/service/account/service_endpoint_resolver_gen.go +++ b/internal/service/account/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params account.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up account endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up account endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index f4eaeb3275f9..b3fa7f270174 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/acm/certificate.go b/internal/service/acm/certificate.go index d0382d932abd..f70bbee6e212 100644 --- a/internal/service/acm/certificate.go +++ b/internal/service/acm/certificate.go @@ -552,8 +552,8 @@ func resourceCertificateDelete(ctx context.Context, d *schema.ResourceData, meta input := acm.DeleteCertificateInput{ CertificateArn: aws.String(d.Id()), } - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, certificateCrossServicePropagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, certificateCrossServicePropagationTimeout, + func(ctx context.Context) (any, error) { return conn.DeleteCertificate(ctx, &input) }) diff --git a/internal/service/acm/certificate_data_source_tags_gen_test.go b/internal/service/acm/certificate_data_source_tags_gen_test.go index 4211a7eb82b7..74bad4f42383 100644 --- a/internal/service/acm/certificate_data_source_tags_gen_test.go +++ b/internal/service/acm/certificate_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccACMCertificateDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) @@ -46,6 +47,7 @@ func TestAccACMCertificateDataSource_tags(t *testing.T) { func TestAccACMCertificateDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) @@ -72,6 +74,7 @@ func TestAccACMCertificateDataSource_tags_NullMap(t *testing.T) { func TestAccACMCertificateDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) @@ -98,6 +101,7 @@ func TestAccACMCertificateDataSource_tags_EmptyMap(t *testing.T) { func TestAccACMCertificateDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) @@ -132,6 +136,7 @@ func TestAccACMCertificateDataSource_tags_DefaultTags_nonOverlapping(t *testing. func TestAccACMCertificateDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) @@ -172,6 +177,7 @@ func TestAccACMCertificateDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccACMCertificateDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) diff --git a/internal/service/acm/certificate_identity_gen_test.go b/internal/service/acm/certificate_identity_gen_test.go index cc17d2acd002..0404cfeedb47 100644 --- a/internal/service/acm/certificate_identity_gen_test.go +++ b/internal/service/acm/certificate_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccACMCertificate_Identity_Basic(t *testing.T) { privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -124,7 +124,7 @@ func TestAccACMCertificate_Identity_RegionOverride(t *testing.T) { privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -264,7 +264,7 @@ func TestAccACMCertificate_Identity_ExistingResource(t *testing.T) { privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, acctest.RandomDomain().String()) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/acm/certificate_tags_gen_test.go b/internal/service/acm/certificate_tags_gen_test.go index 1687678f0a04..457278b29498 100644 --- a/internal/service/acm/certificate_tags_gen_test.go +++ b/internal/service/acm/certificate_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccACMCertificate_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -221,6 +222,7 @@ func TestAccACMCertificate_tags(t *testing.T) { func TestAccACMCertificate_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -295,6 +297,7 @@ func TestAccACMCertificate_tags_null(t *testing.T) { func TestAccACMCertificate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -365,6 +368,7 @@ func TestAccACMCertificate_tags_EmptyMap(t *testing.T) { func TestAccACMCertificate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -453,6 +457,7 @@ func TestAccACMCertificate_tags_AddOnUpdate(t *testing.T) { func TestAccACMCertificate_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -553,6 +558,7 @@ func TestAccACMCertificate_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccACMCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -702,6 +708,7 @@ func TestAccACMCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccACMCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -798,6 +805,7 @@ func TestAccACMCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1000,6 +1008,7 @@ func TestAccACMCertificate_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1176,6 +1185,7 @@ func TestAccACMCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1368,6 +1378,7 @@ func TestAccACMCertificate_tags_DefaultTags_overlapping(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1465,6 +1476,7 @@ func TestAccACMCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1561,6 +1573,7 @@ func TestAccACMCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1632,6 +1645,7 @@ func TestAccACMCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1695,6 +1709,7 @@ func TestAccACMCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccACMCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1763,6 +1778,7 @@ func TestAccACMCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccACMCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1831,6 +1847,7 @@ func TestAccACMCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccACMCertificate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1892,6 +1909,7 @@ func TestAccACMCertificate_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccACMCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -1996,6 +2014,7 @@ func TestAccACMCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccACMCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -2090,6 +2109,7 @@ func TestAccACMCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccACMCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -2256,6 +2276,7 @@ func TestAccACMCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccACMCertificate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateDetail resourceName := "aws_acm_certificate.test" privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) diff --git a/internal/service/acm/service_endpoint_resolver_gen.go b/internal/service/acm/service_endpoint_resolver_gen.go index 464025a8ed42..f47514408511 100644 --- a/internal/service/acm/service_endpoint_resolver_gen.go +++ b/internal/service/acm/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params acm.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up acm endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up acm endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index eb943e3f58da..715b96c17d86 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/acmpca/certificate.go b/internal/service/acmpca/certificate.go index 78861d527c84..4516844fa904 100644 --- a/internal/service/acmpca/certificate.go +++ b/internal/service/acmpca/certificate.go @@ -177,7 +177,7 @@ func resourceCertificateCreate(ctx context.Context, d *schema.ResourceData, meta d.SetId(aws.ToString(outputRaw.(*acmpca.IssueCertificateOutput).CertificateArn)) // Wait for certificate status to become ISSUED. - _, err = tfresource.RetryWhenIsA[*types.RequestInProgressException](ctx, certificateIssueTimeout, func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *types.RequestInProgressException](ctx, certificateIssueTimeout, func(ctx context.Context) (any, error) { return findCertificateByTwoPartKey(ctx, conn, d.Id(), certificateAuthorityARN) }) diff --git a/internal/service/acmpca/certificate_authority.go b/internal/service/acmpca/certificate_authority.go index a1f279f3ebaa..310b8f68c448 100644 --- a/internal/service/acmpca/certificate_authority.go +++ b/internal/service/acmpca/certificate_authority.go @@ -367,7 +367,7 @@ func resourceCertificateAuthorityCreate(ctx context.Context, d *schema.ResourceD } // ValidationException: The ACM Private CA service account 'acm-pca-prod-pdx' requires getBucketAcl permissions for your S3 bucket 'tf-acc-test-5224996536060125340'. Check your S3 bucket permissions and try again. - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 1*time.Minute, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 1*time.Minute, func(ctx context.Context) (any, error) { return conn.CreateCertificateAuthority(ctx, &input) }, "ValidationException", "Check your S3 bucket permissions and try again") diff --git a/internal/service/acmpca/certificate_authority_certificate_identity_gen_test.go b/internal/service/acmpca/certificate_authority_certificate_identity_gen_test.go index d11c404d63e4..e83d9edb4666 100644 --- a/internal/service/acmpca/certificate_authority_certificate_identity_gen_test.go +++ b/internal/service/acmpca/certificate_authority_certificate_identity_gen_test.go @@ -26,7 +26,7 @@ func TestAccACMPCACertificateAuthorityCertificate_Identity_Basic(t *testing.T) { resourceName := "aws_acmpca_certificate_authority_certificate.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccACMPCACertificateAuthorityCertificate_Identity_RegionOverride(t *tes resourceName := "aws_acmpca_certificate_authority_certificate.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -232,7 +232,7 @@ func TestAccACMPCACertificateAuthorityCertificate_Identity_ExistingResource(t *t resourceName := "aws_acmpca_certificate_authority_certificate.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/acmpca/certificate_authority_data_source_tags_gen_test.go b/internal/service/acmpca/certificate_authority_data_source_tags_gen_test.go index b3ebf6af90a1..7aa1f5c16830 100644 --- a/internal/service/acmpca/certificate_authority_data_source_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccACMPCACertificateAuthorityDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccACMPCACertificateAuthorityDataSource_tags(t *testing.T) { func TestAccACMPCACertificateAuthorityDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccACMPCACertificateAuthorityDataSource_tags_NullMap(t *testing.T) { func TestAccACMPCACertificateAuthorityDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccACMPCACertificateAuthorityDataSource_tags_EmptyMap(t *testing.T) { func TestAccACMPCACertificateAuthorityDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccACMPCACertificateAuthorityDataSource_tags_DefaultTags_nonOverlapping func TestAccACMPCACertificateAuthorityDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccACMPCACertificateAuthorityDataSource_tags_IgnoreTags_Overlap_Default func TestAccACMPCACertificateAuthorityDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_acmpca_certificate_authority.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/acmpca/certificate_authority_identity_gen_test.go b/internal/service/acmpca/certificate_authority_identity_gen_test.go index b67ad534e9df..85a338b27f79 100644 --- a/internal/service/acmpca/certificate_authority_identity_gen_test.go +++ b/internal/service/acmpca/certificate_authority_identity_gen_test.go @@ -26,7 +26,7 @@ func TestAccACMPCACertificateAuthority_Identity_Basic(t *testing.T) { resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -118,7 +118,7 @@ func TestAccACMPCACertificateAuthority_Identity_RegionOverride(t *testing.T) { resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -251,7 +251,7 @@ func TestAccACMPCACertificateAuthority_Identity_ExistingResource(t *testing.T) { resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 539d1fcaaa55..225f46ca524e 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -212,6 +213,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -282,6 +284,7 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -348,6 +351,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyMap(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -432,6 +436,7 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -527,6 +532,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -670,6 +676,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -762,6 +769,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -955,6 +963,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1124,6 +1133,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1309,6 +1319,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1402,6 +1413,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1494,6 +1506,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1562,6 +1575,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1622,6 +1636,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyProviderOnlyTag(t * func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1687,6 +1702,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1752,6 +1768,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1810,6 +1827,7 @@ func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -1910,6 +1928,7 @@ func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnUpdate_Add(t *testing. func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -2000,6 +2019,7 @@ func TestAccACMPCACertificateAuthority_tags_ComputedTag_OnUpdate_Replace(t *test func TestAccACMPCACertificateAuthority_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() @@ -2162,6 +2182,7 @@ func TestAccACMPCACertificateAuthority_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccACMPCACertificateAuthority_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.CertificateAuthority resourceName := "aws_acmpca_certificate_authority.test" rName := acctest.RandomDomainName() diff --git a/internal/service/acmpca/certificate_identity_gen_test.go b/internal/service/acmpca/certificate_identity_gen_test.go index c0f888355444..e4f51cbec23b 100644 --- a/internal/service/acmpca/certificate_identity_gen_test.go +++ b/internal/service/acmpca/certificate_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccACMPCACertificate_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_acmpca_certificate.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -116,7 +117,7 @@ func TestAccACMPCACertificate_Identity_RegionOverride(t *testing.T) { resourceName := "aws_acmpca_certificate.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -244,10 +245,11 @@ func TestAccACMPCACertificate_Identity_RegionOverride(t *testing.T) { func TestAccACMPCACertificate_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_acmpca_certificate.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/acmpca/policy_identity_gen_test.go b/internal/service/acmpca/policy_identity_gen_test.go index 8791d6108afc..16c2a365d302 100644 --- a/internal/service/acmpca/policy_identity_gen_test.go +++ b/internal/service/acmpca/policy_identity_gen_test.go @@ -20,9 +20,10 @@ import ( func TestAccACMPCAPolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_acmpca_policy.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -98,7 +99,7 @@ func TestAccACMPCAPolicy_Identity_RegionOverride(t *testing.T) { resourceName := "aws_acmpca_policy.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -208,9 +209,10 @@ func TestAccACMPCAPolicy_Identity_RegionOverride(t *testing.T) { func TestAccACMPCAPolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_acmpca_policy.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/acmpca/service_endpoint_resolver_gen.go b/internal/service/acmpca/service_endpoint_resolver_gen.go index cb328c16cd26..5183a0808ec3 100644 --- a/internal/service/acmpca/service_endpoint_resolver_gen.go +++ b/internal/service/acmpca/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params acmpca.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up acmpca endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up acmpca endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index a1d946a92b23..352ce487eda9 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/amp/rule_group_namespace_identity_gen_test.go b/internal/service/amp/rule_group_namespace_identity_gen_test.go index 56f61da6b442..ce3d72dbf810 100644 --- a/internal/service/amp/rule_group_namespace_identity_gen_test.go +++ b/internal/service/amp/rule_group_namespace_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccAMPRuleGroupNamespace_Identity_Basic(t *testing.T) { resourceName := "aws_prometheus_rule_group_namespace.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccAMPRuleGroupNamespace_Identity_RegionOverride(t *testing.T) { resourceName := "aws_prometheus_rule_group_namespace.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccAMPRuleGroupNamespace_Identity_ExistingResource(t *testing.T) { resourceName := "aws_prometheus_rule_group_namespace.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/amp/rule_group_namespace_tags_gen_test.go b/internal/service/amp/rule_group_namespace_tags_gen_test.go index 187b7e36c296..51357ecba3c9 100644 --- a/internal/service/amp/rule_group_namespace_tags_gen_test.go +++ b/internal/service/amp/rule_group_namespace_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAMPRuleGroupNamespace_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAMPRuleGroupNamespace_tags(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAMPRuleGroupNamespace_tags_null(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAMPRuleGroupNamespace_tags_EmptyMap(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAMPRuleGroupNamespace_tags_AddOnUpdate(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAMPRuleGroupNamespace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccAMPRuleGroupNamespace_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccAMPRuleGroupNamespace_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccAMPRuleGroupNamespace_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccAMPRuleGroupNamespace_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAMPRuleGroupNamespace_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAMPRuleGroupNamespace_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccAMPRuleGroupNamespace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAMPRuleGroupNamespace_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccAMPRuleGroupNamespace_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RuleGroupsNamespaceDescription resourceName := "aws_prometheus_rule_group_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/amp/scraper_tags_gen_test.go b/internal/service/amp/scraper_tags_gen_test.go index fffbb7321cfa..6ca2f47fd456 100644 --- a/internal/service/amp/scraper_tags_gen_test.go +++ b/internal/service/amp/scraper_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAMPScraper_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAMPScraper_tags(t *testing.T) { func TestAccAMPScraper_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccAMPScraper_tags_null(t *testing.T) { func TestAccAMPScraper_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccAMPScraper_tags_EmptyMap(t *testing.T) { func TestAccAMPScraper_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccAMPScraper_tags_AddOnUpdate(t *testing.T) { func TestAccAMPScraper_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccAMPScraper_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAMPScraper_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccAMPScraper_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAMPScraper_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccAMPScraper_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccAMPScraper_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccAMPScraper_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccAMPScraper_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccAMPScraper_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccAMPScraper_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAMPScraper_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccAMPScraper_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccAMPScraper_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccAMPScraper_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func TestAccAMPScraper_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccAMPScraper_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing func TestAccAMPScraper_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccAMPScraper_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAMPScraper_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccAMPScraper_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAMPScraper_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccAMPScraper_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAMPScraper_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccAMPScraper_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAMPScraper_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ScraperDescription resourceName := "aws_prometheus_scraper.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/amp/service_endpoint_resolver_gen.go b/internal/service/amp/service_endpoint_resolver_gen.go index 3d710609ed7e..8fce799463d1 100644 --- a/internal/service/amp/service_endpoint_resolver_gen.go +++ b/internal/service/amp/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params amp.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up amp endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up amp endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index 3b41c5b0283b..6970f97b1602 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/amp/workspace_data_source_tags_gen_test.go b/internal/service/amp/workspace_data_source_tags_gen_test.go index 5ce1fd4f5a62..e525c6032a3e 100644 --- a/internal/service/amp/workspace_data_source_tags_gen_test.go +++ b/internal/service/amp/workspace_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAMPWorkspaceDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -47,6 +48,7 @@ func TestAccAMPWorkspaceDataSource_tags(t *testing.T) { func TestAccAMPWorkspaceDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -69,6 +71,7 @@ func TestAccAMPWorkspaceDataSource_tags_NullMap(t *testing.T) { func TestAccAMPWorkspaceDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -91,6 +94,7 @@ func TestAccAMPWorkspaceDataSource_tags_EmptyMap(t *testing.T) { func TestAccAMPWorkspaceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -121,6 +125,7 @@ func TestAccAMPWorkspaceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccAMPWorkspaceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -157,6 +162,7 @@ func TestAccAMPWorkspaceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing func TestAccAMPWorkspaceDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_prometheus_workspace.test" acctest.ParallelTest(ctx, t, resource.TestCase{ diff --git a/internal/service/amp/workspace_tags_gen_test.go b/internal/service/amp/workspace_tags_gen_test.go index de43524e4416..aede22126489 100644 --- a/internal/service/amp/workspace_tags_gen_test.go +++ b/internal/service/amp/workspace_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAMPWorkspace_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -191,6 +192,7 @@ func TestAccAMPWorkspace_tags(t *testing.T) { func TestAccAMPWorkspace_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -254,6 +256,7 @@ func TestAccAMPWorkspace_tags_null(t *testing.T) { func TestAccAMPWorkspace_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -313,6 +316,7 @@ func TestAccAMPWorkspace_tags_EmptyMap(t *testing.T) { func TestAccAMPWorkspace_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -390,6 +394,7 @@ func TestAccAMPWorkspace_tags_AddOnUpdate(t *testing.T) { func TestAccAMPWorkspace_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -474,6 +479,7 @@ func TestAccAMPWorkspace_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAMPWorkspace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -605,6 +611,7 @@ func TestAccAMPWorkspace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAMPWorkspace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -690,6 +697,7 @@ func TestAccAMPWorkspace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -862,6 +870,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1015,6 +1024,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1184,6 +1194,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1270,6 +1281,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1355,6 +1367,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1417,6 +1430,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1471,6 +1485,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccAMPWorkspace_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1530,6 +1545,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_nullOverlappingResourceTag(t *testing. func TestAccAMPWorkspace_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1589,6 +1605,7 @@ func TestAccAMPWorkspace_tags_DefaultTags_nullNonOverlappingResourceTag(t *testi func TestAccAMPWorkspace_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1641,6 +1658,7 @@ func TestAccAMPWorkspace_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAMPWorkspace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1734,6 +1752,7 @@ func TestAccAMPWorkspace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAMPWorkspace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1817,6 +1836,7 @@ func TestAccAMPWorkspace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAMPWorkspace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" @@ -1975,6 +1995,7 @@ func TestAccAMPWorkspace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAMPWorkspace_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.WorkspaceDescription resourceName := "aws_prometheus_workspace.test" diff --git a/internal/service/amplify/app.go b/internal/service/amplify/app.go index f8012e1ebaf1..4ce53bc4a68b 100644 --- a/internal/service/amplify/app.go +++ b/internal/service/amplify/app.go @@ -460,7 +460,7 @@ func resourceAppRead(ctx context.Context, d *schema.ResourceData, meta any) diag } else { d.Set("auto_branch_creation_config", nil) } - d.Set("auto_branch_creation_patterns", aws.StringSlice(app.AutoBranchCreationPatterns)) + d.Set("auto_branch_creation_patterns", app.AutoBranchCreationPatterns) d.Set("basic_auth_credentials", app.BasicAuthCredentials) d.Set("build_spec", app.BuildSpec) if app.CacheConfig != nil { diff --git a/internal/service/amplify/app_tags_gen_test.go b/internal/service/amplify/app_tags_gen_test.go index 183c19e9b7a6..b2e3221d2f11 100644 --- a/internal/service/amplify/app_tags_gen_test.go +++ b/internal/service/amplify/app_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAmplifyApp_tagsSerial(t *testing.T) { func testAccAmplifyApp_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccAmplifyApp_tags(t *testing.T) { func testAccAmplifyApp_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -296,6 +298,7 @@ func testAccAmplifyApp_tags_null(t *testing.T) { func testAccAmplifyApp_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -359,6 +362,7 @@ func testAccAmplifyApp_tags_EmptyMap(t *testing.T) { func testAccAmplifyApp_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -440,6 +444,7 @@ func testAccAmplifyApp_tags_AddOnUpdate(t *testing.T) { func testAccAmplifyApp_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -529,6 +534,7 @@ func testAccAmplifyApp_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAmplifyApp_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -666,6 +672,7 @@ func testAccAmplifyApp_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAmplifyApp_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -755,6 +762,7 @@ func testAccAmplifyApp_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -936,6 +944,7 @@ func testAccAmplifyApp_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1096,6 +1105,7 @@ func testAccAmplifyApp_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func testAccAmplifyApp_tags_DefaultTags_overlapping(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1362,6 +1373,7 @@ func testAccAmplifyApp_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1451,6 +1463,7 @@ func testAccAmplifyApp_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1516,6 +1529,7 @@ func testAccAmplifyApp_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1573,6 +1587,7 @@ func testAccAmplifyApp_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccAmplifyApp_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1635,6 +1650,7 @@ func testAccAmplifyApp_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func testAccAmplifyApp_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1697,6 +1713,7 @@ func testAccAmplifyApp_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing func testAccAmplifyApp_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1769,7 @@ func testAccAmplifyApp_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAmplifyApp_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1849,6 +1867,7 @@ func testAccAmplifyApp_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAmplifyApp_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1936,6 +1955,7 @@ func testAccAmplifyApp_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAmplifyApp_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2098,6 +2118,7 @@ func testAccAmplifyApp_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccAmplifyApp_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.App resourceName := "aws_amplify_app.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/amplify/app_test.go b/internal/service/amplify/app_test.go index 3c3048cc1637..e18c961af83d 100644 --- a/internal/service/amplify/app_test.go +++ b/internal/service/amplify/app_test.go @@ -141,10 +141,11 @@ func testAccApp_AutoBranchCreationConfig(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAppExists(ctx, resourceName, &app), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.#", "1"), - resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.basic_auth_credentials", credentials), + // resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.basic_auth_credentials", credentials), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.build_spec", "version: 0.1"), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_auto_build", acctest.CtTrue), - resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_basic_auth", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_basic_auth", acctest.CtFalse), + // resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_basic_auth", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_performance_mode", acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.enable_pull_request_preview", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "auto_branch_creation_config.0.environment_variables.%", "1"), @@ -805,8 +806,10 @@ resource "aws_amplify_app" "test" { framework = "React" stage = "DEVELOPMENT" - enable_basic_auth = true - basic_auth_credentials = %[2]q + # enable_basic_auth = true + # basic_auth_credentials = %[2]q + enable_basic_auth = false + basic_auth_credentials = null enable_auto_build = true enable_pull_request_preview = true diff --git a/internal/service/amplify/branch_tags_gen_test.go b/internal/service/amplify/branch_tags_gen_test.go index 47e9098ef1fc..77d166300827 100644 --- a/internal/service/amplify/branch_tags_gen_test.go +++ b/internal/service/amplify/branch_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAmplifyBranch_tagsSerial(t *testing.T) { func testAccAmplifyBranch_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccAmplifyBranch_tags(t *testing.T) { func testAccAmplifyBranch_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -296,6 +298,7 @@ func testAccAmplifyBranch_tags_null(t *testing.T) { func testAccAmplifyBranch_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -359,6 +362,7 @@ func testAccAmplifyBranch_tags_EmptyMap(t *testing.T) { func testAccAmplifyBranch_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -440,6 +444,7 @@ func testAccAmplifyBranch_tags_AddOnUpdate(t *testing.T) { func testAccAmplifyBranch_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -529,6 +534,7 @@ func testAccAmplifyBranch_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAmplifyBranch_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -666,6 +672,7 @@ func testAccAmplifyBranch_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAmplifyBranch_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -755,6 +762,7 @@ func testAccAmplifyBranch_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -936,6 +944,7 @@ func testAccAmplifyBranch_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1096,6 +1105,7 @@ func testAccAmplifyBranch_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func testAccAmplifyBranch_tags_DefaultTags_overlapping(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1362,6 +1373,7 @@ func testAccAmplifyBranch_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1451,6 +1463,7 @@ func testAccAmplifyBranch_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1516,6 +1529,7 @@ func testAccAmplifyBranch_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1573,6 +1587,7 @@ func testAccAmplifyBranch_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccAmplifyBranch_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1635,6 +1650,7 @@ func testAccAmplifyBranch_tags_DefaultTags_nullOverlappingResourceTag(t *testing func testAccAmplifyBranch_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1697,6 +1713,7 @@ func testAccAmplifyBranch_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func testAccAmplifyBranch_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1769,7 @@ func testAccAmplifyBranch_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAmplifyBranch_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1849,6 +1867,7 @@ func testAccAmplifyBranch_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAmplifyBranch_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1936,6 +1955,7 @@ func testAccAmplifyBranch_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAmplifyBranch_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2098,6 +2118,7 @@ func testAccAmplifyBranch_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccAmplifyBranch_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Branch resourceName := "aws_amplify_branch.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/amplify/service_endpoint_resolver_gen.go b/internal/service/amplify/service_endpoint_resolver_gen.go index 3c59ee3b2f43..eb39b170cc02 100644 --- a/internal/service/amplify/service_endpoint_resolver_gen.go +++ b/internal/service/amplify/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params amplify.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up amplify endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up amplify endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index 888f8dd097cf..874e6d69db37 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/apigateway/api_key_data_source_tags_gen_test.go b/internal/service/apigateway/api_key_data_source_tags_gen_test.go index be585daf5182..06d973fd0c9a 100644 --- a/internal/service/apigateway/api_key_data_source_tags_gen_test.go +++ b/internal/service/apigateway/api_key_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayAPIKeyDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAPIGatewayAPIKeyDataSource_tags(t *testing.T) { func TestAccAPIGatewayAPIKeyDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAPIGatewayAPIKeyDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayAPIKeyDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAPIGatewayAPIKeyDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayAPIKeyDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAPIGatewayAPIKeyDataSource_tags_DefaultTags_nonOverlapping(t *testin func TestAccAPIGatewayAPIKeyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAPIGatewayAPIKeyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccAPIGatewayAPIKeyDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/api_key_tags_gen_test.go b/internal/service/apigateway/api_key_tags_gen_test.go index 5e3671cea00a..e81a248984e8 100644 --- a/internal/service/apigateway/api_key_tags_gen_test.go +++ b/internal/service/apigateway/api_key_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayAPIKey_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAPIGatewayAPIKey_tags(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAPIGatewayAPIKey_tags_null(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAPIGatewayAPIKey_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAPIGatewayAPIKey_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAPIGatewayAPIKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccAPIGatewayAPIKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccAPIGatewayAPIKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccAPIGatewayAPIKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccAPIGatewayAPIKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAPIGatewayAPIKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAPIGatewayAPIKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAPIGatewayAPIKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAPIGatewayAPIKey_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetApiKeyOutput resourceName := "aws_api_gateway_api_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/base_path_mapping.go b/internal/service/apigateway/base_path_mapping.go index ed3c654db7e9..20571c9e5b60 100644 --- a/internal/service/apigateway/base_path_mapping.go +++ b/internal/service/apigateway/base_path_mapping.go @@ -87,7 +87,7 @@ func resourceBasePathMappingCreate(ctx context.Context, d *schema.ResourceData, const ( timeout = 30 * time.Second ) - _, err := tfresource.RetryWhenIsA[*types.BadRequestException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.BadRequestException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateBasePathMapping(ctx, &input) }) diff --git a/internal/service/apigateway/client_certificate_tags_gen_test.go b/internal/service/apigateway/client_certificate_tags_gen_test.go index 261bafcbf3b2..bba2b50f3885 100644 --- a/internal/service/apigateway/client_certificate_tags_gen_test.go +++ b/internal/service/apigateway/client_certificate_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayClientCertificate_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -191,6 +192,7 @@ func TestAccAPIGatewayClientCertificate_tags(t *testing.T) { func TestAccAPIGatewayClientCertificate_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -254,6 +256,7 @@ func TestAccAPIGatewayClientCertificate_tags_null(t *testing.T) { func TestAccAPIGatewayClientCertificate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -313,6 +316,7 @@ func TestAccAPIGatewayClientCertificate_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayClientCertificate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -390,6 +394,7 @@ func TestAccAPIGatewayClientCertificate_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -474,6 +479,7 @@ func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -605,6 +611,7 @@ func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -690,6 +697,7 @@ func TestAccAPIGatewayClientCertificate_tags_EmptyTag_OnUpdate_Replace(t *testin func TestAccAPIGatewayClientCertificate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -862,6 +870,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_providerOnly(t *testing func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1015,6 +1024,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nonOverlapping(t *testi func TestAccAPIGatewayClientCertificate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1184,6 +1194,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_overlapping(t *testing. func TestAccAPIGatewayClientCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1270,6 +1281,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_updateToProviderOnly(t func TestAccAPIGatewayClientCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1355,6 +1367,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_updateToResourceOnly(t func TestAccAPIGatewayClientCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1417,6 +1430,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_emptyResourceTag(t *tes func TestAccAPIGatewayClientCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1471,6 +1485,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1530,6 +1545,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nullOverlappingResource func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1589,6 +1605,7 @@ func TestAccAPIGatewayClientCertificate_tags_DefaultTags_nullNonOverlappingResou func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1641,6 +1658,7 @@ func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnCreate(t *testing.T) func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1734,6 +1752,7 @@ func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnUpdate_Add(t *testing func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1817,6 +1836,7 @@ func TestAccAPIGatewayClientCertificate_tags_ComputedTag_OnUpdate_Replace(t *tes func TestAccAPIGatewayClientCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" @@ -1975,6 +1995,7 @@ func TestAccAPIGatewayClientCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccAPIGatewayClientCertificate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetClientCertificateOutput resourceName := "aws_api_gateway_client_certificate.test" diff --git a/internal/service/apigateway/domain_name_access_association.go b/internal/service/apigateway/domain_name_access_association.go index 996fd85f2537..ba520e49f0a4 100644 --- a/internal/service/apigateway/domain_name_access_association.go +++ b/internal/service/apigateway/domain_name_access_association.go @@ -34,6 +34,7 @@ import ( // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/apigateway/types;awstypes;awstypes.DomainNameAccessAssociation") // @Testing(generator="github.com/hashicorp/terraform-provider-aws/internal/acctest;acctest.RandomSubdomain()") // @Testing(tlsKey=true, tlsKeyDomain="rName") +// @Testing(preIdentityVersion="v5.100.0") func newDomainNameAccessAssociationResource(context.Context) (resource.ResourceWithConfigure, error) { r := &domainNameAccessAssociationResource{} diff --git a/internal/service/apigateway/domain_name_access_association_identity_gen_test.go b/internal/service/apigateway/domain_name_access_association_identity_gen_test.go index a6f1d9c102b4..8804e3cedde7 100644 --- a/internal/service/apigateway/domain_name_access_association_identity_gen_test.go +++ b/internal/service/apigateway/domain_name_access_association_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_Identity_Basic(t *testing.T) { privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, rName) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -123,7 +123,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_Identity_RegionOverride(t *tes privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, rName) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -258,7 +258,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_Identity_ExistingResource(t *t privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificatePEM := acctest.TLSRSAX509SelfSignedCertificatePEM(t, privateKeyPEM, rName) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apigateway/domain_name_access_association_tags_gen_test.go b/internal/service/apigateway/domain_name_access_association_tags_gen_test.go index e9e1ca06e674..025deac3f65e 100644 --- a/internal/service/apigateway/domain_name_access_association_tags_gen_test.go +++ b/internal/service/apigateway/domain_name_access_association_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayDomainNameAccessAssociation_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -218,6 +219,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags(t *testing.T) { func TestAccAPIGatewayDomainNameAccessAssociation_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -286,6 +288,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_null(t *testing.T) { func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -342,6 +345,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayDomainNameAccessAssociation_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -430,6 +434,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_AddOnUpdate(t *testing.T) func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -530,6 +535,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnCreate(t *test func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -681,6 +687,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnUpdate_Add(t * func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -779,6 +786,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_EmptyTag_OnUpdate_Replace func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -978,6 +986,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_providerOnly( func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1152,6 +1161,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nonOverlappin func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1342,6 +1352,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_overlapping(t func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1440,6 +1451,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_updateToProvi func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1537,6 +1549,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_updateToResou func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1609,6 +1622,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_emptyResource func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1673,6 +1687,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_emptyProvider func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1748,6 +1763,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nullOverlappi func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1825,6 +1841,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_DefaultTags_nullNonOverla func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1886,6 +1903,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnCreate(t *t func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -1991,6 +2009,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnUpdate_Add( func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -2086,6 +2105,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_ComputedTag_OnUpdate_Repl func TestAccAPIGatewayDomainNameAccessAssociation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() @@ -2256,6 +2276,7 @@ func TestAccAPIGatewayDomainNameAccessAssociation_tags_IgnoreTags_Overlap_Defaul func TestAccAPIGatewayDomainNameAccessAssociation_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DomainNameAccessAssociation resourceName := "aws_api_gateway_domain_name_access_association.test" rName := acctest.RandomSubdomain() diff --git a/internal/service/apigateway/domain_name_data_source_tags_gen_test.go b/internal/service/apigateway/domain_name_data_source_tags_gen_test.go index f74b9b505dca..4722bc6df58c 100644 --- a/internal/service/apigateway/domain_name_data_source_tags_gen_test.go +++ b/internal/service/apigateway/domain_name_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayDomainNameDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -53,6 +54,7 @@ func TestAccAPIGatewayDomainNameDataSource_tags(t *testing.T) { func TestAccAPIGatewayDomainNameDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -81,6 +83,7 @@ func TestAccAPIGatewayDomainNameDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayDomainNameDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -109,6 +112,7 @@ func TestAccAPIGatewayDomainNameDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayDomainNameDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -145,6 +149,7 @@ func TestAccAPIGatewayDomainNameDataSource_tags_DefaultTags_nonOverlapping(t *te func TestAccAPIGatewayDomainNameDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -187,6 +192,7 @@ func TestAccAPIGatewayDomainNameDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccAPIGatewayDomainNameDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() privateKeyPEM := acctest.TLSRSAPrivateKeyPEM(t, 2048) diff --git a/internal/service/apigateway/domain_name_tags_gen_test.go b/internal/service/apigateway/domain_name_tags_gen_test.go index 66b3917c0ff5..797e3cfa6be4 100644 --- a/internal/service/apigateway/domain_name_tags_gen_test.go +++ b/internal/service/apigateway/domain_name_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayDomainName_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -218,6 +219,7 @@ func TestAccAPIGatewayDomainName_tags(t *testing.T) { func TestAccAPIGatewayDomainName_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -293,6 +295,7 @@ func TestAccAPIGatewayDomainName_tags_null(t *testing.T) { func TestAccAPIGatewayDomainName_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -364,6 +367,7 @@ func TestAccAPIGatewayDomainName_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayDomainName_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -453,6 +457,7 @@ func TestAccAPIGatewayDomainName_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayDomainName_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -552,6 +557,7 @@ func TestAccAPIGatewayDomainName_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayDomainName_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -701,6 +707,7 @@ func TestAccAPIGatewayDomainName_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayDomainName_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -798,6 +805,7 @@ func TestAccAPIGatewayDomainName_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayDomainName_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -997,6 +1005,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayDomainName_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1171,6 +1180,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayDomainName_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1361,6 +1371,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayDomainName_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1459,6 +1470,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccAPIGatewayDomainName_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1556,6 +1568,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccAPIGatewayDomainName_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1627,6 +1640,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAPIGatewayDomainName_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1690,6 +1704,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccAPIGatewayDomainName_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1758,6 +1773,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccAPIGatewayDomainName_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1826,6 +1842,7 @@ func TestAccAPIGatewayDomainName_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccAPIGatewayDomainName_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1887,6 +1904,7 @@ func TestAccAPIGatewayDomainName_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayDomainName_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -1992,6 +2010,7 @@ func TestAccAPIGatewayDomainName_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayDomainName_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -2087,6 +2106,7 @@ func TestAccAPIGatewayDomainName_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAPIGatewayDomainName_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() @@ -2257,6 +2277,7 @@ func TestAccAPIGatewayDomainName_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccAPIGatewayDomainName_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetDomainNameOutput resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() diff --git a/internal/service/apigateway/method_response.go b/internal/service/apigateway/method_response.go index 055e91dcfd1d..41269db66bb7 100644 --- a/internal/service/apigateway/method_response.go +++ b/internal/service/apigateway/method_response.go @@ -112,7 +112,7 @@ func resourceMethodResponseCreate(ctx context.Context, d *schema.ResourceData, m const ( timeout = 2 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*types.ConflictException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ConflictException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.PutMethodResponse(ctx, &input) }) diff --git a/internal/service/apigateway/rest_api_data_source_tags_gen_test.go b/internal/service/apigateway/rest_api_data_source_tags_gen_test.go index 6e091d096579..2210f1573494 100644 --- a/internal/service/apigateway/rest_api_data_source_tags_gen_test.go +++ b/internal/service/apigateway/rest_api_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayRESTAPIDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAPIGatewayRESTAPIDataSource_tags(t *testing.T) { func TestAccAPIGatewayRESTAPIDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAPIGatewayRESTAPIDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayRESTAPIDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAPIGatewayRESTAPIDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayRESTAPIDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAPIGatewayRESTAPIDataSource_tags_DefaultTags_nonOverlapping(t *testi func TestAccAPIGatewayRESTAPIDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAPIGatewayRESTAPIDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccAPIGatewayRESTAPIDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/rest_api_tags_gen_test.go b/internal/service/apigateway/rest_api_tags_gen_test.go index d6bdb3e6b9e8..f7a820f48f31 100644 --- a/internal/service/apigateway/rest_api_tags_gen_test.go +++ b/internal/service/apigateway/rest_api_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayRESTAPI_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccAPIGatewayRESTAPI_tags(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccAPIGatewayRESTAPI_tags_null(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccAPIGatewayRESTAPI_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccAPIGatewayRESTAPI_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccAPIGatewayRESTAPI_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccAPIGatewayRESTAPI_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccAPIGatewayRESTAPI_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccAPIGatewayRESTAPI_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccAPIGatewayRESTAPI_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccAPIGatewayRESTAPI_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAPIGatewayRESTAPI_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetRestApiOutput resourceName := "aws_api_gateway_rest_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/service_endpoint_resolver_gen.go b/internal/service/apigateway/service_endpoint_resolver_gen.go index d936de2594e0..c37b44f4b89b 100644 --- a/internal/service/apigateway/service_endpoint_resolver_gen.go +++ b/internal/service/apigateway/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params apigateway.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up apigateway endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up apigateway endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index ff9305e4d5eb..edcf6331ea0a 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/apigateway/stage_tags_gen_test.go b/internal/service/apigateway/stage_tags_gen_test.go index a9b5d6f98989..28d29b280b30 100644 --- a/internal/service/apigateway/stage_tags_gen_test.go +++ b/internal/service/apigateway/stage_tags_gen_test.go @@ -48,6 +48,7 @@ func testAccAPIGatewayStage_tagsSerial(t *testing.T) { func testAccAPIGatewayStage_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -234,6 +235,7 @@ func testAccAPIGatewayStage_tags(t *testing.T) { func testAccAPIGatewayStage_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func testAccAPIGatewayStage_tags_null(t *testing.T) { func testAccAPIGatewayStage_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -366,6 +369,7 @@ func testAccAPIGatewayStage_tags_EmptyMap(t *testing.T) { func testAccAPIGatewayStage_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -448,6 +452,7 @@ func testAccAPIGatewayStage_tags_AddOnUpdate(t *testing.T) { func testAccAPIGatewayStage_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -539,6 +544,7 @@ func testAccAPIGatewayStage_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAPIGatewayStage_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -678,6 +684,7 @@ func testAccAPIGatewayStage_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAPIGatewayStage_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -768,6 +775,7 @@ func testAccAPIGatewayStage_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAPIGatewayStage_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -953,6 +961,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAPIGatewayStage_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1116,6 +1125,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAPIGatewayStage_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1295,6 +1305,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_overlapping(t *testing.T) { func testAccAPIGatewayStage_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1386,6 +1397,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_updateToProviderOnly(t *testing.T) func testAccAPIGatewayStage_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1476,6 +1488,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_updateToResourceOnly(t *testing.T) func testAccAPIGatewayStage_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1542,6 +1555,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAPIGatewayStage_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1614,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func testAccAPIGatewayStage_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1663,6 +1678,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_nullOverlappingResourceTag(t *testi func testAccAPIGatewayStage_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1742,7 @@ func testAccAPIGatewayStage_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func testAccAPIGatewayStage_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1782,6 +1799,7 @@ func testAccAPIGatewayStage_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAPIGatewayStage_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1880,6 +1898,7 @@ func testAccAPIGatewayStage_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAPIGatewayStage_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1968,6 +1987,7 @@ func testAccAPIGatewayStage_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAPIGatewayStage_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2130,6 +2150,7 @@ func testAccAPIGatewayStage_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccAPIGatewayStage_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetStageOutput resourceName := "aws_api_gateway_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/usage_plan_tags_gen_test.go b/internal/service/apigateway/usage_plan_tags_gen_test.go index 2836f625e0ea..b40848a87f4b 100644 --- a/internal/service/apigateway/usage_plan_tags_gen_test.go +++ b/internal/service/apigateway/usage_plan_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayUsagePlan_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAPIGatewayUsagePlan_tags(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAPIGatewayUsagePlan_tags_null(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAPIGatewayUsagePlan_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAPIGatewayUsagePlan_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAPIGatewayUsagePlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccAPIGatewayUsagePlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccAPIGatewayUsagePlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAPIGatewayUsagePlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAPIGatewayUsagePlan_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAPIGatewayUsagePlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAPIGatewayUsagePlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAPIGatewayUsagePlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccAPIGatewayUsagePlan_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigateway.GetUsagePlanOutput resourceName := "aws_api_gateway_usage_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/vpc_link_data_source_tags_gen_test.go b/internal/service/apigateway/vpc_link_data_source_tags_gen_test.go index da2a332c1838..6fee566aedab 100644 --- a/internal/service/apigateway/vpc_link_data_source_tags_gen_test.go +++ b/internal/service/apigateway/vpc_link_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayVPCLinkDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAPIGatewayVPCLinkDataSource_tags(t *testing.T) { func TestAccAPIGatewayVPCLinkDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAPIGatewayVPCLinkDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayVPCLinkDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAPIGatewayVPCLinkDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayVPCLinkDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAPIGatewayVPCLinkDataSource_tags_DefaultTags_nonOverlapping(t *testi func TestAccAPIGatewayVPCLinkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAPIGatewayVPCLinkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccAPIGatewayVPCLinkDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigateway/vpc_link_tags_gen_test.go b/internal/service/apigateway/vpc_link_tags_gen_test.go index 130e0c344c59..abd8266966cd 100644 --- a/internal/service/apigateway/vpc_link_tags_gen_test.go +++ b/internal/service/apigateway/vpc_link_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAPIGatewayVPCLink_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAPIGatewayVPCLink_tags(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAPIGatewayVPCLink_tags_null(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAPIGatewayVPCLink_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAPIGatewayVPCLink_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAPIGatewayVPCLink_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccAPIGatewayVPCLink_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccAPIGatewayVPCLink_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccAPIGatewayVPCLink_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccAPIGatewayVPCLink_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAPIGatewayVPCLink_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAPIGatewayVPCLink_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAPIGatewayVPCLink_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAPIGatewayVPCLink_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_api_gateway_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/api_data_source_tags_gen_test.go b/internal/service/apigatewayv2/api_data_source_tags_gen_test.go index 16a838ff9f56..a1ae648f5082 100644 --- a/internal/service/apigatewayv2/api_data_source_tags_gen_test.go +++ b/internal/service/apigatewayv2/api_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayV2APIDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAPIGatewayV2APIDataSource_tags(t *testing.T) { func TestAccAPIGatewayV2APIDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAPIGatewayV2APIDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayV2APIDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAPIGatewayV2APIDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2APIDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAPIGatewayV2APIDataSource_tags_DefaultTags_nonOverlapping(t *testing func TestAccAPIGatewayV2APIDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAPIGatewayV2APIDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccAPIGatewayV2APIDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/api_tags_gen_test.go b/internal/service/apigatewayv2/api_tags_gen_test.go index f642b6aedf58..5c0bcab8d7da 100644 --- a/internal/service/apigatewayv2/api_tags_gen_test.go +++ b/internal/service/apigatewayv2/api_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayV2API_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAPIGatewayV2API_tags(t *testing.T) { func TestAccAPIGatewayV2API_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAPIGatewayV2API_tags_null(t *testing.T) { func TestAccAPIGatewayV2API_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAPIGatewayV2API_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2API_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAPIGatewayV2API_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayV2API_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag(t *testi func TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetApiOutput resourceName := "aws_apigatewayv2_api.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/authorizer.go b/internal/service/apigatewayv2/authorizer.go index e32ebe15f54d..b78e17486aac 100644 --- a/internal/service/apigatewayv2/authorizer.go +++ b/internal/service/apigatewayv2/authorizer.go @@ -263,7 +263,7 @@ func resourceAuthorizerDelete(ctx context.Context, d *schema.ResourceData, meta conn := meta.(*conns.AWSClient).APIGatewayV2Client(ctx) log.Printf("[DEBUG] Deleting API Gateway v2 Authorizer: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteAuthorizer(ctx, &apigatewayv2.DeleteAuthorizerInput{ ApiId: aws.String(d.Get("api_id").(string)), AuthorizerId: aws.String(d.Id()), diff --git a/internal/service/apigatewayv2/domain_name_tags_gen_test.go b/internal/service/apigatewayv2/domain_name_tags_gen_test.go index 8196909224b7..62243b76bdaa 100644 --- a/internal/service/apigatewayv2/domain_name_tags_gen_test.go +++ b/internal/service/apigatewayv2/domain_name_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayV2DomainName_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -218,6 +219,7 @@ func TestAccAPIGatewayV2DomainName_tags(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -293,6 +295,7 @@ func TestAccAPIGatewayV2DomainName_tags_null(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -364,6 +367,7 @@ func TestAccAPIGatewayV2DomainName_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -453,6 +457,7 @@ func TestAccAPIGatewayV2DomainName_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -552,6 +557,7 @@ func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -701,6 +707,7 @@ func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -798,6 +805,7 @@ func TestAccAPIGatewayV2DomainName_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccAPIGatewayV2DomainName_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -997,6 +1005,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1171,6 +1180,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccAPIGatewayV2DomainName_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1361,6 +1371,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1459,6 +1470,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_updateToProviderOnly(t *test func TestAccAPIGatewayV2DomainName_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1556,6 +1568,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_updateToResourceOnly(t *test func TestAccAPIGatewayV2DomainName_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1627,6 +1640,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_emptyResourceTag(t *testing. func TestAccAPIGatewayV2DomainName_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1690,6 +1704,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_emptyProviderOnlyTag(t *test func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1758,6 +1773,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1826,6 +1842,7 @@ func TestAccAPIGatewayV2DomainName_tags_DefaultTags_nullNonOverlappingResourceTa func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1887,6 +1904,7 @@ func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -1992,6 +2010,7 @@ func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -2087,6 +2106,7 @@ func TestAccAPIGatewayV2DomainName_tags_ComputedTag_OnUpdate_Replace(t *testing. func TestAccAPIGatewayV2DomainName_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() @@ -2257,6 +2277,7 @@ func TestAccAPIGatewayV2DomainName_tags_IgnoreTags_Overlap_DefaultTag(t *testing func TestAccAPIGatewayV2DomainName_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetDomainNameOutput resourceName := "aws_apigatewayv2_domain_name.test" rName := acctest.RandomSubdomain() diff --git a/internal/service/apigatewayv2/service_endpoint_resolver_gen.go b/internal/service/apigatewayv2/service_endpoint_resolver_gen.go index b82d77e3be6f..86581684cc5c 100644 --- a/internal/service/apigatewayv2/service_endpoint_resolver_gen.go +++ b/internal/service/apigatewayv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params apigatewayv2.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up apigatewayv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up apigatewayv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index 3d6c2b23dde5..f1708471afd4 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/apigatewayv2/stage_tags_gen_test.go b/internal/service/apigatewayv2/stage_tags_gen_test.go index f497f379af78..fffbc8d72b47 100644 --- a/internal/service/apigatewayv2/stage_tags_gen_test.go +++ b/internal/service/apigatewayv2/stage_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayV2Stage_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -204,6 +205,7 @@ func TestAccAPIGatewayV2Stage_tags(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccAPIGatewayV2Stage_tags_null(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -336,6 +339,7 @@ func TestAccAPIGatewayV2Stage_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -418,6 +422,7 @@ func TestAccAPIGatewayV2Stage_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -509,6 +514,7 @@ func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -648,6 +654,7 @@ func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -738,6 +745,7 @@ func TestAccAPIGatewayV2Stage_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -923,6 +931,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1086,6 +1095,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1265,6 +1275,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1356,6 +1367,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccAPIGatewayV2Stage_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1446,6 +1458,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccAPIGatewayV2Stage_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1512,6 +1525,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1570,6 +1584,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccAPIGatewayV2Stage_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1633,6 +1648,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccAPIGatewayV2Stage_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1696,6 +1712,7 @@ func TestAccAPIGatewayV2Stage_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1769,7 @@ func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1850,6 +1868,7 @@ func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1938,6 +1957,7 @@ func TestAccAPIGatewayV2Stage_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2100,6 +2120,7 @@ func TestAccAPIGatewayV2Stage_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAPIGatewayV2Stage_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetStageOutput resourceName := "aws_apigatewayv2_stage.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/vpc_link_data_source_tags_gen_test.go b/internal/service/apigatewayv2/vpc_link_data_source_tags_gen_test.go index 83f33ae15e91..6842674ba63a 100644 --- a/internal/service/apigatewayv2/vpc_link_data_source_tags_gen_test.go +++ b/internal/service/apigatewayv2/vpc_link_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAPIGatewayV2VPCLinkDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAPIGatewayV2VPCLinkDataSource_tags(t *testing.T) { func TestAccAPIGatewayV2VPCLinkDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAPIGatewayV2VPCLinkDataSource_tags_NullMap(t *testing.T) { func TestAccAPIGatewayV2VPCLinkDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAPIGatewayV2VPCLinkDataSource_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2VPCLinkDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAPIGatewayV2VPCLinkDataSource_tags_DefaultTags_nonOverlapping(t *tes func TestAccAPIGatewayV2VPCLinkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAPIGatewayV2VPCLinkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccAPIGatewayV2VPCLinkDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/vpc_link_tags_gen_test.go b/internal/service/apigatewayv2/vpc_link_tags_gen_test.go index 0fcee0152a53..bdcbd0023cc4 100644 --- a/internal/service/apigatewayv2/vpc_link_tags_gen_test.go +++ b/internal/service/apigatewayv2/vpc_link_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAPIGatewayV2VPCLink_tags(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAPIGatewayV2VPCLink_tags(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAPIGatewayV2VPCLink_tags_null(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAPIGatewayV2VPCLink_tags_EmptyMap(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAPIGatewayV2VPCLink_tags_AddOnUpdate(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAPIGatewayV2VPCLink_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAPIGatewayV2VPCLink_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAPIGatewayV2VPCLink_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAPIGatewayV2VPCLink_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAPIGatewayV2VPCLink_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccAPIGatewayV2VPCLink_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v apigatewayv2.GetVpcLinkOutput resourceName := "aws_apigatewayv2_vpc_link.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appautoscaling/policy.go b/internal/service/appautoscaling/policy.go index 9d7a29aec38a..e80359dc1ccc 100644 --- a/internal/service/appautoscaling/policy.go +++ b/internal/service/appautoscaling/policy.go @@ -307,7 +307,7 @@ func resourcePolicyPut(ctx context.Context, d *schema.ResourceData, meta any) di id := d.Get(names.AttrName).(string) input := expandPutScalingPolicyInput(d) - _, err := tfresource.RetryWhenIsA[*awstypes.FailedResourceAccessException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.FailedResourceAccessException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.PutScalingPolicy(ctx, &input) }) @@ -326,7 +326,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d var diags diag.Diagnostics conn := meta.(*conns.AWSClient).AppAutoScalingClient(ctx) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FailedResourceAccessException](ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FailedResourceAccessException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return findScalingPolicyByFourPartKey(ctx, conn, d.Get(names.AttrName).(string), d.Get("service_namespace").(string), d.Get(names.AttrResourceID).(string), d.Get("scalable_dimension").(string)) }) @@ -371,7 +371,7 @@ func resourcePolicyDelete(ctx context.Context, d *schema.ResourceData, meta any) ServiceNamespace: awstypes.ServiceNamespace(d.Get("service_namespace").(string)), } - _, err := tfresource.RetryWhenIsA[*awstypes.FailedResourceAccessException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.FailedResourceAccessException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteScalingPolicy(ctx, &input) }) diff --git a/internal/service/appautoscaling/scheduled_action.go b/internal/service/appautoscaling/scheduled_action.go index 2d09b820297a..a67fe916745d 100644 --- a/internal/service/appautoscaling/scheduled_action.go +++ b/internal/service/appautoscaling/scheduled_action.go @@ -160,7 +160,7 @@ func resourceScheduledActionPut(ctx context.Context, d *schema.ResourceData, met const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.ObjectNotFoundException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ObjectNotFoundException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.PutScheduledAction(ctx, &input) }) diff --git a/internal/service/appautoscaling/service_endpoint_resolver_gen.go b/internal/service/appautoscaling/service_endpoint_resolver_gen.go index c5ef078ea28f..07485e8ec738 100644 --- a/internal/service/appautoscaling/service_endpoint_resolver_gen.go +++ b/internal/service/appautoscaling/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params applicationautos }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up applicationautoscaling endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up applicationautoscaling endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index 6c3db34869e1..bfefcc1e8f82 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -604,7 +604,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appautoscaling/target_tags_gen_test.go b/internal/service/appautoscaling/target_tags_gen_test.go index 993eab495db4..f4a5a1fc6270 100644 --- a/internal/service/appautoscaling/target_tags_gen_test.go +++ b/internal/service/appautoscaling/target_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAppAutoScalingTarget_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -204,6 +205,7 @@ func TestAccAppAutoScalingTarget_tags(t *testing.T) { func TestAccAppAutoScalingTarget_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccAppAutoScalingTarget_tags_null(t *testing.T) { func TestAccAppAutoScalingTarget_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -336,6 +339,7 @@ func TestAccAppAutoScalingTarget_tags_EmptyMap(t *testing.T) { func TestAccAppAutoScalingTarget_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -420,6 +424,7 @@ func TestAccAppAutoScalingTarget_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Target does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -513,6 +518,7 @@ func TestAccAppAutoScalingTarget_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Target does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -654,6 +660,7 @@ func TestAccAppAutoScalingTarget_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Target does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -744,6 +751,7 @@ func TestAccAppAutoScalingTarget_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppAutoScalingTarget_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -929,6 +937,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppAutoScalingTarget_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1092,6 +1101,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppAutoScalingTarget_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1271,6 +1281,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppAutoScalingTarget_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1362,6 +1373,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccAppAutoScalingTarget_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1454,6 +1466,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource Target does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1522,6 +1535,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_emptyProviderOnlyTag(t *testin t.Skip("Resource Target does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1580,6 +1594,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccAppAutoScalingTarget_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1643,6 +1658,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccAppAutoScalingTarget_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1706,6 +1722,7 @@ func TestAccAppAutoScalingTarget_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccAppAutoScalingTarget_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1762,6 +1779,7 @@ func TestAccAppAutoScalingTarget_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppAutoScalingTarget_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1860,6 +1878,7 @@ func TestAccAppAutoScalingTarget_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppAutoScalingTarget_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1948,6 +1967,7 @@ func TestAccAppAutoScalingTarget_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAppAutoScalingTarget_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2110,6 +2130,7 @@ func TestAccAppAutoScalingTarget_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccAppAutoScalingTarget_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ScalableTarget resourceName := "aws_appautoscaling_target.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/application_tags_gen_test.go b/internal/service/appconfig/application_tags_gen_test.go index db5b57d8559e..32d94c0b3121 100644 --- a/internal/service/appconfig/application_tags_gen_test.go +++ b/internal/service/appconfig/application_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigApplication_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppConfigApplication_tags(t *testing.T) { func TestAccAppConfigApplication_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppConfigApplication_tags_null(t *testing.T) { func TestAccAppConfigApplication_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppConfigApplication_tags_EmptyMap(t *testing.T) { func TestAccAppConfigApplication_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppConfigApplication_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigApplication_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppConfigApplication_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigApplication_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppConfigApplication_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigApplication_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppConfigApplication_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppConfigApplication_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppConfigApplication_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppConfigApplication_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppConfigApplication_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccAppConfigApplication_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccAppConfigApplication_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAppConfigApplication_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccAppConfigApplication_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccAppConfigApplication_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppConfigApplication_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccAppConfigApplication_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppConfigApplication_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppConfigApplication_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppConfigApplication_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigApplication_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppConfigApplication_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAppConfigApplication_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppConfigApplication_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccAppConfigApplication_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/configuration_profile_data_source_tags_gen_test.go b/internal/service/appconfig/configuration_profile_data_source_tags_gen_test.go index a42333970e2c..af05368b49b7 100644 --- a/internal/service/appconfig/configuration_profile_data_source_tags_gen_test.go +++ b/internal/service/appconfig/configuration_profile_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccAppConfigConfigurationProfileDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccAppConfigConfigurationProfileDataSource_tags(t *testing.T) { func TestAccAppConfigConfigurationProfileDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccAppConfigConfigurationProfileDataSource_tags_NullMap(t *testing.T) { func TestAccAppConfigConfigurationProfileDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccAppConfigConfigurationProfileDataSource_tags_EmptyMap(t *testing.T) func TestAccAppConfigConfigurationProfileDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccAppConfigConfigurationProfileDataSource_tags_DefaultTags_nonOverlapp func TestAccAppConfigConfigurationProfileDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccAppConfigConfigurationProfileDataSource_tags_IgnoreTags_Overlap_Defa func TestAccAppConfigConfigurationProfileDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/configuration_profile_tags_gen_test.go b/internal/service/appconfig/configuration_profile_tags_gen_test.go index 13c20db7f11f..4aa91bdc9d3c 100644 --- a/internal/service/appconfig/configuration_profile_tags_gen_test.go +++ b/internal/service/appconfig/configuration_profile_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigConfigurationProfile_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppConfigConfigurationProfile_tags(t *testing.T) { func TestAccAppConfigConfigurationProfile_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppConfigConfigurationProfile_tags_null(t *testing.T) { func TestAccAppConfigConfigurationProfile_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppConfigConfigurationProfile_tags_EmptyMap(t *testing.T) { func TestAccAppConfigConfigurationProfile_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppConfigConfigurationProfile_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnUpdate_Add(t *testing. func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppConfigConfigurationProfile_tags_EmptyTag_OnUpdate_Replace(t *test func TestAccAppConfigConfigurationProfile_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_providerOnly(t *testi func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nonOverlapping(t *tes func TestAccAppConfigConfigurationProfile_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_overlapping(t *testin func TestAccAppConfigConfigurationProfile_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_updateToProviderOnly( func TestAccAppConfigConfigurationProfile_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_updateToResourceOnly( func TestAccAppConfigConfigurationProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_emptyResourceTag(t *t func TestAccAppConfigConfigurationProfile_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_emptyProviderOnlyTag( func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nullOverlappingResour func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppConfigConfigurationProfile_tags_DefaultTags_nullNonOverlappingRes func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnCreate(t *testing.T func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnUpdate_Add(t *testi func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppConfigConfigurationProfile_tags_ComputedTag_OnUpdate_Replace(t *t func TestAccAppConfigConfigurationProfile_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppConfigConfigurationProfile_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccAppConfigConfigurationProfile_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_configuration_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/deployment.go b/internal/service/appconfig/deployment.go index 9225b86b4d6e..df536fc1a4df 100644 --- a/internal/service/appconfig/deployment.go +++ b/internal/service/appconfig/deployment.go @@ -131,7 +131,7 @@ func resourceDeploymentCreate(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 30 * time.Minute // AWS SDK for Go v1 compatibility. ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ConflictException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ConflictException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.StartDeployment(ctx, &input) }) diff --git a/internal/service/appconfig/deployment_strategy_tags_gen_test.go b/internal/service/appconfig/deployment_strategy_tags_gen_test.go index 6d53ea9fdcb5..cf9d7f8f0a7e 100644 --- a/internal/service/appconfig/deployment_strategy_tags_gen_test.go +++ b/internal/service/appconfig/deployment_strategy_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigDeploymentStrategy_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppConfigDeploymentStrategy_tags(t *testing.T) { func TestAccAppConfigDeploymentStrategy_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppConfigDeploymentStrategy_tags_null(t *testing.T) { func TestAccAppConfigDeploymentStrategy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppConfigDeploymentStrategy_tags_EmptyMap(t *testing.T) { func TestAccAppConfigDeploymentStrategy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppConfigDeploymentStrategy_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppConfigDeploymentStrategy_tags_EmptyTag_OnUpdate_Replace(t *testin func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_providerOnly(t *testing func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nonOverlapping(t *testi func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_overlapping(t *testing. func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_updateToProviderOnly(t func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_updateToResourceOnly(t func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_emptyResourceTag(t *tes func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nullOverlappingResource func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppConfigDeploymentStrategy_tags_DefaultTags_nullNonOverlappingResou func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnCreate(t *testing.T) func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnUpdate_Add(t *testing func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppConfigDeploymentStrategy_tags_ComputedTag_OnUpdate_Replace(t *tes func TestAccAppConfigDeploymentStrategy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppConfigDeploymentStrategy_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccAppConfigDeploymentStrategy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment_strategy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/deployment_tags_gen_test.go b/internal/service/appconfig/deployment_tags_gen_test.go index 4c04b1c0284d..d9be4c3648cc 100644 --- a/internal/service/appconfig/deployment_tags_gen_test.go +++ b/internal/service/appconfig/deployment_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigDeployment_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -210,6 +211,7 @@ func TestAccAppConfigDeployment_tags(t *testing.T) { func TestAccAppConfigDeployment_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -279,6 +281,7 @@ func TestAccAppConfigDeployment_tags_null(t *testing.T) { func TestAccAppConfigDeployment_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -344,6 +347,7 @@ func TestAccAppConfigDeployment_tags_EmptyMap(t *testing.T) { func TestAccAppConfigDeployment_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -427,6 +431,7 @@ func TestAccAppConfigDeployment_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigDeployment_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -521,6 +526,7 @@ func TestAccAppConfigDeployment_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigDeployment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -663,6 +669,7 @@ func TestAccAppConfigDeployment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigDeployment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -754,6 +761,7 @@ func TestAccAppConfigDeployment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppConfigDeployment_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -946,6 +954,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppConfigDeployment_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1114,6 +1123,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppConfigDeployment_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1298,6 +1308,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppConfigDeployment_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1390,6 +1401,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccAppConfigDeployment_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1481,6 +1493,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccAppConfigDeployment_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1548,6 +1561,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAppConfigDeployment_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1607,6 +1621,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccAppConfigDeployment_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1686,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccAppConfigDeployment_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1735,6 +1751,7 @@ func TestAccAppConfigDeployment_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccAppConfigDeployment_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1792,6 +1809,7 @@ func TestAccAppConfigDeployment_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppConfigDeployment_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1891,6 +1909,7 @@ func TestAccAppConfigDeployment_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigDeployment_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1980,6 +1999,7 @@ func TestAccAppConfigDeployment_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAppConfigDeployment_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2141,6 +2161,7 @@ func TestAccAppConfigDeployment_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccAppConfigDeployment_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_deployment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/environment_data_source_tags_gen_test.go b/internal/service/appconfig/environment_data_source_tags_gen_test.go index b29453d87be6..182ed1c2e52a 100644 --- a/internal/service/appconfig/environment_data_source_tags_gen_test.go +++ b/internal/service/appconfig/environment_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccAppConfigEnvironmentDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccAppConfigEnvironmentDataSource_tags(t *testing.T) { func TestAccAppConfigEnvironmentDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccAppConfigEnvironmentDataSource_tags_NullMap(t *testing.T) { func TestAccAppConfigEnvironmentDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccAppConfigEnvironmentDataSource_tags_EmptyMap(t *testing.T) { func TestAccAppConfigEnvironmentDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccAppConfigEnvironmentDataSource_tags_DefaultTags_nonOverlapping(t *te func TestAccAppConfigEnvironmentDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccAppConfigEnvironmentDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccAppConfigEnvironmentDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/environment_tags_gen_test.go b/internal/service/appconfig/environment_tags_gen_test.go index 6bfba413dd44..d7961e7044af 100644 --- a/internal/service/appconfig/environment_tags_gen_test.go +++ b/internal/service/appconfig/environment_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigEnvironment_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppConfigEnvironment_tags(t *testing.T) { func TestAccAppConfigEnvironment_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -259,6 +261,7 @@ func TestAccAppConfigEnvironment_tags_null(t *testing.T) { func TestAccAppConfigEnvironment_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -308,6 +311,7 @@ func TestAccAppConfigEnvironment_tags_EmptyMap(t *testing.T) { func TestAccAppConfigEnvironment_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -387,6 +391,7 @@ func TestAccAppConfigEnvironment_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -476,6 +481,7 @@ func TestAccAppConfigEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -614,6 +620,7 @@ func TestAccAppConfigEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -703,6 +710,7 @@ func TestAccAppConfigEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppConfigEnvironment_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -883,6 +891,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppConfigEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1042,6 +1051,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppConfigEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1217,6 +1227,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppConfigEnvironment_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1306,6 +1317,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccAppConfigEnvironment_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1394,6 +1406,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccAppConfigEnvironment_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1459,6 +1472,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAppConfigEnvironment_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1516,6 +1530,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccAppConfigEnvironment_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1584,6 +1599,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccAppConfigEnvironment_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1670,7 @@ func TestAccAppConfigEnvironment_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccAppConfigEnvironment_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1708,6 +1725,7 @@ func TestAccAppConfigEnvironment_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppConfigEnvironment_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1804,6 +1822,7 @@ func TestAccAppConfigEnvironment_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigEnvironment_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1890,6 +1909,7 @@ func TestAccAppConfigEnvironment_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAppConfigEnvironment_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2051,6 +2071,7 @@ func TestAccAppConfigEnvironment_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccAppConfigEnvironment_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/extension_tags_gen_test.go b/internal/service/appconfig/extension_tags_gen_test.go index 6c48049261af..c15bdea9ca13 100644 --- a/internal/service/appconfig/extension_tags_gen_test.go +++ b/internal/service/appconfig/extension_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppConfigExtension_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppConfigExtension_tags(t *testing.T) { func TestAccAppConfigExtension_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppConfigExtension_tags_null(t *testing.T) { func TestAccAppConfigExtension_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppConfigExtension_tags_EmptyMap(t *testing.T) { func TestAccAppConfigExtension_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppConfigExtension_tags_AddOnUpdate(t *testing.T) { func TestAccAppConfigExtension_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppConfigExtension_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppConfigExtension_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppConfigExtension_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigExtension_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppConfigExtension_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppConfigExtension_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppConfigExtension_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppConfigExtension_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppConfigExtension_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccAppConfigExtension_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccAppConfigExtension_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAppConfigExtension_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccAppConfigExtension_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccAppConfigExtension_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppConfigExtension_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccAppConfigExtension_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppConfigExtension_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppConfigExtension_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppConfigExtension_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppConfigExtension_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppConfigExtension_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAppConfigExtension_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppConfigExtension_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccAppConfigExtension_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_appconfig_extension.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appconfig/service_endpoint_resolver_gen.go b/internal/service/appconfig/service_endpoint_resolver_gen.go index 8c47518f9d81..53bb0aa1927e 100644 --- a/internal/service/appconfig/service_endpoint_resolver_gen.go +++ b/internal/service/appconfig/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appconfig.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appconfig endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appconfig endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index 3ee9c93ea195..e88eab687cc5 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appfabric/app_authorization_tags_gen_test.go b/internal/service/appfabric/app_authorization_tags_gen_test.go index 22a4ff2337c0..28d312066d91 100644 --- a/internal/service/appfabric/app_authorization_tags_gen_test.go +++ b/internal/service/appfabric/app_authorization_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppFabricAppAuthorization_tagsSerial(t *testing.T) { func testAccAppFabricAppAuthorization_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -232,6 +233,7 @@ func testAccAppFabricAppAuthorization_tags(t *testing.T) { func testAccAppFabricAppAuthorization_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -292,6 +294,7 @@ func testAccAppFabricAppAuthorization_tags_null(t *testing.T) { func testAccAppFabricAppAuthorization_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -340,6 +343,7 @@ func testAccAppFabricAppAuthorization_tags_EmptyMap(t *testing.T) { func testAccAppFabricAppAuthorization_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -419,6 +423,7 @@ func testAccAppFabricAppAuthorization_tags_AddOnUpdate(t *testing.T) { func testAccAppFabricAppAuthorization_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -510,6 +515,7 @@ func testAccAppFabricAppAuthorization_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppFabricAppAuthorization_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -649,6 +655,7 @@ func testAccAppFabricAppAuthorization_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppFabricAppAuthorization_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -738,6 +745,7 @@ func testAccAppFabricAppAuthorization_tags_EmptyTag_OnUpdate_Replace(t *testing. func testAccAppFabricAppAuthorization_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -922,6 +930,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_providerOnly(t *testing.T func testAccAppFabricAppAuthorization_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1084,6 +1093,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_nonOverlapping(t *testing func testAccAppFabricAppAuthorization_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1262,6 +1272,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_overlapping(t *testing.T) func testAccAppFabricAppAuthorization_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1351,6 +1362,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_updateToProviderOnly(t *t func testAccAppFabricAppAuthorization_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1439,6 +1451,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_updateToResourceOnly(t *t func testAccAppFabricAppAuthorization_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1505,6 +1518,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_emptyResourceTag(t *testi func testAccAppFabricAppAuthorization_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1563,6 +1577,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_emptyProviderOnlyTag(t *t func testAccAppFabricAppAuthorization_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1630,6 +1645,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_nullOverlappingResourceTa func testAccAppFabricAppAuthorization_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1699,6 +1715,7 @@ func testAccAppFabricAppAuthorization_tags_DefaultTags_nullNonOverlappingResourc func testAccAppFabricAppAuthorization_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1754,6 +1771,7 @@ func testAccAppFabricAppAuthorization_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppFabricAppAuthorization_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1850,6 +1868,7 @@ func testAccAppFabricAppAuthorization_tags_ComputedTag_OnUpdate_Add(t *testing.T func testAccAppFabricAppAuthorization_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -1936,6 +1955,7 @@ func testAccAppFabricAppAuthorization_tags_ComputedTag_OnUpdate_Replace(t *testi func testAccAppFabricAppAuthorization_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" @@ -2094,6 +2114,7 @@ func testAccAppFabricAppAuthorization_tags_IgnoreTags_Overlap_DefaultTag(t *test func testAccAppFabricAppAuthorization_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.AppAuthorization resourceName := "aws_appfabric_app_authorization.test" diff --git a/internal/service/appfabric/app_bundle.go b/internal/service/appfabric/app_bundle.go index 953faf876e80..9bd85faa4e6a 100644 --- a/internal/service/appfabric/app_bundle.go +++ b/internal/service/appfabric/app_bundle.go @@ -34,6 +34,7 @@ import ( // @Testing(generator=false) // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/appfabric/types;awstypes;awstypes.AppBundle") // @Testing(preCheckRegion="us-east-1;ap-northeast-1;eu-west-1") +// @Testing(preIdentityVersion="v5.100.0") func newAppBundleResource(context.Context) (resource.ResourceWithConfigure, error) { r := &appBundleResource{} diff --git a/internal/service/appfabric/app_bundle_identity_gen_test.go b/internal/service/appfabric/app_bundle_identity_gen_test.go index 3b0665ef7d48..98017b970871 100644 --- a/internal/service/appfabric/app_bundle_identity_gen_test.go +++ b/internal/service/appfabric/app_bundle_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccAppFabricAppBundle_Identity_Basic(t *testing.T) { var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func testAccAppFabricAppBundle_Identity_RegionOverride(t *testing.T) { resourceName := "aws_appfabric_app_bundle.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func testAccAppFabricAppBundle_Identity_ExistingResource(t *testing.T) { var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/appfabric/app_bundle_tags_gen_test.go b/internal/service/appfabric/app_bundle_tags_gen_test.go index e76deff3da09..37eef010d654 100644 --- a/internal/service/appfabric/app_bundle_tags_gen_test.go +++ b/internal/service/appfabric/app_bundle_tags_gen_test.go @@ -48,6 +48,7 @@ func testAccAppFabricAppBundle_tagsSerial(t *testing.T) { func testAccAppFabricAppBundle_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -224,6 +225,7 @@ func testAccAppFabricAppBundle_tags(t *testing.T) { func testAccAppFabricAppBundle_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -286,6 +288,7 @@ func testAccAppFabricAppBundle_tags_null(t *testing.T) { func testAccAppFabricAppBundle_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -336,6 +339,7 @@ func testAccAppFabricAppBundle_tags_EmptyMap(t *testing.T) { func testAccAppFabricAppBundle_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -415,6 +419,7 @@ func testAccAppFabricAppBundle_tags_AddOnUpdate(t *testing.T) { func testAccAppFabricAppBundle_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -503,6 +508,7 @@ func testAccAppFabricAppBundle_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppFabricAppBundle_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -639,6 +645,7 @@ func testAccAppFabricAppBundle_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppFabricAppBundle_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -728,6 +735,7 @@ func testAccAppFabricAppBundle_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppFabricAppBundle_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -903,6 +911,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppFabricAppBundle_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1059,6 +1068,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppFabricAppBundle_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1231,6 +1241,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppFabricAppBundle_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1320,6 +1331,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_updateToProviderOnly(t *testing. func testAccAppFabricAppBundle_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1408,6 +1420,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_updateToResourceOnly(t *testing. func testAccAppFabricAppBundle_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1474,6 +1487,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAppFabricAppBundle_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1532,6 +1546,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func testAccAppFabricAppBundle_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1601,6 +1616,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_nullOverlappingResourceTag(t *te func testAccAppFabricAppBundle_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1672,6 +1688,7 @@ func testAccAppFabricAppBundle_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccAppFabricAppBundle_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1727,6 +1744,7 @@ func testAccAppFabricAppBundle_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppFabricAppBundle_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1823,6 +1841,7 @@ func testAccAppFabricAppBundle_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppFabricAppBundle_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -1909,6 +1928,7 @@ func testAccAppFabricAppBundle_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAppFabricAppBundle_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" @@ -2070,6 +2090,7 @@ func testAccAppFabricAppBundle_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccAppFabricAppBundle_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.AppBundle resourceName := "aws_appfabric_app_bundle.test" diff --git a/internal/service/appfabric/app_bundle_test.go b/internal/service/appfabric/app_bundle_test.go index 144f7091b16c..d655d395d2fb 100644 --- a/internal/service/appfabric/app_bundle_test.go +++ b/internal/service/appfabric/app_bundle_test.go @@ -89,6 +89,11 @@ func testAccAppBundle_disappears(t *testing.T) { acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfappfabric.ResourceAppBundle, resourceName), ), ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, }, }, }) diff --git a/internal/service/appfabric/service_endpoint_resolver_gen.go b/internal/service/appfabric/service_endpoint_resolver_gen.go index 6d8411d2afd2..3697752beabe 100644 --- a/internal/service/appfabric/service_endpoint_resolver_gen.go +++ b/internal/service/appfabric/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appfabric.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appfabric endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appfabric endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index e95540d370d7..f3bc612145aa 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appflow/connector_profile_identity_gen_test.go b/internal/service/appflow/connector_profile_identity_gen_test.go index 5a284643fdf0..261bdb2d9f18 100644 --- a/internal/service/appflow/connector_profile_identity_gen_test.go +++ b/internal/service/appflow/connector_profile_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccAppFlowConnectorProfile_Identity_Basic(t *testing.T) { resourceName := "aws_appflow_connector_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -123,7 +123,7 @@ func TestAccAppFlowConnectorProfile_Identity_RegionOverride(t *testing.T) { resourceName := "aws_appflow_connector_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -220,7 +220,7 @@ func TestAccAppFlowConnectorProfile_Identity_ExistingResource_fromV5(t *testing. resourceName := "aws_appflow_connector_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -280,7 +280,7 @@ func TestAccAppFlowConnectorProfile_Identity_ExistingResource_fromV6(t *testing. resourceName := "aws_appflow_connector_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/appflow/flow_identity_gen_test.go b/internal/service/appflow/flow_identity_gen_test.go index f81b7a28c172..3b3057b2392b 100644 --- a/internal/service/appflow/flow_identity_gen_test.go +++ b/internal/service/appflow/flow_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccAppFlowFlow_Identity_Basic(t *testing.T) { resourceName := "aws_appflow_flow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -116,7 +116,7 @@ func TestAccAppFlowFlow_Identity_RegionOverride(t *testing.T) { resourceName := "aws_appflow_flow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -206,7 +206,7 @@ func TestAccAppFlowFlow_Identity_ExistingResource(t *testing.T) { resourceName := "aws_appflow_flow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/appflow/flow_tags_gen_test.go b/internal/service/appflow/flow_tags_gen_test.go index 3eb1d2a6c3a0..e937c03986c0 100644 --- a/internal/service/appflow/flow_tags_gen_test.go +++ b/internal/service/appflow/flow_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAppFlowFlow_tags(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAppFlowFlow_tags(t *testing.T) { func TestAccAppFlowFlow_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAppFlowFlow_tags_null(t *testing.T) { func TestAccAppFlowFlow_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAppFlowFlow_tags_EmptyMap(t *testing.T) { func TestAccAppFlowFlow_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAppFlowFlow_tags_AddOnUpdate(t *testing.T) { func TestAccAppFlowFlow_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAppFlowFlow_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppFlowFlow_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAppFlowFlow_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppFlowFlow_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAppFlowFlow_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccAppFlowFlow_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccAppFlowFlow_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAppFlowFlow_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccAppFlowFlow_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAppFlowFlow_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppFlowFlow_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAppFlowFlow_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppFlowFlow_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAppFlowFlow_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAppFlowFlow_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAppFlowFlow_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAppFlowFlow_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appflow.DescribeFlowOutput resourceName := "aws_appflow_flow.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appflow/service_endpoint_resolver_gen.go b/internal/service/appflow/service_endpoint_resolver_gen.go index 166b2bbf49cc..31148df443d9 100644 --- a/internal/service/appflow/service_endpoint_resolver_gen.go +++ b/internal/service/appflow/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appflow.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appflow endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appflow endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index 26ebfd8bc06e..f9a250cb7265 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appintegrations/event_integration_data_source_tags_gen_test.go b/internal/service/appintegrations/event_integration_data_source_tags_gen_test.go index 407fe0841d52..30e6968f1682 100644 --- a/internal/service/appintegrations/event_integration_data_source_tags_gen_test.go +++ b/internal/service/appintegrations/event_integration_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccAppIntegrationsEventIntegrationDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAppIntegrationsEventIntegrationDataSource_tags(t *testing.T) { func TestAccAppIntegrationsEventIntegrationDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccAppIntegrationsEventIntegrationDataSource_tags_NullMap(t *testing.T) func TestAccAppIntegrationsEventIntegrationDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccAppIntegrationsEventIntegrationDataSource_tags_EmptyMap(t *testing.T func TestAccAppIntegrationsEventIntegrationDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccAppIntegrationsEventIntegrationDataSource_tags_DefaultTags_nonOverla func TestAccAppIntegrationsEventIntegrationDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccAppIntegrationsEventIntegrationDataSource_tags_IgnoreTags_Overlap_De func TestAccAppIntegrationsEventIntegrationDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appintegrations/event_integration_tags_gen_test.go b/internal/service/appintegrations/event_integration_tags_gen_test.go index 37aa93ec9f44..7f0a09fecfe6 100644 --- a/internal/service/appintegrations/event_integration_tags_gen_test.go +++ b/internal/service/appintegrations/event_integration_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccAppIntegrationsEventIntegration_tags(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccAppIntegrationsEventIntegration_tags(t *testing.T) { func TestAccAppIntegrationsEventIntegration_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccAppIntegrationsEventIntegration_tags_null(t *testing.T) { func TestAccAppIntegrationsEventIntegration_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccAppIntegrationsEventIntegration_tags_EmptyMap(t *testing.T) { func TestAccAppIntegrationsEventIntegration_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccAppIntegrationsEventIntegration_tags_AddOnUpdate(t *testing.T) { func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnCreate(t *testing.T) func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnUpdate_Add(t *testin func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccAppIntegrationsEventIntegration_tags_EmptyTag_OnUpdate_Replace(t *te func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_providerOnly(t *tes func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nonOverlapping(t *t func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_overlapping(t *test func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_updateToProviderOnl func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_updateToResourceOnl func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_emptyResourceTag(t func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_emptyProviderOnlyTa func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nullOverlappingReso func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccAppIntegrationsEventIntegration_tags_DefaultTags_nullNonOverlappingR func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnCreate(t *testing func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnUpdate_Add(t *tes func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccAppIntegrationsEventIntegration_tags_ComputedTag_OnUpdate_Replace(t func TestAccAppIntegrationsEventIntegration_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccAppIntegrationsEventIntegration_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccAppIntegrationsEventIntegration_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v appintegrations.GetEventIntegrationOutput resourceName := "aws_appintegrations_event_integration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appintegrations/service_endpoint_resolver_gen.go b/internal/service/appintegrations/service_endpoint_resolver_gen.go index d715dce688a4..21ef14b2c327 100644 --- a/internal/service/appintegrations/service_endpoint_resolver_gen.go +++ b/internal/service/appintegrations/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appintegrations. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appintegrations endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appintegrations endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 82dc31318578..82490c484286 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/applicationinsights/application.go b/internal/service/applicationinsights/application.go index faa2d530ed71..df29bbc7903e 100644 --- a/internal/service/applicationinsights/application.go +++ b/internal/service/applicationinsights/application.go @@ -104,7 +104,7 @@ func resourceApplicationCreate(ctx context.Context, d *schema.ResourceData, meta input.OpsItemSNSTopicArn = aws.String(v.(string)) } - output, err := tfresource.RetryGWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (*applicationinsights.CreateApplicationOutput, error) { + output, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func(ctx context.Context) (*applicationinsights.CreateApplicationOutput, error) { return conn.CreateApplication(ctx, input) }) if err != nil { diff --git a/internal/service/applicationinsights/application_tags_gen_test.go b/internal/service/applicationinsights/application_tags_gen_test.go index 3592a6936843..8dfdbd3cd713 100644 --- a/internal/service/applicationinsights/application_tags_gen_test.go +++ b/internal/service/applicationinsights/application_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccApplicationInsightsApplication_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccApplicationInsightsApplication_tags(t *testing.T) { func TestAccApplicationInsightsApplication_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccApplicationInsightsApplication_tags_null(t *testing.T) { func TestAccApplicationInsightsApplication_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccApplicationInsightsApplication_tags_EmptyMap(t *testing.T) { func TestAccApplicationInsightsApplication_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccApplicationInsightsApplication_tags_AddOnUpdate(t *testing.T) { func TestAccApplicationInsightsApplication_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccApplicationInsightsApplication_tags_EmptyTag_OnCreate(t *testing.T) func TestAccApplicationInsightsApplication_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccApplicationInsightsApplication_tags_EmptyTag_OnUpdate_Add(t *testing func TestAccApplicationInsightsApplication_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccApplicationInsightsApplication_tags_EmptyTag_OnUpdate_Replace(t *tes func TestAccApplicationInsightsApplication_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_providerOnly(t *test func TestAccApplicationInsightsApplication_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_nonOverlapping(t *te func TestAccApplicationInsightsApplication_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_overlapping(t *testi func TestAccApplicationInsightsApplication_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_updateToProviderOnly func TestAccApplicationInsightsApplication_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_updateToResourceOnly func TestAccApplicationInsightsApplication_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_emptyResourceTag(t * func TestAccApplicationInsightsApplication_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_emptyProviderOnlyTag func TestAccApplicationInsightsApplication_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_nullOverlappingResou func TestAccApplicationInsightsApplication_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccApplicationInsightsApplication_tags_DefaultTags_nullNonOverlappingRe func TestAccApplicationInsightsApplication_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccApplicationInsightsApplication_tags_ComputedTag_OnCreate(t *testing. func TestAccApplicationInsightsApplication_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccApplicationInsightsApplication_tags_ComputedTag_OnUpdate_Add(t *test func TestAccApplicationInsightsApplication_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccApplicationInsightsApplication_tags_ComputedTag_OnUpdate_Replace(t * func TestAccApplicationInsightsApplication_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccApplicationInsightsApplication_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccApplicationInsightsApplication_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ApplicationInfo resourceName := "aws_applicationinsights_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/applicationinsights/service_endpoint_resolver_gen.go b/internal/service/applicationinsights/service_endpoint_resolver_gen.go index 36f65e3254b5..7f93ab244d6a 100644 --- a/internal/service/applicationinsights/service_endpoint_resolver_gen.go +++ b/internal/service/applicationinsights/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params applicationinsig }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up applicationinsights endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up applicationinsights endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index b2255ab35258..1a299f99a50c 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/applicationsignals/service_endpoint_resolver_gen.go b/internal/service/applicationsignals/service_endpoint_resolver_gen.go index 07ec75d8062f..0ed834e9e194 100644 --- a/internal/service/applicationsignals/service_endpoint_resolver_gen.go +++ b/internal/service/applicationsignals/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params applicationsigna }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up applicationsignals endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up applicationsignals endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/applicationsignals/service_endpoints_gen_test.go b/internal/service/applicationsignals/service_endpoints_gen_test.go index 2570b5c288f2..75ebc6f92d5b 100644 --- a/internal/service/applicationsignals/service_endpoints_gen_test.go +++ b/internal/service/applicationsignals/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appmesh/gateway_route_data_source_tags_gen_test.go b/internal/service/appmesh/gateway_route_data_source_tags_gen_test.go index a9126198ecaa..a4a0ce2f0533 100644 --- a/internal/service/appmesh/gateway_route_data_source_tags_gen_test.go +++ b/internal/service/appmesh/gateway_route_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshGatewayRouteDataSource_tagsSerial(t *testing.T) { func testAccAppMeshGatewayRouteDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshGatewayRouteDataSource_tags(t *testing.T) { func testAccAppMeshGatewayRouteDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshGatewayRouteDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshGatewayRouteDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshGatewayRouteDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshGatewayRouteDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshGatewayRouteDataSource_tags_DefaultTags_nonOverlapping(t *tes func testAccAppMeshGatewayRouteDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshGatewayRouteDataSource_tags_IgnoreTags_Overlap_DefaultTag(t * func testAccAppMeshGatewayRouteDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/gateway_route_tags_gen_test.go b/internal/service/appmesh/gateway_route_tags_gen_test.go index f597a7d1809d..fba21f54062b 100644 --- a/internal/service/appmesh/gateway_route_tags_gen_test.go +++ b/internal/service/appmesh/gateway_route_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshGatewayRoute_tagsSerial(t *testing.T) { func testAccAppMeshGatewayRoute_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshGatewayRoute_tags(t *testing.T) { func testAccAppMeshGatewayRoute_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshGatewayRoute_tags_null(t *testing.T) { func testAccAppMeshGatewayRoute_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshGatewayRoute_tags_EmptyMap(t *testing.T) { func testAccAppMeshGatewayRoute_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshGatewayRoute_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshGatewayRoute_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshGatewayRoute_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshGatewayRoute_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshGatewayRoute_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshGatewayRoute_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshGatewayRoute_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshGatewayRoute_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshGatewayRoute_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppMeshGatewayRoute_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshGatewayRoute_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_updateToProviderOnly(t *testing func testAccAppMeshGatewayRoute_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_updateToResourceOnly(t *testing func testAccAppMeshGatewayRoute_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_emptyResourceTag(t *testing.T) func testAccAppMeshGatewayRoute_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_emptyProviderOnlyTag(t *testing func testAccAppMeshGatewayRoute_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_nullOverlappingResourceTag(t *t func testAccAppMeshGatewayRoute_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshGatewayRoute_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccAppMeshGatewayRoute_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshGatewayRoute_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshGatewayRoute_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshGatewayRoute_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshGatewayRoute_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshGatewayRoute_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func testAccAppMeshGatewayRoute_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshGatewayRoute_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccAppMeshGatewayRoute_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GatewayRouteData resourceName := "aws_appmesh_gateway_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/mesh_data_source_tags_gen_test.go b/internal/service/appmesh/mesh_data_source_tags_gen_test.go index 5df7ecd99d7d..0faa3a9123e0 100644 --- a/internal/service/appmesh/mesh_data_source_tags_gen_test.go +++ b/internal/service/appmesh/mesh_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshServiceMeshDataSource_tagsSerial(t *testing.T) { func testAccAppMeshServiceMeshDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshServiceMeshDataSource_tags(t *testing.T) { func testAccAppMeshServiceMeshDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshServiceMeshDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshServiceMeshDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshServiceMeshDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshServiceMeshDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshServiceMeshDataSource_tags_DefaultTags_nonOverlapping(t *test func testAccAppMeshServiceMeshDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshServiceMeshDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func testAccAppMeshServiceMeshDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/mesh_tags_gen_test.go b/internal/service/appmesh/mesh_tags_gen_test.go index b5cb6da73a7b..b819d0882f9c 100644 --- a/internal/service/appmesh/mesh_tags_gen_test.go +++ b/internal/service/appmesh/mesh_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshServiceMesh_tagsSerial(t *testing.T) { func testAccAppMeshServiceMesh_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccAppMeshServiceMesh_tags(t *testing.T) { func testAccAppMeshServiceMesh_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -296,6 +298,7 @@ func testAccAppMeshServiceMesh_tags_null(t *testing.T) { func testAccAppMeshServiceMesh_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -359,6 +362,7 @@ func testAccAppMeshServiceMesh_tags_EmptyMap(t *testing.T) { func testAccAppMeshServiceMesh_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -440,6 +444,7 @@ func testAccAppMeshServiceMesh_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshServiceMesh_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -529,6 +534,7 @@ func testAccAppMeshServiceMesh_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshServiceMesh_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -666,6 +672,7 @@ func testAccAppMeshServiceMesh_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshServiceMesh_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -755,6 +762,7 @@ func testAccAppMeshServiceMesh_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshServiceMesh_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -936,6 +944,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshServiceMesh_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1096,6 +1105,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppMeshServiceMesh_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshServiceMesh_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1362,6 +1373,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_updateToProviderOnly(t *testing. func testAccAppMeshServiceMesh_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1451,6 +1463,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_updateToResourceOnly(t *testing. func testAccAppMeshServiceMesh_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1516,6 +1529,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAppMeshServiceMesh_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1573,6 +1587,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func testAccAppMeshServiceMesh_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1635,6 +1650,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_nullOverlappingResourceTag(t *te func testAccAppMeshServiceMesh_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1697,6 +1713,7 @@ func testAccAppMeshServiceMesh_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccAppMeshServiceMesh_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1769,7 @@ func testAccAppMeshServiceMesh_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshServiceMesh_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1849,6 +1867,7 @@ func testAccAppMeshServiceMesh_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshServiceMesh_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1936,6 +1955,7 @@ func testAccAppMeshServiceMesh_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshServiceMesh_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2098,6 +2118,7 @@ func testAccAppMeshServiceMesh_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccAppMeshServiceMesh_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.MeshData resourceName := "aws_appmesh_mesh.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/route_data_source_tags_gen_test.go b/internal/service/appmesh/route_data_source_tags_gen_test.go index 987c13d4a4da..09f14447ca63 100644 --- a/internal/service/appmesh/route_data_source_tags_gen_test.go +++ b/internal/service/appmesh/route_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshRouteDataSource_tagsSerial(t *testing.T) { func testAccAppMeshRouteDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshRouteDataSource_tags(t *testing.T) { func testAccAppMeshRouteDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshRouteDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshRouteDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshRouteDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshRouteDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshRouteDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) func testAccAppMeshRouteDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshRouteDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing func testAccAppMeshRouteDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/route_tags_gen_test.go b/internal/service/appmesh/route_tags_gen_test.go index b702c320ced2..4691acefd423 100644 --- a/internal/service/appmesh/route_tags_gen_test.go +++ b/internal/service/appmesh/route_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshRoute_tagsSerial(t *testing.T) { func testAccAppMeshRoute_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshRoute_tags(t *testing.T) { func testAccAppMeshRoute_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshRoute_tags_null(t *testing.T) { func testAccAppMeshRoute_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshRoute_tags_EmptyMap(t *testing.T) { func testAccAppMeshRoute_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshRoute_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshRoute_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshRoute_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshRoute_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshRoute_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshRoute_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshRoute_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshRoute_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshRoute_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshRoute_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshRoute_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshRoute_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshRoute_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshRoute_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccAppMeshRoute_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshRoute_tags_DefaultTags_nullOverlappingResourceTag(t *testing. func testAccAppMeshRoute_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshRoute_tags_DefaultTags_nullNonOverlappingResourceTag(t *testi func testAccAppMeshRoute_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshRoute_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshRoute_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshRoute_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshRoute_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshRoute_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshRoute_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshRoute_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccAppMeshRoute_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.RouteData resourceName := "aws_appmesh_route.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/service_endpoint_resolver_gen.go b/internal/service/appmesh/service_endpoint_resolver_gen.go index 78f11cbea779..9a59d13b28b1 100644 --- a/internal/service/appmesh/service_endpoint_resolver_gen.go +++ b/internal/service/appmesh/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appmesh.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appmesh endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appmesh endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index e4caa2be256d..a1565eb8e3dd 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appmesh/virtual_gateway_data_source_tags_gen_test.go b/internal/service/appmesh/virtual_gateway_data_source_tags_gen_test.go index 9244034934a4..6a18e5037e27 100644 --- a/internal/service/appmesh/virtual_gateway_data_source_tags_gen_test.go +++ b/internal/service/appmesh/virtual_gateway_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshVirtualGatewayDataSource_tagsSerial(t *testing.T) { func testAccAppMeshVirtualGatewayDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshVirtualGatewayDataSource_tags(t *testing.T) { func testAccAppMeshVirtualGatewayDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshVirtualGatewayDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshVirtualGatewayDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshVirtualGatewayDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualGatewayDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshVirtualGatewayDataSource_tags_DefaultTags_nonOverlapping(t *t func testAccAppMeshVirtualGatewayDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshVirtualGatewayDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func testAccAppMeshVirtualGatewayDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_gateway_tags_gen_test.go b/internal/service/appmesh/virtual_gateway_tags_gen_test.go index a8e37a18042b..7ef20341eb43 100644 --- a/internal/service/appmesh/virtual_gateway_tags_gen_test.go +++ b/internal/service/appmesh/virtual_gateway_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshVirtualGateway_tagsSerial(t *testing.T) { func testAccAppMeshVirtualGateway_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshVirtualGateway_tags(t *testing.T) { func testAccAppMeshVirtualGateway_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshVirtualGateway_tags_null(t *testing.T) { func testAccAppMeshVirtualGateway_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshVirtualGateway_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualGateway_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshVirtualGateway_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshVirtualGateway_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshVirtualGateway_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualGateway_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshVirtualGateway_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualGateway_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshVirtualGateway_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshVirtualGateway_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshVirtualGateway_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_nonOverlapping(t *testing.T) func testAccAppMeshVirtualGateway_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshVirtualGateway_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_updateToProviderOnly(t *testi func testAccAppMeshVirtualGateway_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_updateToResourceOnly(t *testi func testAccAppMeshVirtualGateway_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_emptyResourceTag(t *testing.T func testAccAppMeshVirtualGateway_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_emptyProviderOnlyTag(t *testi func testAccAppMeshVirtualGateway_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_nullOverlappingResourceTag(t func testAccAppMeshVirtualGateway_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshVirtualGateway_tags_DefaultTags_nullNonOverlappingResourceTag func testAccAppMeshVirtualGateway_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshVirtualGateway_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualGateway_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshVirtualGateway_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualGateway_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshVirtualGateway_tags_ComputedTag_OnUpdate_Replace(t *testing.T func testAccAppMeshVirtualGateway_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshVirtualGateway_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func testAccAppMeshVirtualGateway_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualGatewayData resourceName := "aws_appmesh_virtual_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_node_data_source_tags_gen_test.go b/internal/service/appmesh/virtual_node_data_source_tags_gen_test.go index 9c5bfd4001fa..27bb2c29be53 100644 --- a/internal/service/appmesh/virtual_node_data_source_tags_gen_test.go +++ b/internal/service/appmesh/virtual_node_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshVirtualNodeDataSource_tagsSerial(t *testing.T) { func testAccAppMeshVirtualNodeDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshVirtualNodeDataSource_tags(t *testing.T) { func testAccAppMeshVirtualNodeDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshVirtualNodeDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshVirtualNodeDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshVirtualNodeDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualNodeDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshVirtualNodeDataSource_tags_DefaultTags_nonOverlapping(t *test func testAccAppMeshVirtualNodeDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshVirtualNodeDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func testAccAppMeshVirtualNodeDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_node_tags_gen_test.go b/internal/service/appmesh/virtual_node_tags_gen_test.go index 8fff61cb146b..a8393c8ee0a9 100644 --- a/internal/service/appmesh/virtual_node_tags_gen_test.go +++ b/internal/service/appmesh/virtual_node_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshVirtualNode_tagsSerial(t *testing.T) { func testAccAppMeshVirtualNode_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshVirtualNode_tags(t *testing.T) { func testAccAppMeshVirtualNode_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshVirtualNode_tags_null(t *testing.T) { func testAccAppMeshVirtualNode_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshVirtualNode_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualNode_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshVirtualNode_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshVirtualNode_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshVirtualNode_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualNode_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshVirtualNode_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualNode_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshVirtualNode_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshVirtualNode_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshVirtualNode_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppMeshVirtualNode_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshVirtualNode_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_updateToProviderOnly(t *testing. func testAccAppMeshVirtualNode_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_updateToResourceOnly(t *testing. func testAccAppMeshVirtualNode_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccAppMeshVirtualNode_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func testAccAppMeshVirtualNode_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_nullOverlappingResourceTag(t *te func testAccAppMeshVirtualNode_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshVirtualNode_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccAppMeshVirtualNode_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshVirtualNode_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualNode_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshVirtualNode_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualNode_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshVirtualNode_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshVirtualNode_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshVirtualNode_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccAppMeshVirtualNode_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_router_data_source_tags_gen_test.go b/internal/service/appmesh/virtual_router_data_source_tags_gen_test.go index 12fa4d9d3d54..fa829b1fd44f 100644 --- a/internal/service/appmesh/virtual_router_data_source_tags_gen_test.go +++ b/internal/service/appmesh/virtual_router_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshVirtualRouterDataSource_tagsSerial(t *testing.T) { func testAccAppMeshVirtualRouterDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshVirtualRouterDataSource_tags(t *testing.T) { func testAccAppMeshVirtualRouterDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshVirtualRouterDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshVirtualRouterDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshVirtualRouterDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualRouterDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshVirtualRouterDataSource_tags_DefaultTags_nonOverlapping(t *te func testAccAppMeshVirtualRouterDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshVirtualRouterDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func testAccAppMeshVirtualRouterDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_router_tags_gen_test.go b/internal/service/appmesh/virtual_router_tags_gen_test.go index 85a628f73d3a..9bf8bf425db4 100644 --- a/internal/service/appmesh/virtual_router_tags_gen_test.go +++ b/internal/service/appmesh/virtual_router_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshVirtualRouter_tagsSerial(t *testing.T) { func testAccAppMeshVirtualRouter_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshVirtualRouter_tags(t *testing.T) { func testAccAppMeshVirtualRouter_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshVirtualRouter_tags_null(t *testing.T) { func testAccAppMeshVirtualRouter_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshVirtualRouter_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualRouter_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshVirtualRouter_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshVirtualRouter_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshVirtualRouter_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualRouter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshVirtualRouter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualRouter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshVirtualRouter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshVirtualRouter_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshVirtualRouter_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccAppMeshVirtualRouter_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshVirtualRouter_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_updateToProviderOnly(t *testin func testAccAppMeshVirtualRouter_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_updateToResourceOnly(t *testin func testAccAppMeshVirtualRouter_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_emptyResourceTag(t *testing.T) func testAccAppMeshVirtualRouter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_emptyProviderOnlyTag(t *testin func testAccAppMeshVirtualRouter_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_nullOverlappingResourceTag(t * func testAccAppMeshVirtualRouter_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshVirtualRouter_tags_DefaultTags_nullNonOverlappingResourceTag( func testAccAppMeshVirtualRouter_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshVirtualRouter_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualRouter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshVirtualRouter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualRouter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshVirtualRouter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func testAccAppMeshVirtualRouter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshVirtualRouter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func testAccAppMeshVirtualRouter_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualRouterData resourceName := "aws_appmesh_virtual_router.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_service_data_source_tags_gen_test.go b/internal/service/appmesh/virtual_service_data_source_tags_gen_test.go index 5ff326818587..27141adf4f8c 100644 --- a/internal/service/appmesh/virtual_service_data_source_tags_gen_test.go +++ b/internal/service/appmesh/virtual_service_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccAppMeshVirtualServiceDataSource_tagsSerial(t *testing.T) { func testAccAppMeshVirtualServiceDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -64,6 +65,7 @@ func testAccAppMeshVirtualServiceDataSource_tags(t *testing.T) { func testAccAppMeshVirtualServiceDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -88,6 +90,7 @@ func testAccAppMeshVirtualServiceDataSource_tags_NullMap(t *testing.T) { func testAccAppMeshVirtualServiceDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -112,6 +115,7 @@ func testAccAppMeshVirtualServiceDataSource_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualServiceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -144,6 +148,7 @@ func testAccAppMeshVirtualServiceDataSource_tags_DefaultTags_nonOverlapping(t *t func testAccAppMeshVirtualServiceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -182,6 +187,7 @@ func testAccAppMeshVirtualServiceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func testAccAppMeshVirtualServiceDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appmesh/virtual_service_tags_gen_test.go b/internal/service/appmesh/virtual_service_tags_gen_test.go index 269958753d6c..380e14a5fb21 100644 --- a/internal/service/appmesh/virtual_service_tags_gen_test.go +++ b/internal/service/appmesh/virtual_service_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccAppMeshVirtualService_tagsSerial(t *testing.T) { func testAccAppMeshVirtualService_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -233,6 +234,7 @@ func testAccAppMeshVirtualService_tags(t *testing.T) { func testAccAppMeshVirtualService_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -301,6 +303,7 @@ func testAccAppMeshVirtualService_tags_null(t *testing.T) { func testAccAppMeshVirtualService_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -365,6 +368,7 @@ func testAccAppMeshVirtualService_tags_EmptyMap(t *testing.T) { func testAccAppMeshVirtualService_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccAppMeshVirtualService_tags_AddOnUpdate(t *testing.T) { func testAccAppMeshVirtualService_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccAppMeshVirtualService_tags_EmptyTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualService_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccAppMeshVirtualService_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualService_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func testAccAppMeshVirtualService_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccAppMeshVirtualService_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -952,6 +960,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_providerOnly(t *testing.T) { func testAccAppMeshVirtualService_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1115,6 +1124,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_nonOverlapping(t *testing.T) func testAccAppMeshVirtualService_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1304,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_overlapping(t *testing.T) { func testAccAppMeshVirtualService_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1385,6 +1396,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_updateToProviderOnly(t *testi func testAccAppMeshVirtualService_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_updateToResourceOnly(t *testi func testAccAppMeshVirtualService_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_emptyResourceTag(t *testing.T func testAccAppMeshVirtualService_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1599,6 +1613,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_emptyProviderOnlyTag(t *testi func testAccAppMeshVirtualService_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1662,6 +1677,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_nullOverlappingResourceTag(t func testAccAppMeshVirtualService_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1725,6 +1741,7 @@ func testAccAppMeshVirtualService_tags_DefaultTags_nullNonOverlappingResourceTag func testAccAppMeshVirtualService_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1781,6 +1798,7 @@ func testAccAppMeshVirtualService_tags_ComputedTag_OnCreate(t *testing.T) { func testAccAppMeshVirtualService_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1879,6 +1897,7 @@ func testAccAppMeshVirtualService_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccAppMeshVirtualService_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func testAccAppMeshVirtualService_tags_ComputedTag_OnUpdate_Replace(t *testing.T func testAccAppMeshVirtualService_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2129,6 +2149,7 @@ func testAccAppMeshVirtualService_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func testAccAppMeshVirtualService_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualServiceData resourceName := "aws_appmesh_virtual_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/auto_scaling_configuration_version_identity_gen_test.go b/internal/service/apprunner/auto_scaling_configuration_version_identity_gen_test.go index e3559cba26a7..38982e440865 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version_identity_gen_test.go +++ b/internal/service/apprunner/auto_scaling_configuration_version_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccAppRunnerAutoScalingConfigurationVersion_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_Identity_RegionOverride(t * resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_Identity_RegionOverride(t * func TestAccAppRunnerAutoScalingConfigurationVersion_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apprunner/auto_scaling_configuration_version_tags_gen_test.go b/internal/service/apprunner/auto_scaling_configuration_version_tags_gen_test.go index f16594913358..de639f771178 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version_tags_gen_test.go +++ b/internal/service/apprunner/auto_scaling_configuration_version_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerAutoScalingConfigurationVersion_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags(t *testing.T) { func TestAccAppRunnerAutoScalingConfigurationVersion_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_null(t *testing.T) { func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyMap(t *testing.T) func TestAccAppRunnerAutoScalingConfigurationVersion_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_AddOnUpdate(t *testing func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnCreate(t *t func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnUpdate_Add( func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_EmptyTag_OnUpdate_Repl func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_providerOn func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nonOverlap func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_overlappin func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_updateToPr func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_updateToRe func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_emptyResou func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_emptyProvi func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nullOverla func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_DefaultTags_nullNonOve func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnCreate(t func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnUpdate_A func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_ComputedTag_OnUpdate_R func TestAccAppRunnerAutoScalingConfigurationVersion_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags_IgnoreTags_Overlap_Def func TestAccAppRunnerAutoScalingConfigurationVersion_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_auto_scaling_configuration_version.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/connection_tags_gen_test.go b/internal/service/apprunner/connection_tags_gen_test.go index b3a88e5eeded..15ef7cca948c 100644 --- a/internal/service/apprunner/connection_tags_gen_test.go +++ b/internal/service/apprunner/connection_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerConnection_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerConnection_tags(t *testing.T) { func TestAccAppRunnerConnection_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerConnection_tags_null(t *testing.T) { func TestAccAppRunnerConnection_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerConnection_tags_EmptyMap(t *testing.T) { func TestAccAppRunnerConnection_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerConnection_tags_AddOnUpdate(t *testing.T) { func TestAccAppRunnerConnection_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerConnection_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppRunnerConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppRunnerConnection_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppRunnerConnection_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppRunnerConnection_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppRunnerConnection_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccAppRunnerConnection_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccAppRunnerConnection_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccAppRunnerConnection_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccAppRunnerConnection_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccAppRunnerConnection_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerConnection_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccAppRunnerConnection_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerConnection_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppRunnerConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerConnection_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerConnection_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccAppRunnerConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccAppRunnerConnection_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/observability_configuration_identity_gen_test.go b/internal/service/apprunner/observability_configuration_identity_gen_test.go index 2d0b1bb8e825..762f97c6cb3e 100644 --- a/internal/service/apprunner/observability_configuration_identity_gen_test.go +++ b/internal/service/apprunner/observability_configuration_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccAppRunnerObservabilityConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccAppRunnerObservabilityConfiguration_Identity_RegionOverride(t *testi resourceName := "aws_apprunner_observability_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccAppRunnerObservabilityConfiguration_Identity_RegionOverride(t *testi func TestAccAppRunnerObservabilityConfiguration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apprunner/observability_configuration_tags_gen_test.go b/internal/service/apprunner/observability_configuration_tags_gen_test.go index 927dccc9ef89..8980ff088dc4 100644 --- a/internal/service/apprunner/observability_configuration_tags_gen_test.go +++ b/internal/service/apprunner/observability_configuration_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerObservabilityConfiguration_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags(t *testing.T) { func TestAccAppRunnerObservabilityConfiguration_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_null(t *testing.T) { func TestAccAppRunnerObservabilityConfiguration_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_EmptyMap(t *testing.T) { func TestAccAppRunnerObservabilityConfiguration_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_AddOnUpdate(t *testing.T) { func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnCreate(t *testin func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnUpdate_Add(t *te func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_EmptyTag_OnUpdate_Replace(t func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_providerOnly(t func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nonOverlapping( func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_overlapping(t * func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_updateToProvide func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_updateToResourc func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_emptyResourceTa func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_emptyProviderOn func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nullOverlapping func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_DefaultTags_nullNonOverlapp func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnCreate(t *tes func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnUpdate_Add(t func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_ComputedTag_OnUpdate_Replac func TestAccAppRunnerObservabilityConfiguration_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags_IgnoreTags_Overlap_DefaultT func TestAccAppRunnerObservabilityConfiguration_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_observability_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/service_endpoint_resolver_gen.go b/internal/service/apprunner/service_endpoint_resolver_gen.go index cb153b853ab2..b1949a588200 100644 --- a/internal/service/apprunner/service_endpoint_resolver_gen.go +++ b/internal/service/apprunner/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params apprunner.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up apprunner endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up apprunner endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index 78c1ae32dba0..8d2d37e42690 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/apprunner/service_identity_gen_test.go b/internal/service/apprunner/service_identity_gen_test.go index d35a5595bbaa..f65d896b6609 100644 --- a/internal/service/apprunner/service_identity_gen_test.go +++ b/internal/service/apprunner/service_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccAppRunnerService_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccAppRunnerService_Identity_RegionOverride(t *testing.T) { resourceName := "aws_apprunner_service.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccAppRunnerService_Identity_RegionOverride(t *testing.T) { func TestAccAppRunnerService_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apprunner/service_tags_gen_test.go b/internal/service/apprunner/service_tags_gen_test.go index 21aa865434b7..47939e22ba2b 100644 --- a/internal/service/apprunner/service_tags_gen_test.go +++ b/internal/service/apprunner/service_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerService_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerService_tags(t *testing.T) { func TestAccAppRunnerService_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerService_tags_null(t *testing.T) { func TestAccAppRunnerService_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerService_tags_EmptyMap(t *testing.T) { func TestAccAppRunnerService_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerService_tags_AddOnUpdate(t *testing.T) { func TestAccAppRunnerService_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerService_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppRunnerService_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerService_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerService_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerService_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppRunnerService_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerService_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppRunnerService_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerService_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccAppRunnerService_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerService_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppRunnerService_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerService_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccAppRunnerService_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerService_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccAppRunnerService_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerService_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccAppRunnerService_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerService_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccAppRunnerService_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerService_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccAppRunnerService_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerService_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccAppRunnerService_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerService_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppRunnerService_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerService_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerService_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerService_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccAppRunnerService_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerService_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccAppRunnerService_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_service.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/vpc_connector_identity_gen_test.go b/internal/service/apprunner/vpc_connector_identity_gen_test.go index 44864105d0c6..e27d7f7b3c83 100644 --- a/internal/service/apprunner/vpc_connector_identity_gen_test.go +++ b/internal/service/apprunner/vpc_connector_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccAppRunnerVPCConnector_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccAppRunnerVPCConnector_Identity_RegionOverride(t *testing.T) { resourceName := "aws_apprunner_vpc_connector.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccAppRunnerVPCConnector_Identity_RegionOverride(t *testing.T) { func TestAccAppRunnerVPCConnector_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apprunner/vpc_connector_tags_gen_test.go b/internal/service/apprunner/vpc_connector_tags_gen_test.go index 4bc4c15abf10..58f802623818 100644 --- a/internal/service/apprunner/vpc_connector_tags_gen_test.go +++ b/internal/service/apprunner/vpc_connector_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerVPCConnector_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerVPCConnector_tags(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerVPCConnector_tags_null(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerVPCConnector_tags_EmptyMap(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerVPCConnector_tags_AddOnUpdate(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerVPCConnector_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccAppRunnerVPCConnector_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_overlapping(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccAppRunnerVPCConnector_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccAppRunnerVPCConnector_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccAppRunnerVPCConnector_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccAppRunnerVPCConnector_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccAppRunnerVPCConnector_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerVPCConnector_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerVPCConnector_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccAppRunnerVPCConnector_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerVPCConnector_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccAppRunnerVPCConnector_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_connector.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/apprunner/vpc_ingress_connection_identity_gen_test.go b/internal/service/apprunner/vpc_ingress_connection_identity_gen_test.go index be36136e8151..8560b9b204f1 100644 --- a/internal/service/apprunner/vpc_ingress_connection_identity_gen_test.go +++ b/internal/service/apprunner/vpc_ingress_connection_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccAppRunnerVPCIngressConnection_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccAppRunnerVPCIngressConnection_Identity_RegionOverride(t *testing.T) resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccAppRunnerVPCIngressConnection_Identity_RegionOverride(t *testing.T) func TestAccAppRunnerVPCIngressConnection_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/apprunner/vpc_ingress_connection_tags_gen_test.go b/internal/service/apprunner/vpc_ingress_connection_tags_gen_test.go index 5acfa25437ec..76768d5db5bb 100644 --- a/internal/service/apprunner/vpc_ingress_connection_tags_gen_test.go +++ b/internal/service/apprunner/vpc_ingress_connection_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccAppRunnerVPCIngressConnection_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccAppRunnerVPCIngressConnection_tags(t *testing.T) { func TestAccAppRunnerVPCIngressConnection_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_null(t *testing.T) { func TestAccAppRunnerVPCIngressConnection_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_EmptyMap(t *testing.T) { func TestAccAppRunnerVPCIngressConnection_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_AddOnUpdate(t *testing.T) { func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnUpdate_Add(t *testing. func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_EmptyTag_OnUpdate_Replace(t *test func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_providerOnly(t *testi func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nonOverlapping(t *tes func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_overlapping(t *testin func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_updateToProviderOnly( func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_updateToResourceOnly( func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_emptyResourceTag(t *t func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_emptyProviderOnlyTag( func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nullOverlappingResour func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_DefaultTags_nullNonOverlappingRes func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnCreate(t *testing.T func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnUpdate_Add(t *testi func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_ComputedTag_OnUpdate_Replace(t *t func TestAccAppRunnerVPCIngressConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccAppRunnerVPCIngressConnection_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccAppRunnerVPCIngressConnection_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_apprunner_vpc_ingress_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/appstream/fleet_stack_association.go b/internal/service/appstream/fleet_stack_association.go index 9059a42ce863..f1f3a65b9f34 100644 --- a/internal/service/appstream/fleet_stack_association.go +++ b/internal/service/appstream/fleet_stack_association.go @@ -63,7 +63,7 @@ func resourceFleetStackAssociationCreate(ctx context.Context, d *schema.Resource const ( timeout = 15 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.ResourceNotFoundException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceNotFoundException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.AssociateFleet(ctx, &input) }) diff --git a/internal/service/appstream/service_endpoint_resolver_gen.go b/internal/service/appstream/service_endpoint_resolver_gen.go index 4937a6a51bc4..082fc0497f38 100644 --- a/internal/service/appstream/service_endpoint_resolver_gen.go +++ b/internal/service/appstream/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appstream.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appstream endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appstream endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index de45d3e3a658..040820cfc9ad 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appstream/stack.go b/internal/service/appstream/stack.go index ef59cec4d40a..9c1966185cd4 100644 --- a/internal/service/appstream/stack.go +++ b/internal/service/appstream/stack.go @@ -301,7 +301,7 @@ func resourceStackCreate(ctx context.Context, d *schema.ResourceData, meta any) input.UserSettings = expandUserSettings(v.(*schema.Set).List()) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ResourceNotFoundException](ctx, stackOperationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceNotFoundException](ctx, stackOperationTimeout, func(ctx context.Context) (any, error) { return conn.CreateStack(ctx, &input) }) diff --git a/internal/service/appsync/api.go b/internal/service/appsync/api.go new file mode 100644 index 000000000000..5610f58be780 --- /dev/null +++ b/internal/service/appsync/api.go @@ -0,0 +1,482 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appsync + +import ( + "context" + + "github.com/YakDriver/regexache" + "github.com/YakDriver/smarterr" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/appsync" + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/smerr" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource("aws_appsync_api", name="API") +// @Tags(identifierAttribute="api_arn") +// @Testing(importStateIdAttribute="api_id") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/appsync/types;awstypes;awstypes.Api") +// @Testing(hasNoPreExistingResource=true) +func newAPIResource(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &apiResource{} + + return r, nil +} + +type apiResource struct { + framework.ResourceWithModel[apiResourceModel] +} + +func (r *apiResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "api_arn": framework.ARNAttributeComputedOnly(), + "api_id": framework.IDAttribute(), + "dns": schema.MapAttribute{ + CustomType: fwtypes.MapOfStringType, + Computed: true, + PlanModifiers: []planmodifier.Map{ + mapplanmodifier.UseStateForUnknown(), + }, + }, + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 50), + stringvalidator.RegexMatches(regexache.MustCompile(`^[A-Za-z0-9_\-\ ]+$`), ""), + }, + }, + "owner_contact": schema.StringAttribute{ + Optional: true, + }, + names.AttrTags: tftags.TagsAttribute(), + names.AttrTagsAll: tftags.TagsAttributeComputedOnly(), + "waf_web_acl_arn": schema.StringAttribute{ + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "xray_enabled": schema.BoolAttribute{ + Computed: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, + }, + Blocks: map[string]schema.Block{ + "event_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[eventConfigModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "auth_provider": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authProviderModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + Blocks: map[string]schema.Block{ + "cognito_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[cognitoConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "app_id_client_regex": schema.StringAttribute{ + Optional: true, + }, + "aws_region": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + fwvalidators.AWSRegion(), + }, + }, + names.AttrUserPoolID: schema.StringAttribute{ + Required: true, + }, + }, + }, + }, + "lambda_authorizer_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[lambdaAuthorizerConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "authorizer_result_ttl_in_seconds": schema.Int64Attribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Int64{ + int64planmodifier.UseStateForUnknown(), + }, + }, + "authorizer_uri": schema.StringAttribute{ + Required: true, + }, + "identity_validation_expression": schema.StringAttribute{ + Optional: true, + }, + }, + }, + }, + "openid_connect_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[openIDConnectConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_ttl": schema.Int64Attribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Int64{ + int64planmodifier.UseStateForUnknown(), + }, + }, + names.AttrClientID: schema.StringAttribute{ + Optional: true, + }, + "iat_ttl": schema.Int64Attribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Int64{ + int64planmodifier.UseStateForUnknown(), + }, + }, + names.AttrIssuer: schema.StringAttribute{ + Required: true, + }, + }, + }, + }, + }, + }, + }, + "connection_auth_mode": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authModeModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + }, + }, + "default_publish_auth_mode": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authModeModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + }, + }, + "default_subscribe_auth_mode": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authModeModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + }, + }, + "log_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[eventLogConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "cloudwatch_logs_role_arn": schema.StringAttribute{ + CustomType: fwtypes.ARNType, + Required: true, + }, + "log_level": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.EventLogLevel](), + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func (r *apiResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data apiResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.Plan.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + name := fwflex.StringValueFromFramework(ctx, data.Name) + var input appsync.CreateApiInput + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Expand(ctx, data, &input)) + if response.Diagnostics.HasError() { + return + } + + // Additional fields. + input.Tags = getTagsIn(ctx) + + output, err := conn.CreateApi(ctx, &input) + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, name) + return + } + + // Set values for unknowns. + api := output.Api + apiID := aws.ToString(api.ApiId) + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Flatten(ctx, api, &data), smerr.ID, name) + if response.Diagnostics.HasError() { + return + } + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, data), smerr.ID, apiID) +} + +func (r *apiResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data apiResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + apiID := fwflex.StringValueFromFramework(ctx, data.ApiID) + output, err := findAPIByID(ctx, conn, apiID) + + if tfresource.NotFound(err) { + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + return + } + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, apiID) + return + } + + // Set attributes for import. + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Flatten(ctx, output, &data), smerr.ID, apiID) + if response.Diagnostics.HasError() { + return + } + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, &data), smerr.ID, apiID) +} + +func (r *apiResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old apiResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.Plan.Get(ctx, &new)) + if response.Diagnostics.HasError() { + return + } + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &old)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + apiID := fwflex.StringValueFromFramework(ctx, new.ApiID) + diff, d := fwflex.Diff(ctx, new, old) + smerr.EnrichAppend(ctx, &response.Diagnostics, d, smerr.ID, apiID) + if response.Diagnostics.HasError() { + return + } + + if diff.HasChanges() { + var input appsync.UpdateApiInput + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Expand(ctx, new, &input), smerr.ID, apiID) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateApi(ctx, &input) + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, apiID) + return + } + } + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, &new), smerr.ID, apiID) +} + +func (r *apiResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data apiResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + apiID := fwflex.StringValueFromFramework(ctx, data.ApiID) + input := appsync.DeleteApiInput{ + ApiId: aws.String(apiID), + } + _, err := conn.DeleteApi(ctx, &input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return + } + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, apiID) + return + } +} + +func (r *apiResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("api_id"), request, response) +} + +func findAPIByID(ctx context.Context, conn *appsync.Client, id string) (*awstypes.Api, error) { + input := appsync.GetApiInput{ + ApiId: aws.String(id), + } + + return findAPI(ctx, conn, &input) +} + +func findAPI(ctx context.Context, conn *appsync.Client, input *appsync.GetApiInput) (*awstypes.Api, error) { + output, err := conn.GetApi(ctx, input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, smarterr.NewError(&retry.NotFoundError{ + LastError: err, + }) + } + + if err != nil { + return nil, smarterr.NewError(err) + } + + if output == nil || output.Api == nil { + return nil, smarterr.NewError(tfresource.NewEmptyResultError(input)) + } + + return output.Api, nil +} + +type apiResourceModel struct { + framework.WithRegionModel + ApiARN types.String `tfsdk:"api_arn"` + ApiID types.String `tfsdk:"api_id"` + DNS fwtypes.MapOfString `tfsdk:"dns"` + EventConfig fwtypes.ListNestedObjectValueOf[eventConfigModel] `tfsdk:"event_config"` + Name types.String `tfsdk:"name"` + OwnerContact types.String `tfsdk:"owner_contact"` + Tags tftags.Map `tfsdk:"tags"` + TagsAll tftags.Map `tfsdk:"tags_all"` + WAFWebAclARN types.String `tfsdk:"waf_web_acl_arn"` + XRayEnabled types.Bool `tfsdk:"xray_enabled"` +} + +type eventConfigModel struct { + AuthProviders fwtypes.ListNestedObjectValueOf[authProviderModel] `tfsdk:"auth_provider"` + ConnectionAuthModes fwtypes.ListNestedObjectValueOf[authModeModel] `tfsdk:"connection_auth_mode"` + DefaultPublishAuthModes fwtypes.ListNestedObjectValueOf[authModeModel] `tfsdk:"default_publish_auth_mode"` + DefaultSubscribeAuthModes fwtypes.ListNestedObjectValueOf[authModeModel] `tfsdk:"default_subscribe_auth_mode"` + LogConfig fwtypes.ListNestedObjectValueOf[eventLogConfigModel] `tfsdk:"log_config"` +} + +type authProviderModel struct { + AuthType fwtypes.StringEnum[awstypes.AuthenticationType] `tfsdk:"auth_type"` + CognitoConfig fwtypes.ListNestedObjectValueOf[cognitoConfigModel] `tfsdk:"cognito_config"` + LambdaAuthorizerConfig fwtypes.ListNestedObjectValueOf[lambdaAuthorizerConfigModel] `tfsdk:"lambda_authorizer_config"` + OpenIDConnectConfig fwtypes.ListNestedObjectValueOf[openIDConnectConfigModel] `tfsdk:"openid_connect_config"` +} + +type authModeModel struct { + AuthType fwtypes.StringEnum[awstypes.AuthenticationType] `tfsdk:"auth_type"` +} + +type cognitoConfigModel struct { + AppIDClientRegex types.String `tfsdk:"app_id_client_regex"` + AWSRegion types.String `tfsdk:"aws_region"` + UserPoolID types.String `tfsdk:"user_pool_id"` +} + +type lambdaAuthorizerConfigModel struct { + AuthorizerResultTTLInSeconds types.Int64 `tfsdk:"authorizer_result_ttl_in_seconds"` + AuthorizerURI types.String `tfsdk:"authorizer_uri"` + IdentityValidationExpression types.String `tfsdk:"identity_validation_expression"` +} + +type openIDConnectConfigModel struct { + AuthTTL types.Int64 `tfsdk:"auth_ttl"` + ClientID types.String `tfsdk:"client_id"` + IatTTL types.Int64 `tfsdk:"iat_ttl"` + Issuer types.String `tfsdk:"issuer"` +} + +type eventLogConfigModel struct { + CloudWatchLogsRoleArn fwtypes.ARN `tfsdk:"cloudwatch_logs_role_arn"` + LogLevel fwtypes.StringEnum[awstypes.EventLogLevel] `tfsdk:"log_level"` +} diff --git a/internal/service/appsync/api_tags_gen_test.go b/internal/service/appsync/api_tags_gen_test.go new file mode 100644 index 000000000000..b2ee91fa2fde --- /dev/null +++ b/internal/service/appsync/api_tags_gen_test.go @@ -0,0 +1,2341 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +package appsync_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccAppSyncAPI_tags(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_null(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_EmptyMap(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_AddOnUpdate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_EmptyTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_EmptyTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_providerOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_nonOverlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_overlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_updateToProviderOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_updateToResourceOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_emptyResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateVerifyIgnore: []string{ + "tags.resourcekey1", // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_ComputedTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_ComputedTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsKey1, "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey(acctest.CtKey1)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 2: Update ignored tag only + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Again), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncAPI_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Api + resourceName := "aws_appsync_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 2: Update ignored tag + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/API/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} diff --git a/internal/service/appsync/api_test.go b/internal/service/appsync/api_test.go new file mode 100644 index 000000000000..a85bc4355973 --- /dev/null +++ b/internal/service/appsync/api_test.go @@ -0,0 +1,451 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appsync_test + +import ( + "context" + "fmt" + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccAppSyncAPI_basic(t *testing.T) { + ctx := acctest.Context(t) + var api awstypes.Api + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_api.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAPIConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &api), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "event_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.auth_type", "API_KEY"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.cognito_config.#", "0"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.lambda_authorizer_config.#", "0"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.openid_connect_config.#", "0"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.connection_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.connection_auth_mode.0.auth_type", "API_KEY"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_publish_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_publish_auth_mode.0.auth_type", "API_KEY"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_subscribe_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_subscribe_auth_mode.0.auth_type", "API_KEY"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.log_config.#", "0"), + resource.TestCheckNoResourceAttr(resourceName, "owner_contact"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + }, + }, + }) +} + +func TestAccAppSyncAPI_comprehensive(t *testing.T) { + ctx := acctest.Context(t) + var api awstypes.Api + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_api.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAPIConfig_eventConfigComprehensive(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &api), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "owner_contact", acctest.DefaultEmailAddress), + resource.TestCheckResourceAttr(resourceName, "event_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.#", "3"), + // Cognito auth provider + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.auth_type", "AMAZON_COGNITO_USER_POOLS"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.0.cognito_config.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "event_config.0.auth_provider.0.cognito_config.0.user_pool_id"), + resource.TestCheckResourceAttrSet(resourceName, "event_config.0.auth_provider.0.cognito_config.0.aws_region"), + // Lambda auth provider + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.1.auth_type", "AWS_LAMBDA"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.1.lambda_authorizer_config.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "event_config.0.auth_provider.1.lambda_authorizer_config.0.authorizer_uri"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.1.lambda_authorizer_config.0.authorizer_result_ttl_in_seconds", "300"), + // OpenID Connect auth provider + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.2.auth_type", "OPENID_CONNECT"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.2.openid_connect_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.2.openid_connect_config.0.issuer", "https://example.com"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.2.openid_connect_config.0.client_id", "test-client-id"), + // Auth modes + resource.TestCheckResourceAttr(resourceName, "event_config.0.connection_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.connection_auth_mode.0.auth_type", "AWS_LAMBDA"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_publish_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_publish_auth_mode.0.auth_type", "AWS_LAMBDA"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_subscribe_auth_mode.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.default_subscribe_auth_mode.0.auth_type", "AWS_LAMBDA"), + // Log config + resource.TestCheckResourceAttr(resourceName, "event_config.0.log_config.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "event_config.0.log_config.0.cloudwatch_logs_role_arn"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.log_config.0.log_level", "ERROR"), + // Tags + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "test"), + resource.TestCheckResourceAttr(resourceName, "tags.Purpose", "event-api-testing"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsAllPercent, "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.Environment", "test"), + resource.TestCheckResourceAttr(resourceName, "tags_all.Purpose", "event-api-testing"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + }, + }, + }) +} + +func TestAccAppSyncAPI_update(t *testing.T) { + ctx := acctest.Context(t) + var api awstypes.Api + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rNameUpdated := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_api.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAPIConfig_eventConfigComprehensive(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &api), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "owner_contact", acctest.DefaultEmailAddress), + resource.TestCheckResourceAttr(resourceName, "event_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.#", "3"), + ), + }, + { + Config: testAccAPIConfig_eventConfigComprehensive(rNameUpdated), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &api), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rNameUpdated), + resource.TestCheckResourceAttr(resourceName, "owner_contact", acctest.DefaultEmailAddress), + resource.TestCheckResourceAttr(resourceName, "event_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_config.0.auth_provider.#", "3"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "api_id", + ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, "api_id"), + }, + }, + }) +} +func TestAccAppSyncAPI_disappears(t *testing.T) { + ctx := acctest.Context(t) + var api awstypes.Api + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_api.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAPIConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAPIExists(ctx, resourceName, &api), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfappsync.ResourceAPI, resourceName), + ), + ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + }, + }, + }) +} + +func testAccCheckAPIDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).AppSyncClient(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_appsync_api" { + continue + } + + _, err := tfappsync.FindAPIByID(ctx, conn, rs.Primary.Attributes["api_id"]) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("AppSync API %s still exists", rs.Primary.Attributes["api_id"]) + } + + return nil + } +} + +func testAccCheckAPIExists(ctx context.Context, n string, v *awstypes.Api) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).AppSyncClient(ctx) + + output, err := tfappsync.FindAPIByID(ctx, conn, rs.Primary.Attributes["api_id"]) + + if err != nil { + return err + } + + *v = *output + + return nil + } +} + +func testAccAPIConfig_basic(rName string) string { + return fmt.Sprintf(` +resource "aws_appsync_api" "test" { + name = %[1]q + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } +} +`, rName) +} + +func testAccAPIConfig_eventConfigComprehensive(rName string) string { + return fmt.Sprintf(` +data "aws_partition" "current" {} + +resource "aws_cognito_user_pool" "test" { + name = %[1]q +} + +resource "aws_iam_role" "lambda" { + name = "%[1]s-lambda" + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [ + { + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "lambda.amazonaws.com" + } + } + ] + }) +} + +data "aws_iam_policy_document" "lambda_basic" { + statement { + effect = "Allow" + actions = [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ] + resources = ["arn:${data.aws_partition.current.partition}:logs:*:*:*"] + } +} + +resource "aws_iam_role_policy" "lambda_basic" { + name = "%[1]s-lambda-basic" + role = aws_iam_role.lambda.id + policy = data.aws_iam_policy_document.lambda_basic.json +} + +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = %[1]q + role = aws_iam_role.lambda.arn + handler = "index.handler" + runtime = "nodejs18.x" + source_code_hash = filebase64sha256("test-fixtures/lambdatest.zip") + + depends_on = [aws_iam_role_policy.lambda_basic] +} + +resource "aws_lambda_permission" "appsync_invoke" { + statement_id = "AllowExecutionFromAppSync" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "appsync.amazonaws.com" +} + +resource "aws_iam_role" "cloudwatch" { + name = "%[1]s-cloudwatch" + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [ + { + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "appsync.amazonaws.com" + } + } + ] + }) +} + +data "aws_iam_policy_document" "cloudwatch_logs" { + statement { + effect = "Allow" + actions = [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ] + resources = ["arn:${data.aws_partition.current.partition}:logs:*:*:*"] + } +} + +resource "aws_iam_role_policy" "cloudwatch" { + name = "%[1]s-cloudwatch-policy" + role = aws_iam_role.cloudwatch.id + policy = data.aws_iam_policy_document.cloudwatch_logs.json +} + +resource "aws_appsync_api" "test" { + name = %[1]q + owner_contact = %[2]q + + event_config { + auth_provider { + auth_type = "AMAZON_COGNITO_USER_POOLS" + cognito_config { + user_pool_id = aws_cognito_user_pool.test.id + aws_region = data.aws_region.current.name + } + } + + auth_provider { + auth_type = "AWS_LAMBDA" + lambda_authorizer_config { + authorizer_uri = aws_lambda_function.test.arn + authorizer_result_ttl_in_seconds = 300 + } + } + + auth_provider { + auth_type = "OPENID_CONNECT" + openid_connect_config { + issuer = "https://example.com" + client_id = "test-client-id" + } + } + + connection_auth_mode { + auth_type = "AWS_LAMBDA" + } + + default_publish_auth_mode { + auth_type = "AWS_LAMBDA" + } + + default_subscribe_auth_mode { + auth_type = "AWS_LAMBDA" + } + + log_config { + cloudwatch_logs_role_arn = aws_iam_role.cloudwatch.arn + log_level = "ERROR" + } + } + + tags = { + Environment = "test" + Purpose = "event-api-testing" + } + + depends_on = [ + aws_lambda_permission.appsync_invoke, + aws_iam_role_policy.cloudwatch + ] +} + +data "aws_region" "current" {} +`, rName, acctest.DefaultEmailAddress) +} diff --git a/internal/service/appsync/channel_namespace.go b/internal/service/appsync/channel_namespace.go new file mode 100644 index 000000000000..e282666d2d62 --- /dev/null +++ b/internal/service/appsync/channel_namespace.go @@ -0,0 +1,378 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appsync + +import ( + "context" + + "github.com/YakDriver/regexache" + "github.com/YakDriver/smarterr" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/appsync" + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/smerr" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource("aws_appsync_channel_namespace", name="Channel Namespace") +// @Tags(identifierAttribute="channel_namespace_arn") +// @Testing(importStateIdAttribute="name") +// @Testing(importStateIdFunc=testAccChannelNamespaceImportStateID) +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/appsync/types;awstypes;awstypes.ChannelNamespace") +// @Testing(hasNoPreExistingResource=true) +func newChannelNamespaceResource(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &channelNamespaceResource{} + + return r, nil +} + +type channelNamespaceResource struct { + framework.ResourceWithModel[channelNamespaceResourceModel] +} + +func (r *channelNamespaceResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "api_id": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "channel_namespace_arn": framework.ARNAttributeComputedOnly(), + "code_handlers": schema.StringAttribute{ + Optional: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 32768), + }, + }, + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 50), + stringvalidator.RegexMatches(regexache.MustCompile(`^([A-Za-z0-9](?:[A-Za-z0-9\-]{0,48}[A-Za-z0-9])?)$`), ""), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + names.AttrTags: tftags.TagsAttribute(), + names.AttrTagsAll: tftags.TagsAttributeComputedOnly(), + }, + Blocks: map[string]schema.Block{ + "handler_configs": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[handlerConfigsModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "on_publish": handlerConfigBlock(ctx), + "on_subscribe": handlerConfigBlock(ctx), + }, + }, + }, + "publish_auth_mode": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authModeModel](ctx), + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + }, + }, + "subscribe_auth_mode": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[authModeModel](ctx), + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "auth_type": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.AuthenticationType](), + }, + }, + }, + }, + }, + } +} + +func handlerConfigBlock(ctx context.Context) schema.Block { + return schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[handlerConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "behavior": schema.StringAttribute{ + Required: true, + CustomType: fwtypes.StringEnumType[awstypes.HandlerBehavior](), + }, + }, + Blocks: map[string]schema.Block{ + "integration": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[integrationModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "data_source_name": schema.StringAttribute{ + Required: true, + }, + }, + Blocks: map[string]schema.Block{ + "lambda_config": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[lambdaConfigModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "invoke_type": schema.StringAttribute{ + CustomType: fwtypes.StringEnumType[awstypes.InvokeType](), + Optional: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func (r *channelNamespaceResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data channelNamespaceResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.Plan.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + name := fwflex.StringValueFromFramework(ctx, data.Name) + var input appsync.CreateChannelNamespaceInput + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Expand(ctx, data, &input)) + if response.Diagnostics.HasError() { + return + } + + // Additional fields. + input.Tags = getTagsIn(ctx) + + output, err := conn.CreateChannelNamespace(ctx, &input) + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, name) + return + } + + // Set values for unknowns. + data.ChannelNamespaceARN = fwflex.StringToFramework(ctx, output.ChannelNamespace.ChannelNamespaceArn) + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, data), smerr.ID, name) +} + +func (r *channelNamespaceResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data channelNamespaceResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + apiID, name := fwflex.StringValueFromFramework(ctx, data.ApiID), fwflex.StringValueFromFramework(ctx, data.Name) + output, err := findChannelNamespaceByTwoPartKey(ctx, conn, apiID, name) + + if tfresource.NotFound(err) { + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + return + } + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, name) + return + } + + if inttypes.IsZero(output.HandlerConfigs) { + output.HandlerConfigs = nil + } + + // Set attributes for import. + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Flatten(ctx, output, &data), smerr.ID, name) + if response.Diagnostics.HasError() { + return + } + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, &data), smerr.ID, name) +} + +func (r *channelNamespaceResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old channelNamespaceResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.Plan.Get(ctx, &new)) + if response.Diagnostics.HasError() { + return + } + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &old)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + name := fwflex.StringValueFromFramework(ctx, new.Name) + diff, d := fwflex.Diff(ctx, new, old) + smerr.EnrichAppend(ctx, &response.Diagnostics, d, smerr.ID, name) + if response.Diagnostics.HasError() { + return + } + + if diff.HasChanges() { + var input appsync.UpdateChannelNamespaceInput + smerr.EnrichAppend(ctx, &response.Diagnostics, fwflex.Expand(ctx, new, &input), smerr.ID, name) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateChannelNamespace(ctx, &input) + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, name) + return + } + } + + smerr.EnrichAppend(ctx, &response.Diagnostics, response.State.Set(ctx, &new), smerr.ID, name) +} + +func (r *channelNamespaceResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data channelNamespaceResourceModel + smerr.EnrichAppend(ctx, &response.Diagnostics, request.State.Get(ctx, &data)) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().AppSyncClient(ctx) + + apiID, name := fwflex.StringValueFromFramework(ctx, data.ApiID), fwflex.StringValueFromFramework(ctx, data.Name) + input := appsync.DeleteChannelNamespaceInput{ + ApiId: aws.String(apiID), + Name: aws.String(name), + } + _, err := conn.DeleteChannelNamespace(ctx, &input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return + } + + if err != nil { + smerr.AddError(ctx, &response.Diagnostics, err, smerr.ID, name) + return + } +} + +func (r *channelNamespaceResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + const ( + channelNamespaceIDParts = 2 + ) + parts, err := intflex.ExpandResourceId(request.ID, channelNamespaceIDParts, true) + + if err != nil { + response.Diagnostics.Append(fwdiag.NewParsingResourceIDErrorDiagnostic(err)) + + return + } + + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root("api_id"), parts[0])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrName), parts[1])...) +} + +func findChannelNamespaceByTwoPartKey(ctx context.Context, conn *appsync.Client, apiID, name string) (*awstypes.ChannelNamespace, error) { + input := appsync.GetChannelNamespaceInput{ + ApiId: aws.String(apiID), + Name: aws.String(name), + } + + return findChannelNamespace(ctx, conn, &input) +} + +func findChannelNamespace(ctx context.Context, conn *appsync.Client, input *appsync.GetChannelNamespaceInput) (*awstypes.ChannelNamespace, error) { + output, err := conn.GetChannelNamespace(ctx, input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, smarterr.NewError(&retry.NotFoundError{ + LastError: err, + }) + } + + if err != nil { + return nil, smarterr.NewError(err) + } + + if output == nil || output.ChannelNamespace == nil { + return nil, smarterr.NewError(tfresource.NewEmptyResultError(input)) + } + + return output.ChannelNamespace, nil +} + +type channelNamespaceResourceModel struct { + framework.WithRegionModel + ApiID types.String `tfsdk:"api_id"` + ChannelNamespaceARN types.String `tfsdk:"channel_namespace_arn"` + CodeHandlers types.String `tfsdk:"code_handlers"` + HandlerConfigs fwtypes.ListNestedObjectValueOf[handlerConfigsModel] `tfsdk:"handler_configs"` + Name types.String `tfsdk:"name"` + PublishAuthModes fwtypes.ListNestedObjectValueOf[authModeModel] `tfsdk:"publish_auth_mode"` + SubscribeAuthModes fwtypes.ListNestedObjectValueOf[authModeModel] `tfsdk:"subscribe_auth_mode"` + Tags tftags.Map `tfsdk:"tags"` + TagsAll tftags.Map `tfsdk:"tags_all"` +} + +type handlerConfigsModel struct { + OnPublish fwtypes.ListNestedObjectValueOf[handlerConfigModel] `tfsdk:"on_publish"` + OnSubscribe fwtypes.ListNestedObjectValueOf[handlerConfigModel] `tfsdk:"on_subscribe"` +} + +type handlerConfigModel struct { + Behavior fwtypes.StringEnum[awstypes.HandlerBehavior] `tfsdk:"behavior"` + Integration fwtypes.ListNestedObjectValueOf[integrationModel] `tfsdk:"integration"` +} + +type integrationModel struct { + DataSourceName types.String `tfsdk:"data_source_name"` + LambdaConfig fwtypes.ListNestedObjectValueOf[lambdaConfigModel] `tfsdk:"lambda_config"` +} + +type lambdaConfigModel struct { + InvokeType fwtypes.StringEnum[awstypes.InvokeType] `tfsdk:"invoke_type"` +} diff --git a/internal/service/appsync/channel_namespace_tags_gen_test.go b/internal/service/appsync/channel_namespace_tags_gen_test.go new file mode 100644 index 000000000000..90a26c1f8e8e --- /dev/null +++ b/internal/service/appsync/channel_namespace_tags_gen_test.go @@ -0,0 +1,2341 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +package appsync_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccAppSyncChannelNamespace_tags(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_null(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_EmptyMap(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_AddOnUpdate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_EmptyTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_providerOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_nonOverlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_overlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_updateToProviderOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_updateToResourceOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_emptyResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + ImportStateVerifyIgnore: []string{ + "tags.resourcekey1", // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_ComputedTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsKey1, "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey(acctest.CtKey1)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 2: Update ignored tag only + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Again), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.ChannelNamespace + resourceName := "aws_appsync_channel_namespace.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 2: Update ignored tag + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ChannelNamespace/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} diff --git a/internal/service/appsync/channel_namespace_test.go b/internal/service/appsync/channel_namespace_test.go new file mode 100644 index 000000000000..37ae0c7fd1e4 --- /dev/null +++ b/internal/service/appsync/channel_namespace_test.go @@ -0,0 +1,362 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appsync_test + +import ( + "context" + "fmt" + "testing" + + "github.com/YakDriver/regexache" + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccAppSyncChannelNamespace_basic(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.ChannelNamespace + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_channel_namespace.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccChannelNamespaceConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("api_id"), knownvalue.NotNull()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("channel_namespace_arn"), tfknownvalue.RegionalARNRegexp("appsync", regexache.MustCompile(`apis/.+/channelNamespace/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("code_handlers"), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("handler_configs"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("publish_auth_mode"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("subscribe_auth_mode"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_disappears(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.ChannelNamespace + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appsync_channel_namespace.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccChannelNamespaceConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfappsync.ResourceChannelNamespace, resourceName), + ), + ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncChannelNamespace_update(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.ChannelNamespace + rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) + resourceName := "aws_appsync_channel_namespace.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckChannelNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccChannelNamespaceConfig_comprehensive(rName, awstypes.InvokeTypeEvent), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("api_id"), knownvalue.NotNull()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("channel_namespace_arn"), tfknownvalue.RegionalARNRegexp("appsync", regexache.MustCompile(`apis/.+/channelNamespace/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("code_handlers"), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("handler_configs"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "on_publish": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "behavior": tfknownvalue.StringExact(awstypes.HandlerBehaviorDirect), + "integration": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "data_source_name": knownvalue.StringExact(rName), + "lambda_config": knownvalue.ListSizeExact(0), + }), + }), + }), + }), + "on_subscribe": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "behavior": tfknownvalue.StringExact(awstypes.HandlerBehaviorDirect), + "integration": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "data_source_name": knownvalue.StringExact(rName), + "lambda_config": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "invoke_type": tfknownvalue.StringExact(awstypes.InvokeTypeEvent), + }), + }), + }), + }), + }), + }), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("publish_auth_mode"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "auth_type": tfknownvalue.StringExact(awstypes.AuthenticationTypeApiKey), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("subscribe_auth_mode"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "auth_type": tfknownvalue.StringExact(awstypes.AuthenticationTypeApiKey), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccChannelNamespaceImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: names.AttrName, + }, + { + Config: testAccChannelNamespaceConfig_comprehensive(rName, awstypes.InvokeTypeRequestResponse), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelNamespaceExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("api_id"), knownvalue.NotNull()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("channel_namespace_arn"), tfknownvalue.RegionalARNRegexp("appsync", regexache.MustCompile(`apis/.+/channelNamespace/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("code_handlers"), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("handler_configs"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "on_publish": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "behavior": tfknownvalue.StringExact(awstypes.HandlerBehaviorDirect), + "integration": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "data_source_name": knownvalue.StringExact(rName), + "lambda_config": knownvalue.ListSizeExact(0), + }), + }), + }), + }), + "on_subscribe": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "behavior": tfknownvalue.StringExact(awstypes.HandlerBehaviorDirect), + "integration": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "data_source_name": knownvalue.StringExact(rName), + "lambda_config": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "invoke_type": tfknownvalue.StringExact(awstypes.InvokeTypeRequestResponse), + }), + }), + }), + }), + }), + }), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("publish_auth_mode"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "auth_type": tfknownvalue.StringExact(awstypes.AuthenticationTypeApiKey), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("subscribe_auth_mode"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.MapExact(map[string]knownvalue.Check{ + "auth_type": tfknownvalue.StringExact(awstypes.AuthenticationTypeApiKey), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + }, + }) +} + +func testAccCheckChannelNamespaceDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).AppSyncClient(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_appsync_channel_namespace" { + continue + } + + _, err := tfappsync.FindChannelNamespaceByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes[names.AttrName]) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("AppSync Channel Namespace %s still exists", rs.Primary.Attributes[names.AttrName]) + } + + return nil + } +} + +func testAccCheckChannelNamespaceExists(ctx context.Context, n string, v *awstypes.ChannelNamespace) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).AppSyncClient(ctx) + + output, err := tfappsync.FindChannelNamespaceByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes[names.AttrName]) + + if err != nil { + return err + } + + *v = *output + + return nil + } +} + +func testAccChannelNamespaceImportStateID(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return acctest.AttrsImportStateIdFunc(n, ",", "api_id", names.AttrName)(s) + } +} + +func testAccChannelNamespaceConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccAPIConfig_basic(rName), fmt.Sprintf(` +resource "aws_appsync_channel_namespace" "test" { + name = %[1]q + api_id = aws_appsync_api.test.api_id +} +`, rName)) +} + +func testAccChannelNamespaceConfig_comprehensive(rName string, invokeType awstypes.InvokeType) string { + return acctest.ConfigCompose(testAccAPIConfig_basic(rName), testAccDatasourceConfig_baseLambda(rName), fmt.Sprintf(` +resource "aws_appsync_datasource" "test" { + api_id = aws_appsync_api.test.api_id + name = %[1]q + service_role_arn = aws_iam_role.test.arn + type = "AWS_LAMBDA" + + lambda_config { + function_arn = aws_lambda_function.test.arn + } +} + +resource "aws_appsync_channel_namespace" "test" { + name = %[1]q + api_id = aws_appsync_api.test.api_id + + handler_configs { + on_publish { + behavior = "DIRECT" + + integration { + data_source_name = aws_appsync_datasource.test.name + } + } + + on_subscribe { + behavior = "DIRECT" + + integration { + data_source_name = aws_appsync_datasource.test.name + + lambda_config { + invoke_type = %[2]q + } + } + } + } + + publish_auth_mode { + auth_type = "API_KEY" + } + + subscribe_auth_mode { + auth_type = "API_KEY" + } +} +`, rName, invokeType)) +} diff --git a/internal/service/appsync/domain_name.go b/internal/service/appsync/domain_name.go index 0b743cc332de..42b627114310 100644 --- a/internal/service/appsync/domain_name.go +++ b/internal/service/appsync/domain_name.go @@ -138,7 +138,7 @@ func resourceDomainNameDelete(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteDomainName(ctx, &appsync.DeleteDomainNameInput{ DomainName: aws.String(d.Id()), }) diff --git a/internal/service/appsync/exports_test.go b/internal/service/appsync/exports_test.go index 355d234b2699..9a552f075493 100644 --- a/internal/service/appsync/exports_test.go +++ b/internal/service/appsync/exports_test.go @@ -5,8 +5,10 @@ package appsync // Exports for use in tests only. var ( + ResourceAPI = newAPIResource ResourceAPICache = resourceAPICache ResourceAPIKey = resourceAPIKey + ResourceChannelNamespace = newChannelNamespaceResource ResourceDataSource = resourceDataSource ResourceDomainName = resourceDomainName ResourceDomainNameAPIAssociation = resourceDomainNameAPIAssociation @@ -17,8 +19,10 @@ var ( ResourceSourceAPIAssociation = newSourceAPIAssociationResource DefaultAuthorizerResultTTLInSeconds = defaultAuthorizerResultTTLInSeconds + FindAPIByID = findAPIByID FindAPICacheByID = findAPICacheByID FindAPIKeyByTwoPartKey = findAPIKeyByTwoPartKey + FindChannelNamespaceByTwoPartKey = findChannelNamespaceByTwoPartKey FindDataSourceByTwoPartKey = findDataSourceByTwoPartKey FindDomainNameAPIAssociationByID = findDomainNameAPIAssociationByID FindDomainNameByID = findDomainNameByID diff --git a/internal/service/appsync/generate.go b/internal/service/appsync/generate.go index a7b20c7e40a1..3932f3859d5d 100644 --- a/internal/service/appsync/generate.go +++ b/internal/service/appsync/generate.go @@ -1,9 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -//go:generate go run ../../generate/listpages/main.go -ListOps=ListApiKeys,ListDomainNames,ListGraphqlApis +//go:generate go run ../../generate/listpages/main.go -ListOps=ListApis,ListApiKeys,ListDomainNames,ListGraphqlApis //go:generate go run ../../generate/tags/main.go -ListTags -ServiceTagsMap -UpdateTags -KVTValues //go:generate go run ../../generate/servicepackage/main.go +//go:generate go run ../../generate/tagstests/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package appsync diff --git a/internal/service/appsync/graphql_api.go b/internal/service/appsync/graphql_api.go index 13c5eb06ed6d..98b164d16d85 100644 --- a/internal/service/appsync/graphql_api.go +++ b/internal/service/appsync/graphql_api.go @@ -34,6 +34,7 @@ const ( // @SDKResource("aws_appsync_graphql_api", name="GraphQL API") // @Tags(identifierAttribute="arn") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/appsync/types;awstypes;awstypes.GraphqlApi") func resourceGraphQLAPI() *schema.Resource { validateAuthorizerResultTTLInSeconds := validation.IntBetween(0, 3600) diff --git a/internal/service/appsync/graphql_api_tags_gen_test.go b/internal/service/appsync/graphql_api_tags_gen_test.go new file mode 100644 index 000000000000..af591227be30 --- /dev/null +++ b/internal/service/appsync/graphql_api_tags_gen_test.go @@ -0,0 +1,2293 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +package appsync_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccAppSyncGraphQLAPI_tags(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_null(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_EmptyMap(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_AddOnUpdate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_EmptyTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_EmptyTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_providerOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_nonOverlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_overlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_updateToProviderOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_updateToResourceOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_emptyResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + // TODO: Should be known + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_ComputedTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_ComputedTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsKey1, "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 2: Update ignored tag only + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Again), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + }, + }) +} + +func TestAccAppSyncGraphQLAPI_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.GraphqlApi + resourceName := "aws_appsync_graphql_api.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID), + CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 2: Update ignored tag + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/GraphQLAPI/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGraphQLAPIExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} diff --git a/internal/service/appsync/list_pages_gen.go b/internal/service/appsync/list_pages_gen.go index 145fd90fc797..96a6a4aae1c1 100644 --- a/internal/service/appsync/list_pages_gen.go +++ b/internal/service/appsync/list_pages_gen.go @@ -1,4 +1,4 @@ -// Code generated by "internal/generate/listpages/main.go -ListOps=ListApiKeys,ListDomainNames,ListGraphqlApis"; DO NOT EDIT. +// Code generated by "internal/generate/listpages/main.go -ListOps=ListApis,ListApiKeys,ListDomainNames,ListGraphqlApis"; DO NOT EDIT. package appsync @@ -25,6 +25,22 @@ func listAPIKeysPages(ctx context.Context, conn *appsync.Client, input *appsync. } return nil } +func listAPIsPages(ctx context.Context, conn *appsync.Client, input *appsync.ListApisInput, fn func(*appsync.ListApisOutput, bool) bool, optFns ...func(*appsync.Options)) error { + for { + output, err := conn.ListApis(ctx, input, optFns...) + if err != nil { + return err + } + + lastPage := aws.ToString(output.NextToken) == "" + if !fn(output, lastPage) || lastPage { + break + } + + input.NextToken = output.NextToken + } + return nil +} func listDomainNamesPages(ctx context.Context, conn *appsync.Client, input *appsync.ListDomainNamesInput, fn func(*appsync.ListDomainNamesOutput, bool) bool, optFns ...func(*appsync.Options)) error { for { output, err := conn.ListDomainNames(ctx, input, optFns...) diff --git a/internal/service/appsync/resolver.go b/internal/service/appsync/resolver.go index d95496ddbe0d..2b1deba8e782 100644 --- a/internal/service/appsync/resolver.go +++ b/internal/service/appsync/resolver.go @@ -232,7 +232,7 @@ func resourceResolverCreate(ctx context.Context, d *schema.ResourceData, meta an input.SyncConfig = expandSyncConfig(v.([]any)) } - _, err := retryResolverOp(ctx, apiID, func() (any, error) { + _, err := retryResolverOp(ctx, apiID, func(ctx context.Context) (any, error) { return conn.CreateResolver(ctx, input) }) @@ -347,7 +347,7 @@ func resourceResolverUpdate(ctx context.Context, d *schema.ResourceData, meta an input.SyncConfig = expandSyncConfig(v.([]any)) } - _, err = retryResolverOp(ctx, apiID, func() (any, error) { + _, err = retryResolverOp(ctx, apiID, func(ctx context.Context) (any, error) { return conn.UpdateResolver(ctx, input) }) @@ -368,12 +368,13 @@ func resourceResolverDelete(ctx context.Context, d *schema.ResourceData, meta an } log.Printf("[INFO] Deleting Appsync Resolver: %s", d.Id()) - _, err = retryResolverOp(ctx, apiID, func() (any, error) { - return conn.DeleteResolver(ctx, &appsync.DeleteResolverInput{ - ApiId: aws.String(apiID), - FieldName: aws.String(fieldName), - TypeName: aws.String(typeName), - }) + input := appsync.DeleteResolverInput{ + ApiId: aws.String(apiID), + FieldName: aws.String(fieldName), + TypeName: aws.String(typeName), + } + _, err = retryResolverOp(ctx, apiID, func(ctx context.Context) (any, error) { + return conn.DeleteResolver(ctx, &input) }) if errs.IsA[*awstypes.NotFoundException](err) { @@ -406,7 +407,7 @@ func resolverParseResourceID(id string) (string, string, string, error) { return parts[0], parts[1], parts[2], nil } -func retryResolverOp(ctx context.Context, apiID string, f func() (any, error)) (any, error) { //nolint:unparam +func retryResolverOp(ctx context.Context, apiID string, f func(context.Context) (any, error)) (any, error) { //nolint:unparam mutexKey := "appsync-schema-" + apiID conns.GlobalMutexKV.Lock(mutexKey) defer conns.GlobalMutexKV.Unlock(mutexKey) @@ -414,7 +415,7 @@ func retryResolverOp(ctx context.Context, apiID string, f func() (any, error)) ( const ( timeout = 2 * time.Minute ) - return tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, timeout, f) + return tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, timeout, f) } func findResolverByThreePartKey(ctx context.Context, conn *appsync.Client, apiID, typeName, fieldName string) (*awstypes.Resolver, error) { diff --git a/internal/service/appsync/service_endpoint_resolver_gen.go b/internal/service/appsync/service_endpoint_resolver_gen.go index e079e6f8177e..1c015c6c9a08 100644 --- a/internal/service/appsync/service_endpoint_resolver_gen.go +++ b/internal/service/appsync/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params appsync.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up appsync endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up appsync endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index 4aa71c6682e0..38b8f9f62292 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/appsync/service_package_gen.go b/internal/service/appsync/service_package_gen.go index cbd5cd493088..9f8bdab19657 100644 --- a/internal/service/appsync/service_package_gen.go +++ b/internal/service/appsync/service_package_gen.go @@ -24,6 +24,24 @@ func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*inttypes.S func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.ServicePackageFrameworkResource { return []*inttypes.ServicePackageFrameworkResource{ + { + Factory: newAPIResource, + TypeName: "aws_appsync_api", + Name: "API", + Tags: unique.Make(inttypes.ServicePackageResourceTags{ + IdentifierAttribute: "api_arn", + }), + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, + { + Factory: newChannelNamespaceResource, + TypeName: "aws_appsync_channel_namespace", + Name: "Channel Namespace", + Tags: unique.Make(inttypes.ServicePackageResourceTags{ + IdentifierAttribute: "channel_namespace_arn", + }), + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, { Factory: newSourceAPIAssociationResource, TypeName: "aws_appsync_source_api_association", diff --git a/internal/service/appsync/sweep.go b/internal/service/appsync/sweep.go index 5986a8037666..9c985c07eea0 100644 --- a/internal/service/appsync/sweep.go +++ b/internal/service/appsync/sweep.go @@ -4,47 +4,54 @@ package appsync import ( - "fmt" - "log" + "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/appsync" - "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" + "github.com/hashicorp/terraform-provider-aws/internal/sweep/framework" ) func RegisterSweepers() { - resource.AddTestSweepers("aws_appsync_graphql_api", &resource.Sweeper{ - Name: "aws_appsync_graphql_api", - F: sweepGraphQLAPIs, - }) + awsv2.Register("aws_appsync_api", sweepAPIs) + awsv2.Register("aws_appsync_graphql_api", sweepGraphQLAPIs, "aws_appsync_domain_name_api_association") + awsv2.Register("aws_appsync_domain_name", sweepDomainNames, "aws_appsync_domain_name_api_association") + awsv2.Register("aws_appsync_domain_name_api_association", sweepDomainNameAssociations) +} - resource.AddTestSweepers("aws_appsync_domain_name", &resource.Sweeper{ - Name: "aws_appsync_domain_name", - F: sweepDomainNames, - Dependencies: []string{ - "aws_appsync_domain_name_api_association", - }, - }) +func sweepAPIs(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) { + conn := client.AppSyncClient(ctx) + var input appsync.ListApisInput + sweepResources := make([]sweep.Sweepable, 0) - resource.AddTestSweepers("aws_appsync_domain_name_api_association", &resource.Sweeper{ - Name: "aws_appsync_domain_name_api_association", - F: sweepDomainNameAssociations, + err := listAPIsPages(ctx, conn, &input, func(page *appsync.ListApisOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.Apis { + sweepResources = append(sweepResources, framework.NewSweepResource(newAPIResource, client, + framework.NewAttribute("api_id", aws.ToString(v.ApiId)))) + } + + return !lastPage }) -} -func sweepGraphQLAPIs(region string) error { - ctx := sweep.Context(region) - client, err := sweep.SharedRegionalSweepClient(ctx, region) if err != nil { - return fmt.Errorf("Error getting client: %s", err) + return nil, err } - input := &appsync.ListGraphqlApisInput{} + + return sweepResources, nil +} + +func sweepGraphQLAPIs(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) { conn := client.AppSyncClient(ctx) + var input appsync.ListGraphqlApisInput sweepResources := make([]sweep.Sweepable, 0) - err = listGraphQLAPIsPages(ctx, conn, input, func(page *appsync.ListGraphqlApisOutput, lastPage bool) bool { + err := listGraphQLAPIsPages(ctx, conn, &input, func(page *appsync.ListGraphqlApisOutput, lastPage bool) bool { if page == nil { return !lastPage } @@ -60,35 +67,19 @@ func sweepGraphQLAPIs(region string) error { return !lastPage }) - if awsv2.SkipSweepError(err) { - log.Printf("[WARN] Skipping AppSync GraphQL API sweep for %s: %s", region, err) - return nil - } - - if err != nil { - return fmt.Errorf("error listing AppSync GraphQL APIs (%s): %w", region, err) - } - - err = sweep.SweepOrchestrator(ctx, sweepResources) - if err != nil { - return fmt.Errorf("error sweeping AppSync GraphQL APIs (%s): %w", region, err) + return nil, err } - return nil + return sweepResources, nil } -func sweepDomainNames(region string) error { - ctx := sweep.Context(region) - client, err := sweep.SharedRegionalSweepClient(ctx, region) - if err != nil { - return fmt.Errorf("Error getting client: %s", err) - } - input := &appsync.ListDomainNamesInput{} +func sweepDomainNames(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) { conn := client.AppSyncClient(ctx) + var input appsync.ListDomainNamesInput sweepResources := make([]sweep.Sweepable, 0) - err = listDomainNamesPages(ctx, conn, input, func(page *appsync.ListDomainNamesOutput, lastPage bool) bool { + err := listDomainNamesPages(ctx, conn, &input, func(page *appsync.ListDomainNamesOutput, lastPage bool) bool { if page == nil { return !lastPage } @@ -104,35 +95,19 @@ func sweepDomainNames(region string) error { return !lastPage }) - if awsv2.SkipSweepError(err) { - log.Printf("[WARN] Skipping AppSync Domain Name sweep for %s: %s", region, err) - return nil - } - if err != nil { - return fmt.Errorf("error listing AppSync Domain Names (%s): %w", region, err) + return nil, err } - err = sweep.SweepOrchestrator(ctx, sweepResources) - - if err != nil { - return fmt.Errorf("error sweeping AppSync Domain Names (%s): %w", region, err) - } - - return nil + return sweepResources, nil } -func sweepDomainNameAssociations(region string) error { - ctx := sweep.Context(region) - client, err := sweep.SharedRegionalSweepClient(ctx, region) - if err != nil { - return fmt.Errorf("Error getting client: %s", err) - } - input := &appsync.ListDomainNamesInput{} +func sweepDomainNameAssociations(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) { conn := client.AppSyncClient(ctx) + var input appsync.ListDomainNamesInput sweepResources := make([]sweep.Sweepable, 0) - err = listDomainNamesPages(ctx, conn, input, func(page *appsync.ListDomainNamesOutput, lastPage bool) bool { + err := listDomainNamesPages(ctx, conn, &input, func(page *appsync.ListDomainNamesOutput, lastPage bool) bool { if page == nil { return !lastPage } @@ -148,20 +123,9 @@ func sweepDomainNameAssociations(region string) error { return !lastPage }) - if awsv2.SkipSweepError(err) { - log.Printf("[WARN] Skipping AppSync Domain Name API Association sweep for %s: %s", region, err) - return nil - } - - if err != nil { - return fmt.Errorf("error listing AppSync Domain Names (%s): %w", region, err) - } - - err = sweep.SweepOrchestrator(ctx, sweepResources) - if err != nil { - return fmt.Errorf("error sweeping AppSync Domain Name API Associations (%s): %w", region, err) + return nil, err } - return nil + return sweepResources, nil } diff --git a/internal/service/appsync/tags_gen_test.go b/internal/service/appsync/tags_gen_test.go new file mode 100644 index 000000000000..3e5d2ad45d0b --- /dev/null +++ b/internal/service/appsync/tags_gen_test.go @@ -0,0 +1,16 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +package appsync_test + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" +) + +func expectFullResourceTags(ctx context.Context, resourceAddress string, knownValue knownvalue.Check) statecheck.StateCheck { + return tfstatecheck.ExpectFullResourceTags(tfappsync.ServicePackage(ctx), resourceAddress, knownValue) +} diff --git a/internal/service/appsync/testdata/API/basic/main_gen.tf b/internal/service/appsync/testdata/API/basic/main_gen.tf new file mode 100644 index 000000000000..cb4202095bfc --- /dev/null +++ b/internal/service/appsync/testdata/API/basic/main_gen.tf @@ -0,0 +1,30 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_providers { + auth_type = "API_KEY" + } + + connection_auth_modes { + auth_type = "API_KEY" + } + + default_publish_auth_modes { + auth_type = "API_KEY" + } + + default_subscribe_auth_modes { + auth_type = "API_KEY" + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/API/basic_v5.100.0/main_gen.tf b/internal/service/appsync/testdata/API/basic_v5.100.0/main_gen.tf new file mode 100644 index 000000000000..58115748f07b --- /dev/null +++ b/internal/service/appsync/testdata/API/basic_v5.100.0/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_providers { + auth_type = "API_KEY" + } + + connection_auth_modes { + auth_type = "API_KEY" + } + + default_publish_auth_modes { + auth_type = "API_KEY" + } + + default_subscribe_auth_modes { + auth_type = "API_KEY" + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "5.100.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/appsync/testdata/API/basic_v6.0.0/main_gen.tf b/internal/service/appsync/testdata/API/basic_v6.0.0/main_gen.tf new file mode 100644 index 000000000000..9fe03fa335b1 --- /dev/null +++ b/internal/service/appsync/testdata/API/basic_v6.0.0/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_providers { + auth_type = "API_KEY" + } + + connection_auth_modes { + auth_type = "API_KEY" + } + + default_publish_auth_modes { + auth_type = "API_KEY" + } + + default_subscribe_auth_modes { + auth_type = "API_KEY" + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.0.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/appsync/testdata/API/basic_v6.3.0/main_gen.tf b/internal/service/appsync/testdata/API/basic_v6.3.0/main_gen.tf new file mode 100644 index 000000000000..5fd2d37eba72 --- /dev/null +++ b/internal/service/appsync/testdata/API/basic_v6.3.0/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_providers { + auth_type = "API_KEY" + } + + connection_auth_modes { + auth_type = "API_KEY" + } + + default_publish_auth_modes { + auth_type = "API_KEY" + } + + default_subscribe_auth_modes { + auth_type = "API_KEY" + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.3.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/appsync/testdata/API/region_override/main_gen.tf b/internal/service/appsync/testdata/API/region_override/main_gen.tf new file mode 100644 index 000000000000..77928d1520b4 --- /dev/null +++ b/internal/service/appsync/testdata/API/region_override/main_gen.tf @@ -0,0 +1,38 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + region = var.region + + name = var.rName + + event_config { + auth_providers { + auth_type = "API_KEY" + } + + connection_auth_modes { + auth_type = "API_KEY" + } + + default_publish_auth_modes { + auth_type = "API_KEY" + } + + default_subscribe_auth_modes { + auth_type = "API_KEY" + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/API/tags/main_gen.tf b/internal/service/appsync/testdata/API/tags/main_gen.tf new file mode 100644 index 000000000000..bc7ca626952e --- /dev/null +++ b/internal/service/appsync/testdata/API/tags/main_gen.tf @@ -0,0 +1,39 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} diff --git a/internal/service/appsync/testdata/API/tagsComputed1/main_gen.tf b/internal/service/appsync/testdata/API/tagsComputed1/main_gen.tf new file mode 100644 index 000000000000..ab982227d50f --- /dev/null +++ b/internal/service/appsync/testdata/API/tagsComputed1/main_gen.tf @@ -0,0 +1,43 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/API/tagsComputed2/main_gen.tf b/internal/service/appsync/testdata/API/tagsComputed2/main_gen.tf new file mode 100644 index 000000000000..56e81132414a --- /dev/null +++ b/internal/service/appsync/testdata/API/tagsComputed2/main_gen.tf @@ -0,0 +1,54 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + (var.knownTagKey) = var.knownTagValue + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} + +variable "knownTagKey" { + type = string + nullable = false +} + +variable "knownTagValue" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/API/tags_defaults/main_gen.tf b/internal/service/appsync/testdata/API/tags_defaults/main_gen.tf new file mode 100644 index 000000000000..1a98fe1d91b3 --- /dev/null +++ b/internal/service/appsync/testdata/API/tags_defaults/main_gen.tf @@ -0,0 +1,50 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } +} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/API/tags_ignore/main_gen.tf b/internal/service/appsync/testdata/API/tags_ignore/main_gen.tf new file mode 100644 index 000000000000..4f672b232ee3 --- /dev/null +++ b/internal/service/appsync/testdata/API/tags_ignore/main_gen.tf @@ -0,0 +1,59 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } + ignore_tags { + keys = var.ignore_tag_keys + } +} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = true + default = null +} + +variable "ignore_tag_keys" { + type = set(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/ChannelNamespace/tags/main_gen.tf b/internal/service/appsync/testdata/ChannelNamespace/tags/main_gen.tf new file mode 100644 index 000000000000..71aecbfe5e23 --- /dev/null +++ b/internal/service/appsync/testdata/ChannelNamespace/tags/main_gen.tf @@ -0,0 +1,46 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +resource "aws_appsync_channel_namespace" "test" { + api_id = aws_appsync_api.test.api_id + name = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} diff --git a/internal/service/appsync/testdata/ChannelNamespace/tagsComputed1/main_gen.tf b/internal/service/appsync/testdata/ChannelNamespace/tagsComputed1/main_gen.tf new file mode 100644 index 000000000000..e2c9a9c5fea6 --- /dev/null +++ b/internal/service/appsync/testdata/ChannelNamespace/tagsComputed1/main_gen.tf @@ -0,0 +1,52 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + } +} + +resource "aws_appsync_channel_namespace" "test" { + api_id = aws_appsync_api.test.api_id + name = var.rName + + tags = { + (var.unknownTagKey) = null_resource.test.id + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/ChannelNamespace/tagsComputed2/main_gen.tf b/internal/service/appsync/testdata/ChannelNamespace/tagsComputed2/main_gen.tf new file mode 100644 index 000000000000..0b2559ee09ba --- /dev/null +++ b/internal/service/appsync/testdata/ChannelNamespace/tagsComputed2/main_gen.tf @@ -0,0 +1,64 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + (var.knownTagKey) = var.knownTagValue + } +} + +resource "aws_appsync_channel_namespace" "test" { + api_id = aws_appsync_api.test.api_id + name = var.rName + + tags = { + (var.unknownTagKey) = null_resource.test.id + (var.knownTagKey) = var.knownTagValue + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} + +variable "knownTagKey" { + type = string + nullable = false +} + +variable "knownTagValue" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/ChannelNamespace/tags_defaults/main_gen.tf b/internal/service/appsync/testdata/ChannelNamespace/tags_defaults/main_gen.tf new file mode 100644 index 000000000000..723bc2feb031 --- /dev/null +++ b/internal/service/appsync/testdata/ChannelNamespace/tags_defaults/main_gen.tf @@ -0,0 +1,57 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } +} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +resource "aws_appsync_channel_namespace" "test" { + api_id = aws_appsync_api.test.api_id + name = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/ChannelNamespace/tags_ignore/main_gen.tf b/internal/service/appsync/testdata/ChannelNamespace/tags_ignore/main_gen.tf new file mode 100644 index 000000000000..ae85d215cfd5 --- /dev/null +++ b/internal/service/appsync/testdata/ChannelNamespace/tags_ignore/main_gen.tf @@ -0,0 +1,66 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } + ignore_tags { + keys = var.ignore_tag_keys + } +} + +resource "aws_appsync_api" "test" { + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + + tags = var.resource_tags +} + +resource "aws_appsync_channel_namespace" "test" { + api_id = aws_appsync_api.test.api_id + name = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = true + default = null +} + +variable "ignore_tag_keys" { + type = set(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/GraphQLAPI/tags/main_gen.tf b/internal/service/appsync/testdata/GraphQLAPI/tags/main_gen.tf new file mode 100644 index 000000000000..6d1bf7d6933e --- /dev/null +++ b/internal/service/appsync/testdata/GraphQLAPI/tags/main_gen.tf @@ -0,0 +1,23 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_appsync_graphql_api" "test" { + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} diff --git a/internal/service/appsync/testdata/GraphQLAPI/tagsComputed1/main_gen.tf b/internal/service/appsync/testdata/GraphQLAPI/tagsComputed1/main_gen.tf new file mode 100644 index 000000000000..9f4abbf9099f --- /dev/null +++ b/internal/service/appsync/testdata/GraphQLAPI/tagsComputed1/main_gen.tf @@ -0,0 +1,27 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_graphql_api" "test" { + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + tags = { + (var.unknownTagKey) = null_resource.test.id + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/GraphQLAPI/tagsComputed2/main_gen.tf b/internal/service/appsync/testdata/GraphQLAPI/tagsComputed2/main_gen.tf new file mode 100644 index 000000000000..8adb41deb270 --- /dev/null +++ b/internal/service/appsync/testdata/GraphQLAPI/tagsComputed2/main_gen.tf @@ -0,0 +1,38 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_appsync_graphql_api" "test" { + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + tags = { + (var.unknownTagKey) = null_resource.test.id + (var.knownTagKey) = var.knownTagValue + } +} + +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} + +variable "knownTagKey" { + type = string + nullable = false +} + +variable "knownTagValue" { + type = string + nullable = false +} diff --git a/internal/service/appsync/testdata/GraphQLAPI/tags_defaults/main_gen.tf b/internal/service/appsync/testdata/GraphQLAPI/tags_defaults/main_gen.tf new file mode 100644 index 000000000000..ca619fa10da2 --- /dev/null +++ b/internal/service/appsync/testdata/GraphQLAPI/tags_defaults/main_gen.tf @@ -0,0 +1,34 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } +} + +resource "aws_appsync_graphql_api" "test" { + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/GraphQLAPI/tags_ignore/main_gen.tf b/internal/service/appsync/testdata/GraphQLAPI/tags_ignore/main_gen.tf new file mode 100644 index 000000000000..e5fa339029a9 --- /dev/null +++ b/internal/service/appsync/testdata/GraphQLAPI/tags_ignore/main_gen.tf @@ -0,0 +1,43 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } + ignore_tags { + keys = var.ignore_tag_keys + } +} + +resource "aws_appsync_graphql_api" "test" { + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + tags = var.resource_tags +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = true + default = null +} + +variable "ignore_tag_keys" { + type = set(string) + nullable = false +} diff --git a/internal/service/appsync/testdata/tmpl/api_tags.gtpl b/internal/service/appsync/testdata/tmpl/api_tags.gtpl new file mode 100644 index 000000000000..3a020211a26b --- /dev/null +++ b/internal/service/appsync/testdata/tmpl/api_tags.gtpl @@ -0,0 +1,23 @@ +resource "aws_appsync_api" "test" { + {{- template "region" }} + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + {{- template "tags" . }} +} diff --git a/internal/service/appsync/testdata/tmpl/channel_namespace_tags.gtpl b/internal/service/appsync/testdata/tmpl/channel_namespace_tags.gtpl new file mode 100644 index 000000000000..d9ec77e8dd12 --- /dev/null +++ b/internal/service/appsync/testdata/tmpl/channel_namespace_tags.gtpl @@ -0,0 +1,31 @@ +resource "aws_appsync_api" "test" { + {{- template "region" }} + name = var.rName + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } + {{- template "tags" . }} +} + +resource "aws_appsync_channel_namespace" "test" { + {{- template "region" }} + api_id = aws_appsync_api.test.api_id + name = var.rName + + {{- template "tags" . }} +} diff --git a/internal/service/appsync/testdata/tmpl/graphql_api_tags.gtpl b/internal/service/appsync/testdata/tmpl/graphql_api_tags.gtpl new file mode 100644 index 000000000000..ac83faa0b022 --- /dev/null +++ b/internal/service/appsync/testdata/tmpl/graphql_api_tags.gtpl @@ -0,0 +1,8 @@ +resource "aws_appsync_graphql_api" "test" { + {{- template "region" }} + authentication_type = "API_KEY" + name = var.rName + visibility = var.rName + + {{- template "tags" . }} +} diff --git a/internal/service/athena/service_endpoint_resolver_gen.go b/internal/service/athena/service_endpoint_resolver_gen.go index 6b32c8f767f8..c7d769384c00 100644 --- a/internal/service/athena/service_endpoint_resolver_gen.go +++ b/internal/service/athena/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params athena.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up athena endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up athena endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index e7e22a8d9c21..7b4d6e58a38a 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/auditmanager/account_registration.go b/internal/service/auditmanager/account_registration.go index 7d374a65ac82..11f2f386c711 100644 --- a/internal/service/auditmanager/account_registration.go +++ b/internal/service/auditmanager/account_registration.go @@ -28,6 +28,7 @@ import ( // @SingletonIdentity(identityDuplicateAttributes="id") // @Testing(generator=false) // @Testing(hasExistsFunction=false, checkDestroyNoop=true) +// @Testing(preIdentityVersion="v5.100.0") func newAccountRegistrationResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &accountRegistrationResource{}, nil } diff --git a/internal/service/auditmanager/account_registration_identity_gen_test.go b/internal/service/auditmanager/account_registration_identity_gen_test.go index 755e79794220..fa65c07d7797 100644 --- a/internal/service/auditmanager/account_registration_identity_gen_test.go +++ b/internal/service/auditmanager/account_registration_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccAuditManagerAccountRegistration_IdentitySerial(t *testing.T) { func testAccAuditManagerAccountRegistration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_auditmanager_account_registration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,7 +107,7 @@ func testAccAuditManagerAccountRegistration_Identity_RegionOverride(t *testing.T resourceName := "aws_auditmanager_account_registration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -213,9 +214,10 @@ func testAccAuditManagerAccountRegistration_Identity_RegionOverride(t *testing.T func testAccAuditManagerAccountRegistration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_auditmanager_account_registration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/auditmanager/assessment.go b/internal/service/auditmanager/assessment.go index 4c025df4f851..29e317c28866 100644 --- a/internal/service/auditmanager/assessment.go +++ b/internal/service/auditmanager/assessment.go @@ -178,7 +178,7 @@ func (r *assessmentResource) Create(ctx context.Context, request resource.Create // Example: // ResourceNotFoundException: The operation tried to access a nonexistent resource. The resource // might not be specified correctly, or its status might not be active. Check and try again. - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ResourceNotFoundException](ctx, iamPropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceNotFoundException](ctx, iamPropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateAssessment(ctx, &input) }) diff --git a/internal/service/auditmanager/assessment_delegation.go b/internal/service/auditmanager/assessment_delegation.go index dfd3c0cf16c2..5a36a29bb6fa 100644 --- a/internal/service/auditmanager/assessment_delegation.go +++ b/internal/service/auditmanager/assessment_delegation.go @@ -130,7 +130,7 @@ func (r *assessmentDelegationResource) Create(ctx context.Context, request resou // Example: // ResourceNotFoundException: The operation tried to access a nonexistent resource. The resource // might not be specified correctly, or its status might not be active. Check and try again. - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ResourceNotFoundException](ctx, iamPropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceNotFoundException](ctx, iamPropagationTimeout, func(ctx context.Context) (any, error) { return conn.BatchCreateDelegationByAssessment(ctx, &input) }) diff --git a/internal/service/auditmanager/assessment_report.go b/internal/service/auditmanager/assessment_report.go index 899b943e1391..a7950ab3e4ff 100644 --- a/internal/service/auditmanager/assessment_report.go +++ b/internal/service/auditmanager/assessment_report.go @@ -154,7 +154,7 @@ func (r *assessmentReportResource) Delete(ctx context.Context, request resource. const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.ValidationException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ValidationException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteAssessmentReport(ctx, &input) }) diff --git a/internal/service/auditmanager/service_endpoint_resolver_gen.go b/internal/service/auditmanager/service_endpoint_resolver_gen.go index 69264740bc5f..cd5983ab800b 100644 --- a/internal/service/auditmanager/service_endpoint_resolver_gen.go +++ b/internal/service/auditmanager/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params auditmanager.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up auditmanager endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up auditmanager endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index 9d6baf303631..ac0dc9a09320 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/autoscaling/attachment.go b/internal/service/autoscaling/attachment.go index 786c180f768d..2493c9e18cf5 100644 --- a/internal/service/autoscaling/attachment.go +++ b/internal/service/autoscaling/attachment.go @@ -63,7 +63,7 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.AttachLoadBalancers(ctx, input) }, // ValidationError: Trying to update too many Load Balancers/Target Groups at once. The limit is 10 @@ -80,7 +80,7 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.AttachLoadBalancerTargetGroups(ctx, input) }, errCodeValidationError, "update too many") @@ -135,7 +135,7 @@ func resourceAttachmentDelete(ctx context.Context, d *schema.ResourceData, meta } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DetachLoadBalancers(ctx, input) }, errCodeValidationError, "update too many") @@ -155,7 +155,7 @@ func resourceAttachmentDelete(ctx context.Context, d *schema.ResourceData, meta } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DetachLoadBalancerTargetGroups(ctx, input) }, errCodeValidationError, "update too many") diff --git a/internal/service/autoscaling/group.go b/internal/service/autoscaling/group.go index c64282cae6d7..0ba41dc95d42 100644 --- a/internal/service/autoscaling/group.go +++ b/internal/service/autoscaling/group.go @@ -1217,7 +1217,7 @@ func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, meta any) } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateAutoScalingGroup(ctx, &inputCASG) }, // ValidationError: You must use a valid fully-formed launch template. Value (tf-acc-test-6643732652421074386) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name @@ -1235,7 +1235,7 @@ func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, meta any) timeout = 5 * time.Minute ) _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, timeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.PutLifecycleHook(ctx, input) }, errCodeValidationError, "Unable to publish test message to notification target") @@ -1562,7 +1562,7 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta any) } _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.UpdateAutoScalingGroup(ctx, &input) }, errCodeOperationError, errCodeUpdateASG, errCodeValidationError) @@ -1895,7 +1895,7 @@ func resourceGroupDelete(ctx context.Context, d *schema.ResourceData, meta any) ForceDelete: aws.Bool(forceDeleteGroup), } _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteAutoScalingGroup(ctx, &input) }, errCodeResourceInUseFault, errCodeScalingActivityInProgressFault) @@ -1989,7 +1989,7 @@ func deleteWarmPool(ctx context.Context, conn *autoscaling.Client, name string, ForceDelete: aws.Bool(force), } _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteWarmPool(ctx, &input) }, errCodeResourceInUseFault, errCodeScalingActivityInProgressFault) diff --git a/internal/service/autoscaling/launch_configuration.go b/internal/service/autoscaling/launch_configuration.go index ff807fcd1a1e..e3d66c4e7e53 100644 --- a/internal/service/autoscaling/launch_configuration.go +++ b/internal/service/autoscaling/launch_configuration.go @@ -516,8 +516,8 @@ func resourceLaunchConfigurationDelete(ctx context.Context, d *schema.ResourceDa conn := meta.(*conns.AWSClient).AutoScalingClient(ctx) log.Printf("[DEBUG] Deleting Auto Scaling Launch Configuration: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*awstypes.ResourceInUseFault](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceInUseFault](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.DeleteLaunchConfiguration(ctx, &autoscaling.DeleteLaunchConfigurationInput{ LaunchConfigurationName: aws.String(d.Id()), }) diff --git a/internal/service/autoscaling/lifecycle_hook.go b/internal/service/autoscaling/lifecycle_hook.go index d8ec7f2c060a..7f8e9acd6f3f 100644 --- a/internal/service/autoscaling/lifecycle_hook.go +++ b/internal/service/autoscaling/lifecycle_hook.go @@ -123,7 +123,7 @@ func resourceLifecycleHookPut(ctx context.Context, d *schema.ResourceData, meta } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 5*time.Minute, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.PutLifecycleHook(ctx, input) }, errCodeValidationError, "Unable to publish test message to notification target") diff --git a/internal/service/autoscaling/service_endpoint_resolver_gen.go b/internal/service/autoscaling/service_endpoint_resolver_gen.go index 2bc2ceb136e7..2886cc077671 100644 --- a/internal/service/autoscaling/service_endpoint_resolver_gen.go +++ b/internal/service/autoscaling/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params autoscaling.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up autoscaling endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up autoscaling endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index 055f00149020..3deb88771d06 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/autoscalingplans/service_endpoint_resolver_gen.go b/internal/service/autoscalingplans/service_endpoint_resolver_gen.go index 321a5ef54002..11a3c107c151 100644 --- a/internal/service/autoscalingplans/service_endpoint_resolver_gen.go +++ b/internal/service/autoscalingplans/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params autoscalingplans }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up autoscalingplans endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up autoscalingplans endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index 50c583ae9764..0cd9335e2639 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/backup/framework.go b/internal/service/backup/framework.go index b98749dce680..8c92ba27c81d 100644 --- a/internal/service/backup/framework.go +++ b/internal/service/backup/framework.go @@ -217,7 +217,7 @@ func resourceFrameworkUpdate(ctx context.Context, d *schema.ResourceData, meta a IdempotencyToken: aws.String(sdkid.UniqueId()), } - _, err := tfresource.RetryWhenIsA[*awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.UpdateFramework(ctx, input) }) @@ -238,7 +238,7 @@ func resourceFrameworkDelete(ctx context.Context, d *schema.ResourceData, meta a conn := meta.(*conns.AWSClient).BackupClient(ctx) log.Printf("[DEBUG] Deleting Backup Framework: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteFramework(ctx, &backup.DeleteFrameworkInput{ FrameworkName: aws.String(d.Id()), }) diff --git a/internal/service/backup/framework_data_source_tags_gen_test.go b/internal/service/backup/framework_data_source_tags_gen_test.go index 52dcfb8019fa..631029e47a39 100644 --- a/internal/service/backup/framework_data_source_tags_gen_test.go +++ b/internal/service/backup/framework_data_source_tags_gen_test.go @@ -31,6 +31,7 @@ func testAccBackupFrameworkDataSource_tagsSerial(t *testing.T) { func testAccBackupFrameworkDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() @@ -59,6 +60,7 @@ func testAccBackupFrameworkDataSource_tags(t *testing.T) { func testAccBackupFrameworkDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() @@ -83,6 +85,7 @@ func testAccBackupFrameworkDataSource_tags_NullMap(t *testing.T) { func testAccBackupFrameworkDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() @@ -107,6 +110,7 @@ func testAccBackupFrameworkDataSource_tags_EmptyMap(t *testing.T) { func testAccBackupFrameworkDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() @@ -139,6 +143,7 @@ func testAccBackupFrameworkDataSource_tags_DefaultTags_nonOverlapping(t *testing func testAccBackupFrameworkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() @@ -177,6 +182,7 @@ func testAccBackupFrameworkDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *test func testAccBackupFrameworkDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_framework.test" rName := randomFrameworkName() diff --git a/internal/service/backup/framework_tags_gen_test.go b/internal/service/backup/framework_tags_gen_test.go index 6c81193758e4..fc7f9e647bd1 100644 --- a/internal/service/backup/framework_tags_gen_test.go +++ b/internal/service/backup/framework_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccBackupFramework_tagsSerial(t *testing.T) { func testAccBackupFramework_tags(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -229,6 +230,7 @@ func testAccBackupFramework_tags(t *testing.T) { func testAccBackupFramework_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -296,6 +298,7 @@ func testAccBackupFramework_tags_null(t *testing.T) { func testAccBackupFramework_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -359,6 +362,7 @@ func testAccBackupFramework_tags_EmptyMap(t *testing.T) { func testAccBackupFramework_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -440,6 +444,7 @@ func testAccBackupFramework_tags_AddOnUpdate(t *testing.T) { func testAccBackupFramework_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -529,6 +534,7 @@ func testAccBackupFramework_tags_EmptyTag_OnCreate(t *testing.T) { func testAccBackupFramework_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -666,6 +672,7 @@ func testAccBackupFramework_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccBackupFramework_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -755,6 +762,7 @@ func testAccBackupFramework_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccBackupFramework_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -936,6 +944,7 @@ func testAccBackupFramework_tags_DefaultTags_providerOnly(t *testing.T) { func testAccBackupFramework_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1096,6 +1105,7 @@ func testAccBackupFramework_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccBackupFramework_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1272,6 +1282,7 @@ func testAccBackupFramework_tags_DefaultTags_overlapping(t *testing.T) { func testAccBackupFramework_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1362,6 +1373,7 @@ func testAccBackupFramework_tags_DefaultTags_updateToProviderOnly(t *testing.T) func testAccBackupFramework_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1451,6 +1463,7 @@ func testAccBackupFramework_tags_DefaultTags_updateToResourceOnly(t *testing.T) func testAccBackupFramework_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1516,6 +1529,7 @@ func testAccBackupFramework_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccBackupFramework_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1573,6 +1587,7 @@ func testAccBackupFramework_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func testAccBackupFramework_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1635,6 +1650,7 @@ func testAccBackupFramework_tags_DefaultTags_nullOverlappingResourceTag(t *testi func testAccBackupFramework_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1697,6 +1713,7 @@ func testAccBackupFramework_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func testAccBackupFramework_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1752,6 +1769,7 @@ func testAccBackupFramework_tags_ComputedTag_OnCreate(t *testing.T) { func testAccBackupFramework_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1849,6 +1867,7 @@ func testAccBackupFramework_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccBackupFramework_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -1936,6 +1955,7 @@ func testAccBackupFramework_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccBackupFramework_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() @@ -2098,6 +2118,7 @@ func testAccBackupFramework_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccBackupFramework_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeFrameworkOutput resourceName := "aws_backup_framework.test" rName := randomFrameworkName() diff --git a/internal/service/backup/plan_data_source_tags_gen_test.go b/internal/service/backup/plan_data_source_tags_gen_test.go index bcd9f6c98ce2..74029e367792 100644 --- a/internal/service/backup/plan_data_source_tags_gen_test.go +++ b/internal/service/backup/plan_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccBackupPlanDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccBackupPlanDataSource_tags(t *testing.T) { func TestAccBackupPlanDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccBackupPlanDataSource_tags_NullMap(t *testing.T) { func TestAccBackupPlanDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccBackupPlanDataSource_tags_EmptyMap(t *testing.T) { func TestAccBackupPlanDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccBackupPlanDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBackupPlanDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccBackupPlanDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccBackupPlanDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/backup/plan_tags_gen_test.go b/internal/service/backup/plan_tags_gen_test.go index 50f4ec15aad5..c6f4d89c95a9 100644 --- a/internal/service/backup/plan_tags_gen_test.go +++ b/internal/service/backup/plan_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBackupPlan_tags(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBackupPlan_tags(t *testing.T) { func TestAccBackupPlan_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccBackupPlan_tags_null(t *testing.T) { func TestAccBackupPlan_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccBackupPlan_tags_EmptyMap(t *testing.T) { func TestAccBackupPlan_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccBackupPlan_tags_AddOnUpdate(t *testing.T) { func TestAccBackupPlan_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBackupPlan_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBackupPlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccBackupPlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBackupPlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccBackupPlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccBackupPlan_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccBackupPlan_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccBackupPlan_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccBackupPlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccBackupPlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccBackupPlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccBackupPlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccBackupPlan_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccBackupPlan_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func TestAccBackupPlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccBackupPlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing func TestAccBackupPlan_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccBackupPlan_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBackupPlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccBackupPlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBackupPlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccBackupPlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupPlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccBackupPlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBackupPlan_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.GetBackupPlanOutput resourceName := "aws_backup_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/backup/region_settings_identity_gen_test.go b/internal/service/backup/region_settings_identity_gen_test.go index 434f50bd7ea4..eb6b02ef9acb 100644 --- a/internal/service/backup/region_settings_identity_gen_test.go +++ b/internal/service/backup/region_settings_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccBackupRegionSettings_Identity_Basic(t *testing.T) { var v backup.DescribeRegionSettingsOutput resourceName := "aws_backup_region_settings.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func testAccBackupRegionSettings_Identity_RegionOverride(t *testing.T) { resourceName := "aws_backup_region_settings.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -229,7 +229,7 @@ func testAccBackupRegionSettings_Identity_ExistingResource(t *testing.T) { var v backup.DescribeRegionSettingsOutput resourceName := "aws_backup_region_settings.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/backup/report_plan_data_source_tags_gen_test.go b/internal/service/backup/report_plan_data_source_tags_gen_test.go index d3c9e21ce779..aa38ff602ae0 100644 --- a/internal/service/backup/report_plan_data_source_tags_gen_test.go +++ b/internal/service/backup/report_plan_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccBackupReportPlanDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() @@ -44,6 +45,7 @@ func TestAccBackupReportPlanDataSource_tags(t *testing.T) { func TestAccBackupReportPlanDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() @@ -68,6 +70,7 @@ func TestAccBackupReportPlanDataSource_tags_NullMap(t *testing.T) { func TestAccBackupReportPlanDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() @@ -92,6 +95,7 @@ func TestAccBackupReportPlanDataSource_tags_EmptyMap(t *testing.T) { func TestAccBackupReportPlanDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() @@ -124,6 +128,7 @@ func TestAccBackupReportPlanDataSource_tags_DefaultTags_nonOverlapping(t *testin func TestAccBackupReportPlanDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() @@ -162,6 +167,7 @@ func TestAccBackupReportPlanDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccBackupReportPlanDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_report_plan.test" rName := randomReportPlanName() diff --git a/internal/service/backup/report_plan_tags_gen_test.go b/internal/service/backup/report_plan_tags_gen_test.go index 9157d57ffedc..3cd2051137fb 100644 --- a/internal/service/backup/report_plan_tags_gen_test.go +++ b/internal/service/backup/report_plan_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBackupReportPlan_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -200,6 +201,7 @@ func TestAccBackupReportPlan_tags(t *testing.T) { func TestAccBackupReportPlan_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -267,6 +269,7 @@ func TestAccBackupReportPlan_tags_null(t *testing.T) { func TestAccBackupReportPlan_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -330,6 +333,7 @@ func TestAccBackupReportPlan_tags_EmptyMap(t *testing.T) { func TestAccBackupReportPlan_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -411,6 +415,7 @@ func TestAccBackupReportPlan_tags_AddOnUpdate(t *testing.T) { func TestAccBackupReportPlan_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -500,6 +505,7 @@ func TestAccBackupReportPlan_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBackupReportPlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -637,6 +643,7 @@ func TestAccBackupReportPlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBackupReportPlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -726,6 +733,7 @@ func TestAccBackupReportPlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupReportPlan_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -907,6 +915,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBackupReportPlan_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1067,6 +1076,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBackupReportPlan_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1243,6 +1253,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBackupReportPlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1333,6 +1344,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccBackupReportPlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1422,6 +1434,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccBackupReportPlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1487,6 +1500,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBackupReportPlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1544,6 +1558,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccBackupReportPlan_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1606,6 +1621,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccBackupReportPlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1668,6 +1684,7 @@ func TestAccBackupReportPlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccBackupReportPlan_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1723,6 +1740,7 @@ func TestAccBackupReportPlan_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBackupReportPlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1820,6 +1838,7 @@ func TestAccBackupReportPlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBackupReportPlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -1907,6 +1926,7 @@ func TestAccBackupReportPlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupReportPlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() @@ -2069,6 +2089,7 @@ func TestAccBackupReportPlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBackupReportPlan_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReportPlan resourceName := "aws_backup_report_plan.test" rName := randomReportPlanName() diff --git a/internal/service/backup/service_endpoint_resolver_gen.go b/internal/service/backup/service_endpoint_resolver_gen.go index 3c3173a9d902..421d439a68aa 100644 --- a/internal/service/backup/service_endpoint_resolver_gen.go +++ b/internal/service/backup/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params backup.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up backup endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up backup endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index 263bb7de1e82..c559e8cfc27a 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/backup/vault_data_source_tags_gen_test.go b/internal/service/backup/vault_data_source_tags_gen_test.go index 200cfe719186..16f69d35db4e 100644 --- a/internal/service/backup/vault_data_source_tags_gen_test.go +++ b/internal/service/backup/vault_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccBackupVaultDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccBackupVaultDataSource_tags(t *testing.T) { func TestAccBackupVaultDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccBackupVaultDataSource_tags_NullMap(t *testing.T) { func TestAccBackupVaultDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccBackupVaultDataSource_tags_EmptyMap(t *testing.T) { func TestAccBackupVaultDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccBackupVaultDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccBackupVaultDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccBackupVaultDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccBackupVaultDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/backup/vault_policy.go b/internal/service/backup/vault_policy.go index 0b026154cd27..28e242434ec2 100644 --- a/internal/service/backup/vault_policy.go +++ b/internal/service/backup/vault_policy.go @@ -67,7 +67,7 @@ func resourceVaultPolicyPut(ctx context.Context, d *schema.ResourceData, meta an } _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.PutBackupVaultAccessPolicy(ctx, input) }, errCodeInvalidParameterValueException, "Provided principal is not valid", diff --git a/internal/service/backup/vault_tags_gen_test.go b/internal/service/backup/vault_tags_gen_test.go index 83563294edd0..0ca92b105673 100644 --- a/internal/service/backup/vault_tags_gen_test.go +++ b/internal/service/backup/vault_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBackupVault_tags(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccBackupVault_tags(t *testing.T) { func TestAccBackupVault_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccBackupVault_tags_null(t *testing.T) { func TestAccBackupVault_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccBackupVault_tags_EmptyMap(t *testing.T) { func TestAccBackupVault_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccBackupVault_tags_AddOnUpdate(t *testing.T) { func TestAccBackupVault_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccBackupVault_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBackupVault_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccBackupVault_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBackupVault_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccBackupVault_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccBackupVault_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccBackupVault_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccBackupVault_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccBackupVault_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccBackupVault_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccBackupVault_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccBackupVault_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccBackupVault_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccBackupVault_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccBackupVault_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccBackupVault_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccBackupVault_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccBackupVault_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBackupVault_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccBackupVault_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBackupVault_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccBackupVault_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBackupVault_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccBackupVault_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBackupVault_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v backup.DescribeBackupVaultOutput resourceName := "aws_backup_vault.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/compute_environment.go b/internal/service/batch/compute_environment.go index cc067ba46057..22f022817134 100644 --- a/internal/service/batch/compute_environment.go +++ b/internal/service/batch/compute_environment.go @@ -81,7 +81,7 @@ func resourceComputeEnvironment() *schema.Resource { "compute_resources": { Type: schema.TypeList, Optional: true, - ForceNew: true, + Computed: true, MinItems: 0, MaxItems: 1, Elem: &schema.Resource{ @@ -576,7 +576,7 @@ func resourceComputeEnvironmentDelete(ctx context.Context, d *schema.ResourceDat return diags } -func resourceComputeEnvironmentCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, meta any) error { +func resourceComputeEnvironmentCustomizeDiff(ctx context.Context, diff *schema.ResourceDiff, _ any) error { if computeEnvironmentType := strings.ToUpper(diff.Get(names.AttrType).(string)); computeEnvironmentType == string(awstypes.CETypeUnmanaged) { // UNMANAGED compute environments can have no compute_resources configured. if v, ok := diff.GetOk("compute_resources"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { @@ -668,6 +668,19 @@ func resourceComputeEnvironmentCustomizeDiff(_ context.Context, diff *schema.Res } } + // If the launch template version is unknown, set new value to ForceNew. + if v := diff.GetRawPlan().GetAttr("compute_resources"); v.IsKnown() && v.LengthInt() == 1 { + if v := v.AsValueSlice()[0].GetAttr(names.AttrLaunchTemplate); v.IsKnown() && v.LengthInt() == 1 { + if v := v.AsValueSlice()[0].GetAttr(names.AttrVersion); !v.IsKnown() { + out := expandComputeResource(ctx, diff.Get("compute_resources").([]any)[0].(map[string]any)) + out.LaunchTemplate.Version = aws.String(" ") // set version to a new empty value to trigger a replacement + if err := diff.SetNew("compute_resources", []any{flattenComputeResource(ctx, out)}); err != nil { + return err + } + } + } + } + if diff.HasChange("compute_resources.0.launch_template.0.launch_template_id") { if err := diff.ForceNew("compute_resources.0.launch_template.0.launch_template_id"); err != nil { return err diff --git a/internal/service/batch/compute_environment_data_source_tags_gen_test.go b/internal/service/batch/compute_environment_data_source_tags_gen_test.go index cafa2bd567fd..462996a71fa9 100644 --- a/internal/service/batch/compute_environment_data_source_tags_gen_test.go +++ b/internal/service/batch/compute_environment_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccBatchComputeEnvironmentDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccBatchComputeEnvironmentDataSource_tags(t *testing.T) { func TestAccBatchComputeEnvironmentDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccBatchComputeEnvironmentDataSource_tags_NullMap(t *testing.T) { func TestAccBatchComputeEnvironmentDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccBatchComputeEnvironmentDataSource_tags_EmptyMap(t *testing.T) { func TestAccBatchComputeEnvironmentDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccBatchComputeEnvironmentDataSource_tags_DefaultTags_nonOverlapping(t func TestAccBatchComputeEnvironmentDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccBatchComputeEnvironmentDataSource_tags_IgnoreTags_Overlap_DefaultTag func TestAccBatchComputeEnvironmentDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index dcaad4fbfab1..0115131c0748 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBatchComputeEnvironment_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { func TestAccBatchComputeEnvironment_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyMap(t *testing.T) { func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyProviderOnlyTag(t *tes func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT func TestAccBatchComputeEnvironment_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccBatchComputeEnvironment_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBatchComputeEnvironment_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccBatchComputeEnvironment_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccBatchComputeEnvironment_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccBatchComputeEnvironment_tags_ComputedTag_OnUpdate_Replace(t *testing func TestAccBatchComputeEnvironment_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccBatchComputeEnvironment_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccBatchComputeEnvironment_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ComputeEnvironmentDetail resourceName := "aws_batch_compute_environment.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index 4d0e581fbad7..77cfb0ae08d4 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -1609,6 +1609,46 @@ func TestAccBatchComputeEnvironment_updateLaunchTemplate(t *testing.T) { }) } +// https://github.com/hashicorp/terraform-provider-aws/issues/39470. +func TestAccBatchComputeEnvironment_updateLaunchTemplateID(t *testing.T) { + ctx := acctest.Context(t) + var ce awstypes.ComputeEnvironmentDetail + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_batch_compute_environment.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccComputeEnvironmentConfig_launchTemplateWithVersion(rName, "foo"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckComputeEnvironmentExists(ctx, resourceName, &ce), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + }, + // Swap to version 2 of the launch template + { + Config: testAccComputeEnvironmentConfig_launchTemplateWithVersion(rName, "bar"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckComputeEnvironmentExists(ctx, resourceName, &ce), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + }, + }, + }, + }, + }) +} + func TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate(t *testing.T) { ctx := acctest.Context(t) var ce awstypes.ComputeEnvironmentDetail @@ -2999,6 +3039,65 @@ resource "aws_batch_compute_environment" "test" { `, rName, version)) } +func testAccComputeEnvironmentConfig_launchTemplateWithVersion(rName, userDataSeed string) string { + return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), fmt.Sprintf(` +locals { + user_data = <<-EOF +Content-Type: multipart/mixed; boundary="//" +MIME-Version: 1.0 + +--// +Content-Type: text/x-shellscript; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; filename="userdata.txt" + +#!/bin/bash +echo hello +echo %[2]q +--//-- +EOF +} + +resource "aws_launch_template" "test" { + name = %[1]q + user_data = base64encode(local.user_data) +} + +resource "aws_batch_compute_environment" "test" { + name = %[1]q + + compute_resources { + allocation_strategy = "SPOT_PRICE_CAPACITY_OPTIMIZED" + instance_role = aws_iam_instance_profile.ecs_instance.arn + instance_type = [ + "c4.large", + ] + + launch_template { + launch_template_id = aws_launch_template.test.id + version = aws_launch_template.test.latest_version + } + + max_vcpus = 16 + min_vcpus = 0 + security_group_ids = [ + aws_security_group.test.id + ] + spot_iam_fleet_role = aws_iam_role.ec2_spot_fleet.arn + subnets = [ + aws_subnet.test.id + ] + type = "SPOT" + } + + service_role = aws_iam_role.batch_service.arn + type = "MANAGED" + depends_on = [aws_iam_role_policy_attachment.batch_service] +} +`, rName, userDataSeed)) +} + func testAccComputeEnvironmentConfig_ec2Configuration(rName string) string { return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), acctest.ConfigLatestAmazonLinux2HVMEBSX8664AMI(), fmt.Sprintf(` resource "aws_batch_compute_environment" "test" { diff --git a/internal/service/batch/job_definition_data_source_tags_gen_test.go b/internal/service/batch/job_definition_data_source_tags_gen_test.go index 8a727a20d7d9..7e39f437f536 100644 --- a/internal/service/batch/job_definition_data_source_tags_gen_test.go +++ b/internal/service/batch/job_definition_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccBatchJobDefinitionDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccBatchJobDefinitionDataSource_tags(t *testing.T) { func TestAccBatchJobDefinitionDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccBatchJobDefinitionDataSource_tags_NullMap(t *testing.T) { func TestAccBatchJobDefinitionDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccBatchJobDefinitionDataSource_tags_EmptyMap(t *testing.T) { func TestAccBatchJobDefinitionDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccBatchJobDefinitionDataSource_tags_DefaultTags_nonOverlapping(t *test func TestAccBatchJobDefinitionDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccBatchJobDefinitionDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccBatchJobDefinitionDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/job_definition_identity_gen_test.go b/internal/service/batch/job_definition_identity_gen_test.go index 06e2bf434a0b..515cde790554 100644 --- a/internal/service/batch/job_definition_identity_gen_test.go +++ b/internal/service/batch/job_definition_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccBatchJobDefinition_Identity_Basic(t *testing.T) { resourceName := "aws_batch_job_definition.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -113,7 +113,7 @@ func TestAccBatchJobDefinition_Identity_RegionOverride(t *testing.T) { resourceName := "aws_batch_job_definition.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -236,7 +236,7 @@ func TestAccBatchJobDefinition_Identity_ExistingResource(t *testing.T) { resourceName := "aws_batch_job_definition.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index 3a0f07928ac1..4760e55fd824 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBatchJobDefinition_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { func TestAccBatchJobDefinition_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { func TestAccBatchJobDefinition_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccBatchJobDefinition_tags_EmptyMap(t *testing.T) { func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBatchJobDefinition_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccBatchJobDefinition_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccBatchJobDefinition_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBatchJobDefinition_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccBatchJobDefinition_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBatchJobDefinition_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccBatchJobDefinition_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBatchJobDefinition_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccBatchJobDefinition_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccBatchJobDefinition_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobDefinition resourceName := "aws_batch_job_definition.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/job_queue.go b/internal/service/batch/job_queue.go index 9fb43983a01a..1f9d55913964 100644 --- a/internal/service/batch/job_queue.go +++ b/internal/service/batch/job_queue.go @@ -40,6 +40,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @ArnFormat("job-queue/{name}") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/batch/types;types.JobQueueDetail") +// @Testing(preIdentityVersion="v5.100.0") func newJobQueueResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := jobQueueResource{} diff --git a/internal/service/batch/job_queue_data_source_tags_gen_test.go b/internal/service/batch/job_queue_data_source_tags_gen_test.go index 00410b184e5a..6b4100139650 100644 --- a/internal/service/batch/job_queue_data_source_tags_gen_test.go +++ b/internal/service/batch/job_queue_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccBatchJobQueueDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccBatchJobQueueDataSource_tags(t *testing.T) { func TestAccBatchJobQueueDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccBatchJobQueueDataSource_tags_NullMap(t *testing.T) { func TestAccBatchJobQueueDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccBatchJobQueueDataSource_tags_EmptyMap(t *testing.T) { func TestAccBatchJobQueueDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccBatchJobQueueDataSource_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccBatchJobQueueDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccBatchJobQueueDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccBatchJobQueueDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/job_queue_identity_gen_test.go b/internal/service/batch/job_queue_identity_gen_test.go index 71942acfa4b9..8a242d43dace 100644 --- a/internal/service/batch/job_queue_identity_gen_test.go +++ b/internal/service/batch/job_queue_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccBatchJobQueue_Identity_Basic(t *testing.T) { resourceName := "aws_batch_job_queue.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -113,7 +113,7 @@ func TestAccBatchJobQueue_Identity_RegionOverride(t *testing.T) { resourceName := "aws_batch_job_queue.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -235,7 +235,7 @@ func TestAccBatchJobQueue_Identity_ExistingResource(t *testing.T) { resourceName := "aws_batch_job_queue.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index 77852b07aa67..4bce22d4714b 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBatchJobQueue_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { func TestAccBatchJobQueue_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccBatchJobQueue_tags_null(t *testing.T) { func TestAccBatchJobQueue_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccBatchJobQueue_tags_EmptyMap(t *testing.T) { func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccBatchJobQueue_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccBatchJobQueue_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBatchJobQueue_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccBatchJobQueue_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBatchJobQueue_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccBatchJobQueue_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBatchJobQueue_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccBatchJobQueue_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBatchJobQueue_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.JobQueueDetail resourceName := "aws_batch_job_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/scheduling_policy_data_source_tags_gen_test.go b/internal/service/batch/scheduling_policy_data_source_tags_gen_test.go index f3254047dc49..cf3dcffd8f28 100644 --- a/internal/service/batch/scheduling_policy_data_source_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccBatchSchedulingPolicyDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccBatchSchedulingPolicyDataSource_tags(t *testing.T) { func TestAccBatchSchedulingPolicyDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccBatchSchedulingPolicyDataSource_tags_NullMap(t *testing.T) { func TestAccBatchSchedulingPolicyDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccBatchSchedulingPolicyDataSource_tags_EmptyMap(t *testing.T) { func TestAccBatchSchedulingPolicyDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccBatchSchedulingPolicyDataSource_tags_DefaultTags_nonOverlapping(t *t func TestAccBatchSchedulingPolicyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccBatchSchedulingPolicyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccBatchSchedulingPolicyDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 18a4d702379b..ec5a645a875c 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyMap(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccBatchSchedulingPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccBatchSchedulingPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccBatchSchedulingPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccBatchSchedulingPolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SchedulingPolicyDetail resourceName := "aws_batch_scheduling_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/batch/service_endpoint_resolver_gen.go b/internal/service/batch/service_endpoint_resolver_gen.go index 7120a8c0d058..a356eff91ab4 100644 --- a/internal/service/batch/service_endpoint_resolver_gen.go +++ b/internal/service/batch/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params batch.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up batch endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up batch endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index 7ff7200fe0ec..40ed6fe6fbae 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/bcmdataexports/export_identity_gen_test.go b/internal/service/bcmdataexports/export_identity_gen_test.go index 703ec87eee99..aa45d4c8e636 100644 --- a/internal/service/bcmdataexports/export_identity_gen_test.go +++ b/internal/service/bcmdataexports/export_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccBCMDataExportsExport_Identity_Basic(t *testing.T) { resourceName := "aws_bcmdataexports_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +110,7 @@ func TestAccBCMDataExportsExport_Identity_ExistingResource_fromV5(t *testing.T) resourceName := "aws_bcmdataexports_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -168,7 +168,7 @@ func TestAccBCMDataExportsExport_Identity_ExistingResource_fromV6(t *testing.T) resourceName := "aws_bcmdataexports_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/bcmdataexports/export_tags_gen_test.go b/internal/service/bcmdataexports/export_tags_gen_test.go index e19cbf97b149..53ac07739748 100644 --- a/internal/service/bcmdataexports/export_tags_gen_test.go +++ b/internal/service/bcmdataexports/export_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBCMDataExportsExport_tags(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccBCMDataExportsExport_tags_null(t *testing.T) { t.Skip("Resource Export does not support null tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccBCMDataExportsExport_tags_null(t *testing.T) { func TestAccBCMDataExportsExport_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -314,6 +317,7 @@ func TestAccBCMDataExportsExport_tags_EmptyMap(t *testing.T) { func TestAccBCMDataExportsExport_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -396,6 +400,7 @@ func TestAccBCMDataExportsExport_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Export does not support empty tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -488,6 +493,7 @@ func TestAccBCMDataExportsExport_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Export does not support empty tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -629,6 +635,7 @@ func TestAccBCMDataExportsExport_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Export does not support empty tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -719,6 +726,7 @@ func TestAccBCMDataExportsExport_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBCMDataExportsExport_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -900,6 +908,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBCMDataExportsExport_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1060,6 +1069,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBCMDataExportsExport_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1236,6 +1246,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBCMDataExportsExport_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1326,6 +1337,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccBCMDataExportsExport_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1417,6 +1429,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource Export does not support empty tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1485,6 +1498,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_emptyProviderOnlyTag(t *testin t.Skip("Resource Export does not support empty tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1545,6 +1559,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_nullOverlappingResourceTag(t * t.Skip("Resource Export does not support null tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1616,6 +1631,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_nullNonOverlappingResourceTag( t.Skip("Resource Export does not support null tags") ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1703,7 @@ func TestAccBCMDataExportsExport_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccBCMDataExportsExport_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1742,6 +1759,7 @@ func TestAccBCMDataExportsExport_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBCMDataExportsExport_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1839,6 +1857,7 @@ func TestAccBCMDataExportsExport_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBCMDataExportsExport_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1926,6 +1945,7 @@ func TestAccBCMDataExportsExport_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccBCMDataExportsExport_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2088,6 +2108,7 @@ func TestAccBCMDataExportsExport_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccBCMDataExportsExport_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bcmdataexports.GetExportOutput resourceName := "aws_bcmdataexports_export.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/bcmdataexports/service_endpoint_resolver_gen.go b/internal/service/bcmdataexports/service_endpoint_resolver_gen.go index ff004f03d34e..167881fbec39 100644 --- a/internal/service/bcmdataexports/service_endpoint_resolver_gen.go +++ b/internal/service/bcmdataexports/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params bcmdataexports.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up bcmdataexports endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up bcmdataexports endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index 9a41a33056c0..7f8eaf2115ba 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/bedrock/custom_model.go b/internal/service/bedrock/custom_model.go index 119f5de14dd3..ba3c6eca9b85 100644 --- a/internal/service/bedrock/custom_model.go +++ b/internal/service/bedrock/custom_model.go @@ -48,6 +48,7 @@ import ( // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/bedrock;bedrock.GetModelCustomizationJobOutput") // @Testing(serialize=true) // @Testing(importIgnore="base_model_identifier", plannableImportAction="Replace") +// @Testing(preIdentityVersion="v5.100.0") func newCustomModelResource(context.Context) (resource.ResourceWithConfigure, error) { r := &customModelResource{} @@ -284,7 +285,7 @@ func (r *customModelResource) Create(ctx context.Context, request resource.Creat input.CustomModelTags = getTagsIn(ctx) input.JobTags = getTagsIn(ctx) - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateModelCustomizationJob(ctx, input) }, errCodeValidationException, "Could not assume provided IAM role") diff --git a/internal/service/bedrock/custom_model_identity_gen_test.go b/internal/service/bedrock/custom_model_identity_gen_test.go index c18c8153b8a5..8cd955815ddc 100644 --- a/internal/service/bedrock/custom_model_identity_gen_test.go +++ b/internal/service/bedrock/custom_model_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccBedrockCustomModel_Identity_Basic(t *testing.T) { resourceName := "aws_bedrock_custom_model.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -131,7 +131,7 @@ func testAccBedrockCustomModel_Identity_RegionOverride(t *testing.T) { resourceName := "aws_bedrock_custom_model.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -264,7 +264,7 @@ func testAccBedrockCustomModel_Identity_ExistingResource(t *testing.T) { resourceName := "aws_bedrock_custom_model.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/bedrock/custom_model_tags_gen_test.go b/internal/service/bedrock/custom_model_tags_gen_test.go index ae0a4073b084..4f65b0de95bb 100644 --- a/internal/service/bedrock/custom_model_tags_gen_test.go +++ b/internal/service/bedrock/custom_model_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccBedrockCustomModel_tagsSerial(t *testing.T) { func testAccBedrockCustomModel_tags(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -241,6 +242,7 @@ func testAccBedrockCustomModel_tags(t *testing.T) { func testAccBedrockCustomModel_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -304,6 +306,7 @@ func testAccBedrockCustomModel_tags_null(t *testing.T) { func testAccBedrockCustomModel_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -355,6 +358,7 @@ func testAccBedrockCustomModel_tags_EmptyMap(t *testing.T) { func testAccBedrockCustomModel_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -438,6 +442,7 @@ func testAccBedrockCustomModel_tags_AddOnUpdate(t *testing.T) { func testAccBedrockCustomModel_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -534,6 +539,7 @@ func testAccBedrockCustomModel_tags_EmptyTag_OnCreate(t *testing.T) { func testAccBedrockCustomModel_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -679,6 +685,7 @@ func testAccBedrockCustomModel_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccBedrockCustomModel_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -772,6 +779,7 @@ func testAccBedrockCustomModel_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccBedrockCustomModel_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -965,6 +973,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_providerOnly(t *testing.T) { func testAccBedrockCustomModel_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1134,6 +1143,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccBedrockCustomModel_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1319,6 +1329,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_overlapping(t *testing.T) { func testAccBedrockCustomModel_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1412,6 +1423,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_updateToProviderOnly(t *testing. func testAccBedrockCustomModel_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1504,6 +1516,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_updateToResourceOnly(t *testing. func testAccBedrockCustomModel_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1573,6 +1586,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccBedrockCustomModel_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1634,6 +1648,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func testAccBedrockCustomModel_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1704,6 +1719,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_nullOverlappingResourceTag(t *te func testAccBedrockCustomModel_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1776,6 +1792,7 @@ func testAccBedrockCustomModel_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccBedrockCustomModel_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1834,6 +1851,7 @@ func testAccBedrockCustomModel_tags_ComputedTag_OnCreate(t *testing.T) { func testAccBedrockCustomModel_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1934,6 +1952,7 @@ func testAccBedrockCustomModel_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccBedrockCustomModel_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2024,6 +2043,7 @@ func testAccBedrockCustomModel_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccBedrockCustomModel_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2186,6 +2206,7 @@ func testAccBedrockCustomModel_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccBedrockCustomModel_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetModelCustomizationJobOutput resourceName := "aws_bedrock_custom_model.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/bedrock/guardrail.go b/internal/service/bedrock/guardrail.go index 1b42e717a7eb..636e30718c10 100644 --- a/internal/service/bedrock/guardrail.go +++ b/internal/service/bedrock/guardrail.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" @@ -225,6 +226,36 @@ func (r *guardrailResource) Schema(ctx context.Context, req resource.SchemaReque Required: true, CustomType: fwtypes.StringEnumType[awstypes.GuardrailSensitiveInformationAction](), }, + "input_action": schema.StringAttribute{ + Optional: true, + Computed: true, + CustomType: fwtypes.StringEnumType[awstypes.GuardrailSensitiveInformationAction](), + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "input_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, + "output_action": schema.StringAttribute{ + Optional: true, + Computed: true, + CustomType: fwtypes.StringEnumType[awstypes.GuardrailSensitiveInformationAction](), + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "output_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, names.AttrType: schema.StringAttribute{ Required: true, CustomType: fwtypes.StringEnumType[awstypes.GuardrailPiiEntityType](), @@ -250,12 +281,42 @@ func (r *guardrailResource) Schema(ctx context.Context, req resource.SchemaReque stringplanmodifier.UseStateForUnknown(), }, }, + "input_action": schema.StringAttribute{ + Optional: true, + Computed: true, + CustomType: fwtypes.StringEnumType[awstypes.GuardrailSensitiveInformationAction](), + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "input_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, names.AttrName: schema.StringAttribute{ Required: true, Validators: []validator.String{ stringvalidator.LengthBetween(1, 100), }, }, + "output_action": schema.StringAttribute{ + Optional: true, + Computed: true, + CustomType: fwtypes.StringEnumType[awstypes.GuardrailSensitiveInformationAction](), + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "output_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, "pattern": schema.StringAttribute{ Required: true, Validators: []validator.String{ @@ -734,15 +795,23 @@ type sensitiveInformationPolicyConfig struct { } type piiEntitiesConfig struct { - Action fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"action"` - Type fwtypes.StringEnum[awstypes.GuardrailPiiEntityType] `tfsdk:"type"` + Action fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"action"` + InputAction fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"input_action"` + InputEnabled types.Bool `tfsdk:"input_enabled"` + OutputAction fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"output_action"` + OutputEnabled types.Bool `tfsdk:"output_enabled"` + Type fwtypes.StringEnum[awstypes.GuardrailPiiEntityType] `tfsdk:"type"` } type regexesConfig struct { - Action fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"action"` - Description types.String `tfsdk:"description"` - Name types.String `tfsdk:"name"` - Pattern types.String `tfsdk:"pattern"` + Action fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"action"` + Description types.String `tfsdk:"description"` + InputAction fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"input_action"` + InputEnabled types.Bool `tfsdk:"input_enabled"` + Name types.String `tfsdk:"name"` + OutputAction fwtypes.StringEnum[awstypes.GuardrailSensitiveInformationAction] `tfsdk:"output_action"` + OutputEnabled types.Bool `tfsdk:"output_enabled"` + Pattern types.String `tfsdk:"pattern"` } type guardrailTopicPolicyConfigModel struct { diff --git a/internal/service/bedrock/guardrail_tags_gen_test.go b/internal/service/bedrock/guardrail_tags_gen_test.go index 99819be6de77..6f5dc47231cc 100644 --- a/internal/service/bedrock/guardrail_tags_gen_test.go +++ b/internal/service/bedrock/guardrail_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBedrockGuardrail_tags(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -208,6 +209,7 @@ func TestAccBedrockGuardrail_tags(t *testing.T) { func TestAccBedrockGuardrail_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccBedrockGuardrail_tags_null(t *testing.T) { func TestAccBedrockGuardrail_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -324,6 +327,7 @@ func TestAccBedrockGuardrail_tags_EmptyMap(t *testing.T) { func TestAccBedrockGuardrail_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccBedrockGuardrail_tags_AddOnUpdate(t *testing.T) { func TestAccBedrockGuardrail_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBedrockGuardrail_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBedrockGuardrail_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccBedrockGuardrail_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBedrockGuardrail_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccBedrockGuardrail_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBedrockGuardrail_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -924,6 +932,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBedrockGuardrail_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1090,6 +1099,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBedrockGuardrail_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBedrockGuardrail_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1364,6 +1375,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccBedrockGuardrail_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1455,6 +1467,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccBedrockGuardrail_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1536,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBedrockGuardrail_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1583,6 +1597,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccBedrockGuardrail_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1669,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccBedrockGuardrail_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1743,7 @@ func TestAccBedrockGuardrail_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccBedrockGuardrail_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1784,6 +1801,7 @@ func TestAccBedrockGuardrail_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBedrockGuardrail_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1883,6 +1901,7 @@ func TestAccBedrockGuardrail_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBedrockGuardrail_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1972,6 +1991,7 @@ func TestAccBedrockGuardrail_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBedrockGuardrail_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2134,6 +2154,7 @@ func TestAccBedrockGuardrail_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBedrockGuardrail_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetGuardrailOutput resourceName := "aws_bedrock_guardrail.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/bedrock/guardrail_test.go b/internal/service/bedrock/guardrail_test.go index 2c222a66cd6e..bb338c9a4ac9 100644 --- a/internal/service/bedrock/guardrail_test.go +++ b/internal/service/bedrock/guardrail_test.go @@ -579,3 +579,82 @@ resource "aws_bedrock_guardrail" "test" { } `, rName) } + +func TestAccBedrockGuardrail_enhancedActions(t *testing.T) { + ctx := acctest.Context(t) + + var guardrail bedrock.GetGuardrailOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_bedrock_guardrail.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(t, names.BedrockEndpointID) + acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) + }, + ErrorCheck: acctest.ErrorCheck(t, names.BedrockServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGuardrailDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGuardrailConfig_enhancedActions(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckGuardrailExists(ctx, resourceName, &guardrail), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.0.action", "BLOCK"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.0.input_action", "BLOCK"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.0.output_action", "ANONYMIZE"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.0.input_enabled", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.pii_entities_config.0.output_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.0.action", "ANONYMIZE"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.0.input_action", "ANONYMIZE"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.0.output_action", "BLOCK"), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.0.input_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "sensitive_information_policy_config.0.regexes_config.0.output_enabled", acctest.CtTrue), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccGuardrailImportStateIDFunc(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "guardrail_id", + }, + }, + }) +} + +func testAccGuardrailConfig_enhancedActions(rName string) string { + return fmt.Sprintf(` +resource "aws_bedrock_guardrail" "test" { + name = %[1]q + blocked_input_messaging = "test" + blocked_outputs_messaging = "test" + description = "test" + + sensitive_information_policy_config { + pii_entities_config { + action = "BLOCK" + input_action = "BLOCK" + output_action = "ANONYMIZE" + input_enabled = true + output_enabled = false + type = "NAME" + } + regexes_config { + action = "ANONYMIZE" + input_action = "ANONYMIZE" + output_action = "BLOCK" + input_enabled = false + output_enabled = true + description = "enhanced regex example" + name = "enhanced_regex" + pattern = "^\\d{3}-\\d{2}-\\d{4}$" + } + } +} +`, rName) +} diff --git a/internal/service/bedrock/inference_profile_tags_gen_test.go b/internal/service/bedrock/inference_profile_tags_gen_test.go index dd436c737f9b..61005cf18683 100644 --- a/internal/service/bedrock/inference_profile_tags_gen_test.go +++ b/internal/service/bedrock/inference_profile_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBedrockInferenceProfile_tags(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccBedrockInferenceProfile_tags(t *testing.T) { func TestAccBedrockInferenceProfile_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -275,6 +277,7 @@ func TestAccBedrockInferenceProfile_tags_null(t *testing.T) { func TestAccBedrockInferenceProfile_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccBedrockInferenceProfile_tags_EmptyMap(t *testing.T) { func TestAccBedrockInferenceProfile_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -409,6 +413,7 @@ func TestAccBedrockInferenceProfile_tags_AddOnUpdate(t *testing.T) { func TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -505,6 +510,7 @@ func TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -650,6 +656,7 @@ func TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -743,6 +750,7 @@ func TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -936,6 +944,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly(t *testing.T) func TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1105,6 +1114,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1290,6 +1300,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1383,6 +1394,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly(t *tes func TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly(t *tes func TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1557,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag(t *testing func TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1605,6 +1619,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag(t *tes func TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1675,6 +1690,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag( func TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1747,6 +1763,7 @@ func TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceT func TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1805,6 +1822,7 @@ func TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1905,6 +1923,7 @@ func TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1995,6 +2014,7 @@ func TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace(t *testing func TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2157,6 +2177,7 @@ func TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v bedrock.GetInferenceProfileOutput resourceName := "aws_bedrock_inference_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/bedrock/model_invocation_logging_configuration.go b/internal/service/bedrock/model_invocation_logging_configuration.go index df705cedf86f..5188485f9973 100644 --- a/internal/service/bedrock/model_invocation_logging_configuration.go +++ b/internal/service/bedrock/model_invocation_logging_configuration.go @@ -27,6 +27,7 @@ import ( // @FrameworkResource("aws_bedrock_model_invocation_logging_configuration", name="Model Invocation Logging Configuration") // @SingletonIdentity(identityDuplicateAttributes="id") +// @Testing(preIdentityVersion="v5.100.0") func newModelInvocationLoggingConfigurationResource(context.Context) (resource.ResourceWithConfigure, error) { return &modelInvocationLoggingConfigurationResource{}, nil } diff --git a/internal/service/bedrock/model_invocation_logging_configuration_identity_gen_test.go b/internal/service/bedrock/model_invocation_logging_configuration_identity_gen_test.go index c8ab5d2923ce..f8f2d99041a7 100644 --- a/internal/service/bedrock/model_invocation_logging_configuration_identity_gen_test.go +++ b/internal/service/bedrock/model_invocation_logging_configuration_identity_gen_test.go @@ -34,10 +34,11 @@ func testAccBedrockModelInvocationLoggingConfiguration_IdentitySerial(t *testing func testAccBedrockModelInvocationLoggingConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_bedrock_model_invocation_logging_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -120,7 +121,7 @@ func testAccBedrockModelInvocationLoggingConfiguration_Identity_RegionOverride(t resourceName := "aws_bedrock_model_invocation_logging_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,10 +234,11 @@ func testAccBedrockModelInvocationLoggingConfiguration_Identity_RegionOverride(t func testAccBedrockModelInvocationLoggingConfiguration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_bedrock_model_invocation_logging_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/bedrock/service_endpoint_resolver_gen.go b/internal/service/bedrock/service_endpoint_resolver_gen.go index bb9ed4377162..55dbc3586777 100644 --- a/internal/service/bedrock/service_endpoint_resolver_gen.go +++ b/internal/service/bedrock/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params bedrock.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up bedrock endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up bedrock endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index 417ce4c84806..ff172655c599 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/bedrockagent/data_source.go b/internal/service/bedrockagent/data_source.go index 80dde3639c8a..983f6994ae1a 100644 --- a/internal/service/bedrockagent/data_source.go +++ b/internal/service/bedrockagent/data_source.go @@ -810,7 +810,7 @@ func (r *dataSourceResource) Create(ctx context.Context, request resource.Create input.ClientToken = aws.String(id.UniqueId()) - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateDataSource(ctx, input) }, errCodeValidationException, "cannot assume role") @@ -898,7 +898,7 @@ func (r *dataSourceResource) Update(ctx context.Context, request resource.Update return } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateDataSource(ctx, input) }, errCodeValidationException, "cannot assume role") diff --git a/internal/service/bedrockagent/flow.go b/internal/service/bedrockagent/flow.go index 252f22bd946b..01b59a7a5adf 100644 --- a/internal/service/bedrockagent/flow.go +++ b/internal/service/bedrockagent/flow.go @@ -1070,7 +1070,7 @@ func (r *flowResource) Update(ctx context.Context, request resource.UpdateReques } // Set values for unknowns. - new.CreatedAt = timetypes.NewRFC3339TimePointerValue(output.CreatedAt) + new.CreatedAt = old.CreatedAt new.UpdatedAt = timetypes.NewRFC3339TimePointerValue(output.UpdatedAt) new.Version = fwflex.StringToFramework(ctx, output.Version) new.Status = fwtypes.StringEnumValue(output.Status) diff --git a/internal/service/bedrockagent/flow_test.go b/internal/service/bedrockagent/flow_test.go index ee1b114a4e47..54500184949e 100644 --- a/internal/service/bedrockagent/flow_test.go +++ b/internal/service/bedrockagent/flow_test.go @@ -66,6 +66,23 @@ func TestAccBedrockAgentFlow_basic(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccFlowConfig_basicUpdate(rName, foundationModel), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckFlowExists(ctx, resourceName, &flow), + acctest.MatchResourceAttrRegionalARN(ctx, resourceName, names.AttrARN, "bedrock", regexache.MustCompile(`flow/.+$`)), + resource.TestCheckResourceAttrSet(resourceName, names.AttrID), + resource.TestCheckResourceAttrSet(resourceName, names.AttrCreatedAt), + resource.TestCheckResourceAttrSet(resourceName, "updated_at"), + resource.TestCheckResourceAttrSet(resourceName, names.AttrVersion), + resource.TestCheckResourceAttrSet(resourceName, names.AttrStatus), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, names.AttrDescription, "update"), + resource.TestCheckResourceAttrPair(resourceName, names.AttrExecutionRoleARN, "aws_iam_role.test", names.AttrARN), + resource.TestCheckResourceAttr(resourceName, "definition.#", "0"), + resource.TestCheckNoResourceAttr(resourceName, "customer_encryption_key_arn"), + ), + }, }, }) } @@ -508,6 +525,16 @@ resource "aws_bedrockagent_flow" "test" { `, rName)) } +func testAccFlowConfig_basicUpdate(rName, model string) string { + return acctest.ConfigCompose(testAccFlowConfig_base(model), fmt.Sprintf(` +resource "aws_bedrockagent_flow" "test" { + name = %[1]q + execution_role_arn = aws_iam_role.test.arn + description = "update" +} +`, rName)) +} + func testAccFlowConfig_withEncryptionKey(rName, model string) string { return acctest.ConfigCompose(testAccFlowConfig_base(model), fmt.Sprintf(` resource "aws_kms_key" "test" { diff --git a/internal/service/bedrockagent/knowledge_base.go b/internal/service/bedrockagent/knowledge_base.go index a721e6be47ac..8aeb2a7565f9 100644 --- a/internal/service/bedrockagent/knowledge_base.go +++ b/internal/service/bedrockagent/knowledge_base.go @@ -628,7 +628,7 @@ func (r *knowledgeBaseResource) Update(ctx context.Context, request resource.Upd return } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateKnowledgeBase(ctx, input) }, errCodeValidationException, "cannot assume role") diff --git a/internal/service/bedrockagent/service_endpoint_resolver_gen.go b/internal/service/bedrockagent/service_endpoint_resolver_gen.go index 850cef4a6aab..6ef7e4ef163a 100644 --- a/internal/service/bedrockagent/service_endpoint_resolver_gen.go +++ b/internal/service/bedrockagent/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params bedrockagent.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up bedrockagent endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up bedrockagent endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index 6f765f2f6e40..6afaf5ef818b 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/bedrockagentcore/generate.go b/internal/service/bedrockagentcore/generate.go new file mode 100644 index 000000000000..81cf8cd03548 --- /dev/null +++ b/internal/service/bedrockagentcore/generate.go @@ -0,0 +1,7 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +//go:generate go run ../../generate/servicepackage/main.go +// ONLY generate directives and package declaration! Do not add anything else to this file. + +package bedrockagentcore diff --git a/internal/service/bedrockagentcore/service_endpoint_resolver_gen.go b/internal/service/bedrockagentcore/service_endpoint_resolver_gen.go new file mode 100644 index 000000000000..a09b8d72e4bd --- /dev/null +++ b/internal/service/bedrockagentcore/service_endpoint_resolver_gen.go @@ -0,0 +1,82 @@ +// Code generated by internal/generate/servicepackage/main.go; DO NOT EDIT. + +package bedrockagentcore + +import ( + "context" + "fmt" + "net" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-provider-aws/internal/errs" +) + +var _ bedrockagentcorecontrol.EndpointResolverV2 = resolverV2{} + +type resolverV2 struct { + defaultResolver bedrockagentcorecontrol.EndpointResolverV2 +} + +func newEndpointResolverV2() resolverV2 { + return resolverV2{ + defaultResolver: bedrockagentcorecontrol.NewDefaultEndpointResolverV2(), + } +} + +func (r resolverV2) ResolveEndpoint(ctx context.Context, params bedrockagentcorecontrol.EndpointParameters) (endpoint smithyendpoints.Endpoint, err error) { + params = params.WithDefaults() + useFIPS := aws.ToBool(params.UseFIPS) + + if eps := params.Endpoint; aws.ToString(eps) != "" { + tflog.Debug(ctx, "setting endpoint", map[string]any{ + "tf_aws.endpoint": endpoint, + }) + + if useFIPS { + tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") + params.UseFIPS = aws.Bool(false) + } + + return r.defaultResolver.ResolveEndpoint(ctx, params) + } else if useFIPS { + ctx = tflog.SetField(ctx, "tf_aws.use_fips", useFIPS) + + endpoint, err = r.defaultResolver.ResolveEndpoint(ctx, params) + if err != nil { + return endpoint, err + } + + tflog.Debug(ctx, "endpoint resolved", map[string]any{ + "tf_aws.endpoint": endpoint.URI.String(), + }) + + hostname := endpoint.URI.Hostname() + _, err = net.LookupHost(hostname) + if err != nil { + if dnsErr, ok := errs.As[*net.DNSError](err); ok && dnsErr.IsNotFound { + tflog.Debug(ctx, "default endpoint host not found, disabling FIPS", map[string]any{ + "tf_aws.hostname": hostname, + }) + params.UseFIPS = aws.Bool(false) + } else { + err = fmt.Errorf("looking up bedrockagentcorecontrol endpoint %q: %w", hostname, err) + return + } + } else { + return endpoint, err + } + } + + return r.defaultResolver.ResolveEndpoint(ctx, params) +} + +func withBaseEndpoint(endpoint string) func(*bedrockagentcorecontrol.Options) { + return func(o *bedrockagentcorecontrol.Options) { + if endpoint != "" { + o.BaseEndpoint = aws.String(endpoint) + } + } +} diff --git a/internal/service/bedrockagentcore/service_endpoints_gen_test.go b/internal/service/bedrockagentcore/service_endpoints_gen_test.go new file mode 100644 index 000000000000..e6e0024aae8b --- /dev/null +++ b/internal/service/bedrockagentcore/service_endpoints_gen_test.go @@ -0,0 +1,602 @@ +// Code generated by internal/generate/serviceendpointtests/main.go; DO NOT EDIT. + +package bedrockagentcore_test + +import ( + "context" + "errors" + "fmt" + "maps" + "net" + "net/url" + "os" + "path/filepath" + "reflect" + "strings" + "testing" + + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/google/go-cmp/cmp" + "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + terraformsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type endpointTestCase struct { + with []setupFunc + expected caseExpectations +} + +type caseSetup struct { + config map[string]any + configFile configFile + environmentVariables map[string]string +} + +type configFile struct { + baseUrl string + serviceUrl string +} + +type caseExpectations struct { + diags diag.Diagnostics + endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string +} + +type setupFunc func(setup *caseSetup) + +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams + +const ( + packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" + awsServiceEnvvarEndpoint = "https://service-envvar.endpoint.test/" + baseEnvvarEndpoint = "https://base-envvar.endpoint.test/" + serviceConfigFileEndpoint = "https://service-configfile.endpoint.test/" + baseConfigFileEndpoint = "https://base-configfile.endpoint.test/" +) + +const ( + packageName = "bedrockagentcore" + awsEnvVar = "AWS_ENDPOINT_URL_BEDROCK_AGENTCORE_CONTROL" + baseEnvVar = "AWS_ENDPOINT_URL" + configParam = "bedrock_agentcore_control" +) + +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + +func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv + ctx := t.Context() + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion + + testcases := map[string]endpointTestCase{ + "no config": { + with: []setupFunc{withNoConfig}, + expected: expectDefaultEndpoint(ctx, t, expectedEndpointRegion), + }, + + // Package name endpoint on Config + + "package name endpoint config": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides aws service envvar": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withAwsEnvVar, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides base envvar": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withBaseEnvVar, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides service config file": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withServiceEndpointInConfigFile, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides base config file": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withBaseEndpointInConfigFile, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + // Service endpoint in AWS envvar + + "service aws envvar": { + with: []setupFunc{ + withAwsEnvVar, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides base envvar": { + with: []setupFunc{ + withAwsEnvVar, + withBaseEnvVar, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides service config file": { + with: []setupFunc{ + withAwsEnvVar, + withServiceEndpointInConfigFile, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides base config file": { + with: []setupFunc{ + withAwsEnvVar, + withBaseEndpointInConfigFile, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + // Base endpoint in envvar + + "base endpoint envvar": { + with: []setupFunc{ + withBaseEnvVar, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + "base endpoint envvar overrides service config file": { + with: []setupFunc{ + withBaseEnvVar, + withServiceEndpointInConfigFile, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + "base endpoint envvar overrides base config file": { + with: []setupFunc{ + withBaseEnvVar, + withBaseEndpointInConfigFile, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + // Service endpoint in config file + + "service config file": { + with: []setupFunc{ + withServiceEndpointInConfigFile, + }, + expected: expectServiceConfigFileEndpoint(), + }, + + "service config file overrides base config file": { + with: []setupFunc{ + withServiceEndpointInConfigFile, + withBaseEndpointInConfigFile, + }, + expected: expectServiceConfigFileEndpoint(), + }, + + // Base endpoint in config file + + "base endpoint config file": { + with: []setupFunc{ + withBaseEndpointInConfigFile, + }, + expected: expectBaseConfigFileEndpoint(), + }, + + // Use FIPS endpoint on Config + + "use fips config": { + with: []setupFunc{ + withUseFIPSInConfig, + }, + expected: expectDefaultFIPSEndpoint(ctx, t, expectedEndpointRegion), + }, + + "use fips config with package name endpoint config": { + with: []setupFunc{ + withUseFIPSInConfig, + withPackageNameEndpointInConfig, + }, + expected: expectPackageNameConfigEndpoint(), + }, + } + + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + t.Run(name, func(t *testing.T) { + testEndpointCase(ctx, t, providerRegion, testcase, callService) + }) + } +} + +func defaultEndpoint(ctx context.Context, region string) (url.URL, error) { + r := bedrockagentcorecontrol.NewDefaultEndpointResolverV2() + + ep, err := r.ResolveEndpoint(ctx, bedrockagentcorecontrol.EndpointParameters{ + Region: aws.String(region), + }) + if err != nil { + return url.URL{}, err + } + + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI, nil +} + +func defaultFIPSEndpoint(ctx context.Context, region string) (url.URL, error) { + r := bedrockagentcorecontrol.NewDefaultEndpointResolverV2() + + ep, err := r.ResolveEndpoint(ctx, bedrockagentcorecontrol.EndpointParameters{ + Region: aws.String(region), + UseFIPS: aws.Bool(true), + }) + if err != nil { + return url.URL{}, err + } + + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI, nil +} + +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { + t.Helper() + + client := meta.BedrockAgentCoreClient(ctx) + + var result apiCallParams + + input := bedrockagentcorecontrol.ListAgentRuntimesInput{} + _, err := client.ListAgentRuntimes(ctx, &input, + func(opts *bedrockagentcorecontrol.Options) { + opts.APIOptions = append(opts.APIOptions, + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), + addCancelRequestMiddleware(), + ) + }, + ) + if err == nil { + t.Fatal("Expected an error, got none") + } else if !errors.Is(err, errCancelOperation) { + t.Fatalf("Unexpected error: %s", err) + } + + return result +} + +func withNoConfig(_ *caseSetup) { + // no-op +} + +func withPackageNameEndpointInConfig(setup *caseSetup) { + if _, ok := setup.config[names.AttrEndpoints]; !ok { + setup.config[names.AttrEndpoints] = []any{ + map[string]any{}, + } + } + endpoints := setup.config[names.AttrEndpoints].([]any)[0].(map[string]any) + endpoints[packageName] = packageNameConfigEndpoint +} + +func withAwsEnvVar(setup *caseSetup) { + setup.environmentVariables[awsEnvVar] = awsServiceEnvvarEndpoint +} + +func withBaseEnvVar(setup *caseSetup) { + setup.environmentVariables[baseEnvVar] = baseEnvvarEndpoint +} + +func withServiceEndpointInConfigFile(setup *caseSetup) { + setup.configFile.serviceUrl = serviceConfigFileEndpoint +} + +func withBaseEndpointInConfigFile(setup *caseSetup) { + setup.configFile.baseUrl = baseConfigFileEndpoint +} + +func withUseFIPSInConfig(setup *caseSetup) { + setup.config["use_fips_endpoint"] = true +} + +func expectDefaultEndpoint(ctx context.Context, t *testing.T, region string) caseExpectations { + t.Helper() + + endpoint, err := defaultEndpoint(ctx, region) + if err != nil { + t.Fatalf("resolving accessanalyzer default endpoint: %s", err) + } + + return caseExpectations{ + endpoint: endpoint.String(), + region: expectedCallRegion, + } +} + +func expectDefaultFIPSEndpoint(ctx context.Context, t *testing.T, region string) caseExpectations { + t.Helper() + + endpoint, err := defaultFIPSEndpoint(ctx, region) + if err != nil { + t.Fatalf("resolving accessanalyzer FIPS endpoint: %s", err) + } + + hostname := endpoint.Hostname() + _, err = net.LookupHost(hostname) + if dnsErr, ok := errs.As[*net.DNSError](err); ok && dnsErr.IsNotFound { + return expectDefaultEndpoint(ctx, t, region) + } else if err != nil { + t.Fatalf("looking up accessanalyzer endpoint %q: %s", hostname, err) + } + + return caseExpectations{ + endpoint: endpoint.String(), + region: expectedCallRegion, + } +} + +func expectPackageNameConfigEndpoint() caseExpectations { + return caseExpectations{ + endpoint: packageNameConfigEndpoint, + region: expectedCallRegion, + } +} + +func expectAwsEnvVarEndpoint() caseExpectations { + return caseExpectations{ + endpoint: awsServiceEnvvarEndpoint, + region: expectedCallRegion, + } +} + +func expectBaseEnvVarEndpoint() caseExpectations { + return caseExpectations{ + endpoint: baseEnvvarEndpoint, + region: expectedCallRegion, + } +} + +func expectServiceConfigFileEndpoint() caseExpectations { + return caseExpectations{ + endpoint: serviceConfigFileEndpoint, + region: expectedCallRegion, + } +} + +func expectBaseConfigFileEndpoint() caseExpectations { + return caseExpectations{ + endpoint: baseConfigFileEndpoint, + region: expectedCallRegion, + } +} + +func testEndpointCase(ctx context.Context, t *testing.T, region string, testcase endpointTestCase, callF callFunc) { + t.Helper() + + setup := caseSetup{ + config: map[string]any{}, + environmentVariables: map[string]string{}, + } + + for _, f := range testcase.with { + f(&setup) + } + + config := map[string]any{ + names.AttrAccessKey: servicemocks.MockStaticAccessKey, + names.AttrSecretKey: servicemocks.MockStaticSecretKey, + names.AttrRegion: region, + names.AttrSkipCredentialsValidation: true, + names.AttrSkipRequestingAccountID: true, + } + + maps.Copy(config, setup.config) + + if setup.configFile.baseUrl != "" || setup.configFile.serviceUrl != "" { + config[names.AttrProfile] = "default" + tempDir := t.TempDir() + writeSharedConfigFile(t, &config, tempDir, generateSharedConfigFile(setup.configFile)) + } + + for k, v := range setup.environmentVariables { + t.Setenv(k, v) + } + + p, err := sdkv2.NewProvider(ctx) + if err != nil { + t.Fatal(err) + } + + p.TerraformVersion = "1.0.0" + + expectedDiags := testcase.expected.diags + diags := p.Configure(ctx, terraformsdk.NewResourceConfigRaw(config)) + + if diff := cmp.Diff(diags, expectedDiags, cmp.Comparer(sdkdiag.Comparer)); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if diags.HasError() { + return + } + + meta := p.Meta().(*conns.AWSClient) + + callParams := callF(ctx, t, meta) + + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) + } +} + +func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + retrieveEndpointURLMiddleware(t, endpoint), + middleware.After, + ) + } +} + +func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Retrieve Endpoint", + func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + t.Helper() + + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) + } + + url := request.URL + url.RawQuery = "" + url.Path = "/" + + *endpoint = url.String() + + return next.HandleFinalize(ctx, in) + }) +} + +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + +var errCancelOperation = errors.New("Test: Canceling request") + +func addCancelRequestMiddleware() func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + cancelRequestMiddleware(), + middleware.After, + ) + } +} + +// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it +func cancelRequestMiddleware() middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Cancel Requests", + func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation + }) +} + +func fullTypeName(i any) string { + return fullValueTypeName(reflect.ValueOf(i)) +} + +func fullValueTypeName(v reflect.Value) string { + if v.Kind() == reflect.Ptr { + return "*" + fullValueTypeName(reflect.Indirect(v)) + } + + requestType := v.Type() + return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) +} + +func generateSharedConfigFile(config configFile) string { + var buf strings.Builder + + buf.WriteString(` +[default] +aws_access_key_id = DefaultSharedCredentialsAccessKey +aws_secret_access_key = DefaultSharedCredentialsSecretKey +`) + if config.baseUrl != "" { + fmt.Fprintf(&buf, "endpoint_url = %s\n", config.baseUrl) + } + + if config.serviceUrl != "" { + fmt.Fprintf(&buf, ` +services = endpoint-test + +[services endpoint-test] +%[1]s = + endpoint_url = %[2]s +`, configParam, serviceConfigFileEndpoint) + } + + return buf.String() +} + +func writeSharedConfigFile(t *testing.T, config *map[string]any, tempDir, content string) string { + t.Helper() + + file, err := os.Create(filepath.Join(tempDir, "aws-sdk-go-base-shared-configuration-file")) + if err != nil { + t.Fatalf("creating shared configuration file: %s", err) + } + + _, err = file.WriteString(content) + if err != nil { + t.Fatalf(" writing shared configuration file: %s", err) + } + + if v, ok := (*config)[names.AttrSharedConfigFiles]; !ok { + (*config)[names.AttrSharedConfigFiles] = []any{file.Name()} + } else { + (*config)[names.AttrSharedConfigFiles] = append(v.([]any), file.Name()) + } + + return file.Name() +} diff --git a/internal/service/bedrockagentcore/service_package_gen.go b/internal/service/bedrockagentcore/service_package_gen.go new file mode 100644 index 000000000000..0561f94c21ca --- /dev/null +++ b/internal/service/bedrockagentcore/service_package_gen.go @@ -0,0 +1,88 @@ +// Code generated by internal/generate/servicepackage/main.go; DO NOT EDIT. + +package bedrockagentcore + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/internal/vcr" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type servicePackage struct{} + +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*inttypes.ServicePackageFrameworkDataSource { + return []*inttypes.ServicePackageFrameworkDataSource{} +} + +func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.ServicePackageFrameworkResource { + return []*inttypes.ServicePackageFrameworkResource{} +} + +func (p *servicePackage) SDKDataSources(ctx context.Context) []*inttypes.ServicePackageSDKDataSource { + return []*inttypes.ServicePackageSDKDataSource{} +} + +func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePackageSDKResource { + return []*inttypes.ServicePackageSDKResource{} +} + +func (p *servicePackage) ServicePackageName() string { + return names.BedrockAgentCore +} + +// NewClient returns a new AWS SDK for Go v2 client for this service package's AWS API. +func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (*bedrockagentcorecontrol.Client, error) { + cfg := *(config["aws_sdkv2_config"].(*aws.Config)) + optFns := []func(*bedrockagentcorecontrol.Options){ + bedrockagentcorecontrol.WithEndpointResolverV2(newEndpointResolverV2()), + withBaseEndpoint(config[names.AttrEndpoint].(string)), + func(o *bedrockagentcorecontrol.Options) { + if region := config[names.AttrRegion].(string); o.Region != region { + tflog.Info(ctx, "overriding provider-configured AWS API region", map[string]any{ + "service": p.ServicePackageName(), + "original_region": o.Region, + "override_region": region, + }) + o.Region = region + } + }, + func(o *bedrockagentcorecontrol.Options) { + if inContext, ok := conns.FromContext(ctx); ok && inContext.VCREnabled() { + tflog.Info(ctx, "overriding retry behavior to immediately return VCR errors") + o.Retryer = conns.AddIsErrorRetryables(cfg.Retryer().(aws.RetryerV2), retry.IsErrorRetryableFunc(vcr.InteractionNotFoundRetryableFunc)) + } + }, + withExtraOptions(ctx, p, config), + } + + return bedrockagentcorecontrol.NewFromConfig(cfg, optFns...), nil +} + +// withExtraOptions returns a functional option that allows this service package to specify extra API client options. +// This option is always called after any generated options. +func withExtraOptions(ctx context.Context, sp conns.ServicePackage, config map[string]any) func(*bedrockagentcorecontrol.Options) { + if v, ok := sp.(interface { + withExtraOptions(context.Context, map[string]any) []func(*bedrockagentcorecontrol.Options) + }); ok { + optFns := v.withExtraOptions(ctx, config) + + return func(o *bedrockagentcorecontrol.Options) { + for _, optFn := range optFns { + optFn(o) + } + } + } + + return func(*bedrockagentcorecontrol.Options) {} +} + +func ServicePackage(ctx context.Context) conns.ServicePackage { + return &servicePackage{} +} diff --git a/internal/service/billing/service_endpoint_resolver_gen.go b/internal/service/billing/service_endpoint_resolver_gen.go index 8e5d21e47348..0a1961b7dfb5 100644 --- a/internal/service/billing/service_endpoint_resolver_gen.go +++ b/internal/service/billing/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params billing.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up billing endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up billing endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/billing/service_endpoints_gen_test.go b/internal/service/billing/service_endpoints_gen_test.go index f230fa2a9ba7..25ba1263329a 100644 --- a/internal/service/billing/service_endpoints_gen_test.go +++ b/internal/service/billing/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/budgets/budget_action.go b/internal/service/budgets/budget_action.go index 9e0993942c61..53548e5abe1b 100644 --- a/internal/service/budgets/budget_action.go +++ b/internal/service/budgets/budget_action.go @@ -251,7 +251,7 @@ func resourceBudgetActionCreate(ctx context.Context, d *schema.ResourceData, met ResourceTags: getTagsIn(ctx), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.AccessDeniedException](ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.AccessDeniedException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateBudgetAction(ctx, input) }) @@ -382,7 +382,7 @@ func resourceBudgetActionDelete(ctx context.Context, d *schema.ResourceData, met } log.Printf("[DEBUG] Deleting Budget Action: %s", d.Id()) - _, err = tfresource.RetryWhenIsA[*awstypes.ResourceLockedException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.ResourceLockedException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteBudgetAction(ctx, &budgets.DeleteBudgetActionInput{ AccountId: aws.String(accountID), ActionId: aws.String(actionID), diff --git a/internal/service/budgets/budget_data_source_tags_gen_test.go b/internal/service/budgets/budget_data_source_tags_gen_test.go index 850fac0d1343..6459865b4c65 100644 --- a/internal/service/budgets/budget_data_source_tags_gen_test.go +++ b/internal/service/budgets/budget_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccBudgetsBudgetDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccBudgetsBudgetDataSource_tags(t *testing.T) { func TestAccBudgetsBudgetDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccBudgetsBudgetDataSource_tags_NullMap(t *testing.T) { func TestAccBudgetsBudgetDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccBudgetsBudgetDataSource_tags_EmptyMap(t *testing.T) { func TestAccBudgetsBudgetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccBudgetsBudgetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccBudgetsBudgetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccBudgetsBudgetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccBudgetsBudgetDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/budgets/budget_tags_gen_test.go b/internal/service/budgets/budget_tags_gen_test.go index 2809525cd7de..0e5046c3cdb4 100644 --- a/internal/service/budgets/budget_tags_gen_test.go +++ b/internal/service/budgets/budget_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccBudgetsBudget_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccBudgetsBudget_tags(t *testing.T) { func TestAccBudgetsBudget_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccBudgetsBudget_tags_null(t *testing.T) { func TestAccBudgetsBudget_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccBudgetsBudget_tags_EmptyMap(t *testing.T) { func TestAccBudgetsBudget_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccBudgetsBudget_tags_AddOnUpdate(t *testing.T) { func TestAccBudgetsBudget_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccBudgetsBudget_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccBudgetsBudget_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccBudgetsBudget_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccBudgetsBudget_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccBudgetsBudget_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_overlapping(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccBudgetsBudget_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccBudgetsBudget_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccBudgetsBudget_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccBudgetsBudget_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccBudgetsBudget_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccBudgetsBudget_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccBudgetsBudget_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccBudgetsBudget_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccBudgetsBudget_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccBudgetsBudget_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccBudgetsBudget_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccBudgetsBudget_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Budget resourceName := "aws_budgets_budget.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/budgets/service_endpoint_resolver_gen.go b/internal/service/budgets/service_endpoint_resolver_gen.go index 6bf3f2bc6a3a..1a029b1b13ff 100644 --- a/internal/service/budgets/service_endpoint_resolver_gen.go +++ b/internal/service/budgets/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params budgets.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up budgets endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up budgets endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index 61341de5f3a5..3cdfc5e744e5 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -524,7 +524,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ce/anomaly_monitor_identity_gen_test.go b/internal/service/ce/anomaly_monitor_identity_gen_test.go index 149dc2911646..afddb7687fad 100644 --- a/internal/service/ce/anomaly_monitor_identity_gen_test.go +++ b/internal/service/ce/anomaly_monitor_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCEAnomalyMonitor_Identity_Basic(t *testing.T) { resourceName := "aws_ce_anomaly_monitor.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +110,7 @@ func TestAccCEAnomalyMonitor_Identity_ExistingResource(t *testing.T) { resourceName := "aws_ce_anomaly_monitor.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ce/anomaly_subscription_identity_gen_test.go b/internal/service/ce/anomaly_subscription_identity_gen_test.go index 7c41fa90db1c..2b56a73243b1 100644 --- a/internal/service/ce/anomaly_subscription_identity_gen_test.go +++ b/internal/service/ce/anomaly_subscription_identity_gen_test.go @@ -29,7 +29,7 @@ func TestAccCEAnomalySubscription_Identity_Basic(t *testing.T) { domain := acctest.RandomDomainName() email_address := acctest.RandomEmailAddress(domain) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -118,7 +118,7 @@ func TestAccCEAnomalySubscription_Identity_ExistingResource(t *testing.T) { domain := acctest.RandomDomainName() email_address := acctest.RandomEmailAddress(domain) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ce/cost_category.go b/internal/service/ce/cost_category.go index e34e65525fc1..4522454d03ea 100644 --- a/internal/service/ce/cost_category.go +++ b/internal/service/ce/cost_category.go @@ -316,8 +316,8 @@ func resourceCostCategoryCreate(ctx context.Context, d *schema.ResourceData, met input.SplitChargeRules = expandCostCategorySplitChargeRules(v.(*schema.Set).List()) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ResourceNotFoundException](ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceNotFoundException](ctx, d.Timeout(schema.TimeoutCreate), + func(ctx context.Context) (any, error) { return conn.CreateCostCategoryDefinition(ctx, input) }) diff --git a/internal/service/ce/cost_category_identity_gen_test.go b/internal/service/ce/cost_category_identity_gen_test.go index a50090ac3768..815042cab4ca 100644 --- a/internal/service/ce/cost_category_identity_gen_test.go +++ b/internal/service/ce/cost_category_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCECostCategory_Identity_Basic(t *testing.T) { resourceName := "aws_ce_cost_category.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +110,7 @@ func TestAccCECostCategory_Identity_ExistingResource(t *testing.T) { resourceName := "aws_ce_cost_category.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ce/service_endpoint_resolver_gen.go b/internal/service/ce/service_endpoint_resolver_gen.go index 0dfbcce2992d..fe06b852221a 100644 --- a/internal/service/ce/service_endpoint_resolver_gen.go +++ b/internal/service/ce/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params costexplorer.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up costexplorer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up costexplorer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index da0139339846..6333c6fc729f 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/chatbot/service_endpoint_resolver_gen.go b/internal/service/chatbot/service_endpoint_resolver_gen.go index b6a7aaa0bc5b..d6877cb01baa 100644 --- a/internal/service/chatbot/service_endpoint_resolver_gen.go +++ b/internal/service/chatbot/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params chatbot.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up chatbot endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up chatbot endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index 5c1dc2a36564..e804c3d42204 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/chatbot/slack_channel_configuration.go b/internal/service/chatbot/slack_channel_configuration.go index 64295fb90fec..f10f03fd6bc4 100644 --- a/internal/service/chatbot/slack_channel_configuration.go +++ b/internal/service/chatbot/slack_channel_configuration.go @@ -276,7 +276,7 @@ func (r *slackChannelConfigurationResource) Delete(ctx context.Context, request ChatConfigurationArn: data.ChatConfigurationARN.ValueStringPointer(), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, r.DeleteTimeout(ctx, data.Timeouts), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, r.DeleteTimeout(ctx, data.Timeouts), func(ctx context.Context) (any, error) { return conn.DeleteSlackChannelConfiguration(ctx, input) }, "DependencyViolation") diff --git a/internal/service/chatbot/teams_channel_configuration.go b/internal/service/chatbot/teams_channel_configuration.go index 8b5609a6918e..f3b79bc819ba 100644 --- a/internal/service/chatbot/teams_channel_configuration.go +++ b/internal/service/chatbot/teams_channel_configuration.go @@ -280,7 +280,7 @@ func (r *teamsChannelConfigurationResource) Delete(ctx context.Context, request ChatConfigurationArn: data.ChatConfigurationARN.ValueStringPointer(), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, r.DeleteTimeout(ctx, data.Timeouts), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, r.DeleteTimeout(ctx, data.Timeouts), func(ctx context.Context) (any, error) { return conn.DeleteMicrosoftTeamsChannelConfiguration(ctx, input) }, "DependencyViolation") diff --git a/internal/service/chime/service_endpoint_resolver_gen.go b/internal/service/chime/service_endpoint_resolver_gen.go index c1547bf192df..315d175a39e9 100644 --- a/internal/service/chime/service_endpoint_resolver_gen.go +++ b/internal/service/chime/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params chime.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up chime endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up chime endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index 85f7cd00aef1..e1340109c5f6 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go index 8c11b5a78730..c5e56f760687 100644 --- a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go +++ b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go @@ -610,7 +610,7 @@ func resourceMediaInsightsPipelineConfigurationDelete(ctx context.Context, d *sc log.Printf("[INFO] Deleting ChimeSDKMediaPipelines MediaInsightsPipelineConfiguration %s", d.Id()) // eventual consistency may cause an initial failure - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 15*time.Second, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 15*time.Second, func(ctx context.Context) (any, error) { return conn.DeleteMediaInsightsPipelineConfiguration(ctx, &chimesdkmediapipelines.DeleteMediaInsightsPipelineConfigurationInput{ Identifier: aws.String(d.Id()), }) diff --git a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_identity_gen_test.go b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_identity_gen_test.go index a5bf7433d6dd..02eb0b225882 100644 --- a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_identity_gen_test.go +++ b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_Identity_Ba resourceName := "aws_chimesdkmediapipelines_media_insights_pipeline_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_Identity_Re resourceName := "aws_chimesdkmediapipelines_media_insights_pipeline_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_Identity_Ex resourceName := "aws_chimesdkmediapipelines_media_insights_pipeline_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/chimesdkmediapipelines/service_endpoint_resolver_gen.go b/internal/service/chimesdkmediapipelines/service_endpoint_resolver_gen.go index ff3d66a2a6db..b9a43c7b85b2 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoint_resolver_gen.go +++ b/internal/service/chimesdkmediapipelines/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params chimesdkmediapip }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up chimesdkmediapipelines endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up chimesdkmediapipelines endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 09348d616453..3e3b2b802bd7 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/chimesdkvoice/service_endpoint_resolver_gen.go b/internal/service/chimesdkvoice/service_endpoint_resolver_gen.go index bfa91a8bc123..74852d40eb12 100644 --- a/internal/service/chimesdkvoice/service_endpoint_resolver_gen.go +++ b/internal/service/chimesdkvoice/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params chimesdkvoice.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up chimesdkvoice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up chimesdkvoice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index e44fc71d6ea5..e3255e69e35d 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cleanrooms/membership_tags_gen_test.go b/internal/service/cleanrooms/membership_tags_gen_test.go index fd748b49cf22..38a98c89c38a 100644 --- a/internal/service/cleanrooms/membership_tags_gen_test.go +++ b/internal/service/cleanrooms/membership_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCleanRoomsMembership_tags(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccCleanRoomsMembership_tags(t *testing.T) { func TestAccCleanRoomsMembership_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccCleanRoomsMembership_tags_null(t *testing.T) { func TestAccCleanRoomsMembership_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccCleanRoomsMembership_tags_EmptyMap(t *testing.T) { func TestAccCleanRoomsMembership_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccCleanRoomsMembership_tags_AddOnUpdate(t *testing.T) { func TestAccCleanRoomsMembership_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccCleanRoomsMembership_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCleanRoomsMembership_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccCleanRoomsMembership_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCleanRoomsMembership_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccCleanRoomsMembership_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccCleanRoomsMembership_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccCleanRoomsMembership_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccCleanRoomsMembership_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_overlapping(t *testing.T) { func TestAccCleanRoomsMembership_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccCleanRoomsMembership_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccCleanRoomsMembership_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccCleanRoomsMembership_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccCleanRoomsMembership_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccCleanRoomsMembership_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccCleanRoomsMembership_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccCleanRoomsMembership_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccCleanRoomsMembership_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCleanRoomsMembership_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccCleanRoomsMembership_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccCleanRoomsMembership_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccCleanRoomsMembership_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccCleanRoomsMembership_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccCleanRoomsMembership_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccCleanRoomsMembership_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v cleanrooms.GetMembershipOutput resourceName := "aws_cleanrooms_membership.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cleanrooms/service_endpoint_resolver_gen.go b/internal/service/cleanrooms/service_endpoint_resolver_gen.go index 4e95202f9486..227e14af6fc2 100644 --- a/internal/service/cleanrooms/service_endpoint_resolver_gen.go +++ b/internal/service/cleanrooms/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cleanrooms.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cleanrooms endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cleanrooms endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index 7633ccb00cc2..1f1810c3dfd0 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloud9/service_endpoint_resolver_gen.go b/internal/service/cloud9/service_endpoint_resolver_gen.go index cd6e259f2884..ce3f420434dc 100644 --- a/internal/service/cloud9/service_endpoint_resolver_gen.go +++ b/internal/service/cloud9/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloud9.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloud9 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloud9 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index 2fbb9b66efa8..f2f61231a415 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudcontrol/service_endpoint_resolver_gen.go b/internal/service/cloudcontrol/service_endpoint_resolver_gen.go index d1bec3b0eacf..b1356dc596e7 100644 --- a/internal/service/cloudcontrol/service_endpoint_resolver_gen.go +++ b/internal/service/cloudcontrol/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudcontrol.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudcontrol endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudcontrol endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index c0f1331cdafc..7cb2c46cb997 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudformation/service_endpoint_resolver_gen.go b/internal/service/cloudformation/service_endpoint_resolver_gen.go index dc5167c44bbd..d9f7fbe559cc 100644 --- a/internal/service/cloudformation/service_endpoint_resolver_gen.go +++ b/internal/service/cloudformation/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudformation.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudformation endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudformation endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index a898abb391a2..83b3f645c0d4 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudformation/stack.go b/internal/service/cloudformation/stack.go index 846b0214e59a..8841ca947d5e 100644 --- a/internal/service/cloudformation/stack.go +++ b/internal/service/cloudformation/stack.go @@ -194,7 +194,7 @@ func resourceStackCreate(ctx context.Context, d *schema.ResourceData, meta any) input.TimeoutInMinutes = aws.Int32(int32(v.(int))) } - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateStack(ctx, input) }, errCodeValidationError, "is invalid or cannot be assumed") @@ -325,7 +325,7 @@ func resourceStackUpdate(ctx context.Context, d *schema.ResourceData, meta any) input.Tags = tags } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateStack(ctx, input) }, errCodeValidationError, "is invalid or cannot be assumed") diff --git a/internal/service/cloudformation/stack_instances.go b/internal/service/cloudformation/stack_instances.go index 644f9ce6ce24..e23004895088 100644 --- a/internal/service/cloudformation/stack_instances.go +++ b/internal/service/cloudformation/stack_instances.go @@ -549,7 +549,7 @@ func deleteStackInstances(ctx context.Context, d *schema.ResourceData, meta any, } log.Printf("[DEBUG] Deleting CloudFormation Stack Instances: %s", d.Id()) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.OperationInProgressException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.OperationInProgressException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteStackInstances(ctx, input) }) diff --git a/internal/service/cloudformation/stack_set_instance.go b/internal/service/cloudformation/stack_set_instance.go index f50202253789..c6b8be872dd8 100644 --- a/internal/service/cloudformation/stack_set_instance.go +++ b/internal/service/cloudformation/stack_set_instance.go @@ -455,7 +455,7 @@ func resourceStackSetInstanceDelete(ctx context.Context, d *schema.ResourceData, } log.Printf("[DEBUG] Deleting CloudFormation StackSet Instance: %s", d.Id()) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.OperationInProgressException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.OperationInProgressException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteStackInstances(ctx, input) }) diff --git a/internal/service/cloudformation/test-fixtures/examplecompany-exampleservice-exampleresource/go.mod b/internal/service/cloudformation/test-fixtures/examplecompany-exampleservice-exampleresource/go.mod index 93ad14ea1faa..55babd612a8c 100644 --- a/internal/service/cloudformation/test-fixtures/examplecompany-exampleservice-exampleresource/go.mod +++ b/internal/service/cloudformation/test-fixtures/examplecompany-exampleservice-exampleresource/go.mod @@ -1,6 +1,6 @@ module exampleresource -go 1.24.5 +go 1.24.6 require github.com/aws-cloudformation/cloudformation-cli-go-plugin v1.2.0 diff --git a/internal/service/cloudfront/distribution.go b/internal/service/cloudfront/distribution.go index 61c35882468a..7a1b732ba0cc 100644 --- a/internal/service/cloudfront/distribution.go +++ b/internal/service/cloudfront/distribution.go @@ -917,7 +917,7 @@ func resourceDistributionCreate(ctx context.Context, d *schema.ResourceData, met const ( timeout = 1 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InvalidViewerCertificate](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidViewerCertificate](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateDistributionWithTags(ctx, &input) }) @@ -1045,7 +1045,7 @@ func resourceDistributionUpdate(ctx context.Context, d *schema.ResourceData, met const ( timeout = 1 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidViewerCertificate](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidViewerCertificate](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateDistribution(ctx, &input) }) @@ -1133,7 +1133,7 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met const ( timeout = 3 * time.Minute ) - _, err = tfresource.RetryWhenIsA[*awstypes.DistributionNotDisabled](ctx, timeout, func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.DistributionNotDisabled](ctx, timeout, func(ctx context.Context) (any, error) { return nil, deleteDistribution(ctx, conn, d.Id()) }) } diff --git a/internal/service/cloudfront/exports.go b/internal/service/cloudfront/exports.go index c41aea12344d..b17771360fb3 100644 --- a/internal/service/cloudfront/exports.go +++ b/internal/service/cloudfront/exports.go @@ -5,5 +5,6 @@ package cloudfront // Exports for use across service packages. var ( + FindDistributionByID = findDistributionByID ResourceKeyValueStore = newKeyValueStoreResource ) diff --git a/internal/service/cloudfront/exports_test.go b/internal/service/cloudfront/exports_test.go index 63b7364bb56b..2243d6a6f6fa 100644 --- a/internal/service/cloudfront/exports_test.go +++ b/internal/service/cloudfront/exports_test.go @@ -23,7 +23,6 @@ var ( FindCachePolicyByID = findCachePolicyByID FindContinuousDeploymentPolicyByID = findContinuousDeploymentPolicyByID - FindDistributionByID = findDistributionByID FindFieldLevelEncryptionConfigByID = findFieldLevelEncryptionConfigByID FindFieldLevelEncryptionProfileByID = findFieldLevelEncryptionProfileByID FindFunctionByTwoPartKey = findFunctionByTwoPartKey diff --git a/internal/service/cloudfront/key_value_store.go b/internal/service/cloudfront/key_value_store.go index 064fcfd5f48a..aa2c6758fe98 100644 --- a/internal/service/cloudfront/key_value_store.go +++ b/internal/service/cloudfront/key_value_store.go @@ -36,6 +36,7 @@ import ( // @ArnFormat("key-value-store/{id}", attribute="arn") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/cloudfront/types;awstypes;awstypes.KeyValueStore") // @Testing(importStateIdAttribute="name") +// @Testing(preIdentityVersion="v5.100.0") func newKeyValueStoreResource(context.Context) (resource.ResourceWithConfigure, error) { r := &keyValueStoreResource{} diff --git a/internal/service/cloudfront/key_value_store_identity_gen_test.go b/internal/service/cloudfront/key_value_store_identity_gen_test.go index e83234e0e11c..b6e7cc8a5889 100644 --- a/internal/service/cloudfront/key_value_store_identity_gen_test.go +++ b/internal/service/cloudfront/key_value_store_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCloudFrontKeyValueStore_Identity_Basic(t *testing.T) { resourceName := "aws_cloudfront_key_value_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCloudFrontKeyValueStore_Identity_ExistingResource(t *testing.T) { resourceName := "aws_cloudfront_key_value_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cloudfront/realtime_log_config_identity_gen_test.go b/internal/service/cloudfront/realtime_log_config_identity_gen_test.go index b880dcd2123a..a075714d19ea 100644 --- a/internal/service/cloudfront/realtime_log_config_identity_gen_test.go +++ b/internal/service/cloudfront/realtime_log_config_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCloudFrontRealtimeLogConfig_Identity_Basic(t *testing.T) { resourceName := "aws_cloudfront_realtime_log_config.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccCloudFrontRealtimeLogConfig_Identity_ExistingResource(t *testing.T) resourceName := "aws_cloudfront_realtime_log_config.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cloudfront/service_endpoint_resolver_gen.go b/internal/service/cloudfront/service_endpoint_resolver_gen.go index 6aecb5c28572..fce5acd47768 100644 --- a/internal/service/cloudfront/service_endpoint_resolver_gen.go +++ b/internal/service/cloudfront/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudfront.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudfront endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudfront endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index 550a7a6f50f6..14cd5ac1b539 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudfrontkeyvaluestore/key_identity_gen_test.go b/internal/service/cloudfrontkeyvaluestore/key_identity_gen_test.go index f91cf1715643..5d0874359128 100644 --- a/internal/service/cloudfrontkeyvaluestore/key_identity_gen_test.go +++ b/internal/service/cloudfrontkeyvaluestore/key_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccCloudFrontKeyValueStoreKey_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudfrontkeyvaluestore_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -105,10 +106,11 @@ func TestAccCloudFrontKeyValueStoreKey_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.0.0 func TestAccCloudFrontKeyValueStoreKey_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudfrontkeyvaluestore_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cloudfrontkeyvaluestore/service_endpoint_resolver_gen.go b/internal/service/cloudfrontkeyvaluestore/service_endpoint_resolver_gen.go index 6081c3ff4f57..e745c1473bd6 100644 --- a/internal/service/cloudfrontkeyvaluestore/service_endpoint_resolver_gen.go +++ b/internal/service/cloudfrontkeyvaluestore/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudfrontkeyval }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudfrontkeyvaluestore endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudfrontkeyvaluestore endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudhsmv2/service_endpoint_resolver_gen.go b/internal/service/cloudhsmv2/service_endpoint_resolver_gen.go index 9e96cdb3d5ac..2828da44735e 100644 --- a/internal/service/cloudhsmv2/service_endpoint_resolver_gen.go +++ b/internal/service/cloudhsmv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudhsmv2.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudhsmv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudhsmv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index 39c3a8d02c99..499307c8b700 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudsearch/service_endpoint_resolver_gen.go b/internal/service/cloudsearch/service_endpoint_resolver_gen.go index 9b46d750eb09..a817f2ed3b4d 100644 --- a/internal/service/cloudsearch/service_endpoint_resolver_gen.go +++ b/internal/service/cloudsearch/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudsearch.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudsearch endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudsearch endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index eee335062b1e..7ec461e94168 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudtrail/event_data_store_identity_gen_test.go b/internal/service/cloudtrail/event_data_store_identity_gen_test.go index 4071968256e1..3399ce07776e 100644 --- a/internal/service/cloudtrail/event_data_store_identity_gen_test.go +++ b/internal/service/cloudtrail/event_data_store_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccCloudTrailEventDataStore_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudtrail_event_data_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccCloudTrailEventDataStore_Identity_RegionOverride(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccCloudTrailEventDataStore_Identity_RegionOverride(t *testing.T) { func TestAccCloudTrailEventDataStore_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudtrail_event_data_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cloudtrail/service_endpoint_resolver_gen.go b/internal/service/cloudtrail/service_endpoint_resolver_gen.go index 9658d09eb2d3..84e70a9e07ab 100644 --- a/internal/service/cloudtrail/service_endpoint_resolver_gen.go +++ b/internal/service/cloudtrail/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudtrail.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudtrail endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudtrail endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index 2487e7391bfe..3b8873939407 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudtrail/trail_identity_gen_test.go b/internal/service/cloudtrail/trail_identity_gen_test.go index 2b292a827e56..375dc04b9c3d 100644 --- a/internal/service/cloudtrail/trail_identity_gen_test.go +++ b/internal/service/cloudtrail/trail_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccCloudTrailTrail_Identity_Basic(t *testing.T) { resourceName := "aws_cloudtrail.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -124,7 +124,7 @@ func testAccCloudTrailTrail_Identity_RegionOverride(t *testing.T) { resourceName := "aws_cloudtrail.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -245,7 +245,7 @@ func testAccCloudTrailTrail_Identity_ExistingResource(t *testing.T) { resourceName := "aws_cloudtrail.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cloudwatch/composite_alarm_tags_gen_test.go b/internal/service/cloudwatch/composite_alarm_tags_gen_test.go index 139596097112..27f6fbb34403 100644 --- a/internal/service/cloudwatch/composite_alarm_tags_gen_test.go +++ b/internal/service/cloudwatch/composite_alarm_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccCloudWatchCompositeAlarm_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccCloudWatchCompositeAlarm_tags(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccCloudWatchCompositeAlarm_tags_null(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccCloudWatchCompositeAlarm_tags_EmptyMap(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccCloudWatchCompositeAlarm_tags_AddOnUpdate(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccCloudWatchCompositeAlarm_tags_EmptyTag_OnUpdate_Replace(t *testing.T func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_providerOnly(t *testing.T) func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nonOverlapping(t *testing. func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_overlapping(t *testing.T) func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_updateToProviderOnly(t *te func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_updateToResourceOnly(t *te func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_emptyResourceTag(t *testin func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_emptyProviderOnlyTag(t *te func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nullOverlappingResourceTag func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccCloudWatchCompositeAlarm_tags_DefaultTags_nullNonOverlappingResource func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccCloudWatchCompositeAlarm_tags_ComputedTag_OnUpdate_Replace(t *testin func TestAccCloudWatchCompositeAlarm_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccCloudWatchCompositeAlarm_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccCloudWatchCompositeAlarm_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_composite_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cloudwatch/contributor_insight_rule_tags_gen_test.go b/internal/service/cloudwatch/contributor_insight_rule_tags_gen_test.go index 6947d5c5bf49..801f3d524245 100644 --- a/internal/service/cloudwatch/contributor_insight_rule_tags_gen_test.go +++ b/internal/service/cloudwatch/contributor_insight_rule_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCloudWatchContributorInsightRule_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -220,6 +221,7 @@ func TestAccCloudWatchContributorInsightRule_tags(t *testing.T) { func TestAccCloudWatchContributorInsightRule_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -285,6 +287,7 @@ func TestAccCloudWatchContributorInsightRule_tags_null(t *testing.T) { func TestAccCloudWatchContributorInsightRule_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -338,6 +341,7 @@ func TestAccCloudWatchContributorInsightRule_tags_EmptyMap(t *testing.T) { func TestAccCloudWatchContributorInsightRule_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -423,6 +427,7 @@ func TestAccCloudWatchContributorInsightRule_tags_AddOnUpdate(t *testing.T) { func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -523,6 +528,7 @@ func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnCreate(t *testing.T func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -672,6 +678,7 @@ func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnUpdate_Add(t *testi func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func TestAccCloudWatchContributorInsightRule_tags_EmptyTag_OnUpdate_Replace(t *t func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -968,6 +976,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_providerOnly(t *te func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1143,6 +1152,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nonOverlapping(t * func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1334,6 +1344,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_overlapping(t *tes func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1429,6 +1440,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_updateToProviderOn func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1535,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_updateToResourceOn func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1594,6 +1607,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_emptyResourceTag(t func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1657,6 +1671,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_emptyProviderOnlyT func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1729,6 +1744,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nullOverlappingRes func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1803,6 +1819,7 @@ func TestAccCloudWatchContributorInsightRule_tags_DefaultTags_nullNonOverlapping func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1863,6 +1880,7 @@ func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnCreate(t *testin func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1965,6 +1983,7 @@ func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnUpdate_Add(t *te func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2057,6 +2076,7 @@ func TestAccCloudWatchContributorInsightRule_tags_ComputedTag_OnUpdate_Replace(t func TestAccCloudWatchContributorInsightRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2219,6 +2239,7 @@ func TestAccCloudWatchContributorInsightRule_tags_IgnoreTags_Overlap_DefaultTag( func TestAccCloudWatchContributorInsightRule_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InsightRule resourceName := "aws_cloudwatch_contributor_insight_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cloudwatch/generate.go b/internal/service/cloudwatch/generate.go index a54af3a32934..3baed7ea586e 100644 --- a/internal/service/cloudwatch/generate.go +++ b/internal/service/cloudwatch/generate.go @@ -4,6 +4,7 @@ //go:generate go run ../../generate/tags/main.go -ListTags -ListTagsInIDElem=ResourceARN -ServiceTagsSlice -TagInIDElem=ResourceARN -UpdateTags -CreateTags //go:generate go run ../../generate/servicepackage/main.go //go:generate go run ../../generate/tagstests/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package cloudwatch diff --git a/internal/service/cloudwatch/metric_alarm.go b/internal/service/cloudwatch/metric_alarm.go index 50466298c4b0..fa116ce377ab 100644 --- a/internal/service/cloudwatch/metric_alarm.go +++ b/internal/service/cloudwatch/metric_alarm.go @@ -31,6 +31,9 @@ import ( // @SDKResource("aws_cloudwatch_metric_alarm", name="Metric Alarm") // @Tags(identifierAttribute="arn") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/cloudwatch/types;awstypes;awstypes.MetricAlarm") +// @IdentityAttribute("alarm_name") +// @Testing(idAttrDuplicates="alarm_name") +// @Testing(preIdentityVersion="v6.7.0") func resourceMetricAlarm() *schema.Resource { //lintignore:R011 return &schema.Resource{ @@ -42,10 +45,6 @@ func resourceMetricAlarm() *schema.Resource { SchemaVersion: 1, MigrateState: MetricAlarmMigrateState, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ "actions_enabled": { Type: schema.TypeBool, diff --git a/internal/service/cloudwatch/metric_alarm_identity_gen_test.go b/internal/service/cloudwatch/metric_alarm_identity_gen_test.go new file mode 100644 index 000000000000..0193cfb3ef8a --- /dev/null +++ b/internal/service/cloudwatch/metric_alarm_identity_gen_test.go @@ -0,0 +1,256 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package cloudwatch_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccCloudWatchMetricAlarm_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.MetricAlarm + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchServiceID), + CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckMetricAlarmExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("alarm_name"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + "alarm_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("alarm_name")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("alarm_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("alarm_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccCloudWatchMetricAlarm_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("alarm_name"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + "alarm_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("alarm_name")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("alarm_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("alarm_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccCloudWatchMetricAlarm_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.MetricAlarm + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchServiceID), + CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckMetricAlarmExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/MetricAlarm/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + "alarm_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("alarm_name")), + }, + }, + }, + }) +} diff --git a/internal/service/cloudwatch/metric_alarm_tags_gen_test.go b/internal/service/cloudwatch/metric_alarm_tags_gen_test.go index b4a87ecf79f3..e0cc24373c6d 100644 --- a/internal/service/cloudwatch/metric_alarm_tags_gen_test.go +++ b/internal/service/cloudwatch/metric_alarm_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCloudWatchMetricAlarm_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccCloudWatchMetricAlarm_tags(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccCloudWatchMetricAlarm_tags_null(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccCloudWatchMetricAlarm_tags_EmptyMap(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccCloudWatchMetricAlarm_tags_AddOnUpdate(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccCloudWatchMetricAlarm_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccCloudWatchMetricAlarm_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_overlapping(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccCloudWatchMetricAlarm_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccCloudWatchMetricAlarm_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccCloudWatchMetricAlarm_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccCloudWatchMetricAlarm_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccCloudWatchMetricAlarm_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccCloudWatchMetricAlarm_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccCloudWatchMetricAlarm_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccCloudWatchMetricAlarm_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.MetricAlarm resourceName := "aws_cloudwatch_metric_alarm.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cloudwatch/metric_stream_tags_gen_test.go b/internal/service/cloudwatch/metric_stream_tags_gen_test.go index 2fe768c1ce79..4c65e23880d2 100644 --- a/internal/service/cloudwatch/metric_stream_tags_gen_test.go +++ b/internal/service/cloudwatch/metric_stream_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccCloudWatchMetricStream_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccCloudWatchMetricStream_tags(t *testing.T) { func TestAccCloudWatchMetricStream_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccCloudWatchMetricStream_tags_null(t *testing.T) { func TestAccCloudWatchMetricStream_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccCloudWatchMetricStream_tags_EmptyMap(t *testing.T) { func TestAccCloudWatchMetricStream_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccCloudWatchMetricStream_tags_AddOnUpdate(t *testing.T) { func TestAccCloudWatchMetricStream_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccCloudWatchMetricStream_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCloudWatchMetricStream_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccCloudWatchMetricStream_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCloudWatchMetricStream_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccCloudWatchMetricStream_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccCloudWatchMetricStream_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccCloudWatchMetricStream_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccCloudWatchMetricStream_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_overlapping(t *testing.T) { func TestAccCloudWatchMetricStream_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_updateToProviderOnly(t *test func TestAccCloudWatchMetricStream_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_updateToResourceOnly(t *test func TestAccCloudWatchMetricStream_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_emptyResourceTag(t *testing. func TestAccCloudWatchMetricStream_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_emptyProviderOnlyTag(t *test func TestAccCloudWatchMetricStream_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccCloudWatchMetricStream_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccCloudWatchMetricStream_tags_DefaultTags_nullNonOverlappingResourceTa func TestAccCloudWatchMetricStream_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccCloudWatchMetricStream_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCloudWatchMetricStream_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccCloudWatchMetricStream_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccCloudWatchMetricStream_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccCloudWatchMetricStream_tags_ComputedTag_OnUpdate_Replace(t *testing. func TestAccCloudWatchMetricStream_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccCloudWatchMetricStream_tags_IgnoreTags_Overlap_DefaultTag(t *testing func TestAccCloudWatchMetricStream_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_cloudwatch_metric_stream.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cloudwatch/service_endpoint_resolver_gen.go b/internal/service/cloudwatch/service_endpoint_resolver_gen.go index 2430cfac6f3e..f1746e3451af 100644 --- a/internal/service/cloudwatch/service_endpoint_resolver_gen.go +++ b/internal/service/cloudwatch/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cloudwatch.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cloudwatch endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cloudwatch endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index f6322d39f042..a49abada8d97 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cloudwatch/service_package_gen.go b/internal/service/cloudwatch/service_package_gen.go index d0bb5931375b..cefa8952429b 100644 --- a/internal/service/cloudwatch/service_package_gen.go +++ b/internal/service/cloudwatch/service_package_gen.go @@ -80,7 +80,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Tags: unique.Make(inttypes.ServicePackageResourceTags{ IdentifierAttribute: names.AttrARN, }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity("alarm_name"), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceMetricStream, diff --git a/internal/service/cloudwatch/testdata/MetricAlarm/basic/main_gen.tf b/internal/service/cloudwatch/testdata/MetricAlarm/basic/main_gen.tf new file mode 100644 index 000000000000..afeae1c0c0c5 --- /dev/null +++ b/internal/service/cloudwatch/testdata/MetricAlarm/basic/main_gen.tf @@ -0,0 +1,25 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = var.rName + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = 2 + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = 120 + statistic = "Average" + threshold = 80 + alarm_description = "This metric monitors ec2 cpu utilization" + insufficient_data_actions = [] + + dimensions = { + InstanceId = "i-abcd1234" + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/cloudwatch/testdata/MetricAlarm/basic_v6.7.0/main_gen.tf b/internal/service/cloudwatch/testdata/MetricAlarm/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..74c48c608bdf --- /dev/null +++ b/internal/service/cloudwatch/testdata/MetricAlarm/basic_v6.7.0/main_gen.tf @@ -0,0 +1,35 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = var.rName + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = 2 + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = 120 + statistic = "Average" + threshold = 80 + alarm_description = "This metric monitors ec2 cpu utilization" + insufficient_data_actions = [] + + dimensions = { + InstanceId = "i-abcd1234" + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/cloudwatch/testdata/MetricAlarm/region_override/main_gen.tf b/internal/service/cloudwatch/testdata/MetricAlarm/region_override/main_gen.tf new file mode 100644 index 000000000000..fbb2b23e76b7 --- /dev/null +++ b/internal/service/cloudwatch/testdata/MetricAlarm/region_override/main_gen.tf @@ -0,0 +1,33 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_metric_alarm" "test" { + region = var.region + + alarm_name = var.rName + comparison_operator = "GreaterThanOrEqualToThreshold" + evaluation_periods = 2 + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = 120 + statistic = "Average" + threshold = 80 + alarm_description = "This metric monitors ec2 cpu utilization" + insufficient_data_actions = [] + + dimensions = { + InstanceId = "i-abcd1234" + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/cloudwatch/testdata/tmpl/metric_alarm_tags.gtpl b/internal/service/cloudwatch/testdata/tmpl/metric_alarm_tags.gtpl index aeb77b32e1f3..41f309b38785 100644 --- a/internal/service/cloudwatch/testdata/tmpl/metric_alarm_tags.gtpl +++ b/internal/service/cloudwatch/testdata/tmpl/metric_alarm_tags.gtpl @@ -1,4 +1,5 @@ resource "aws_cloudwatch_metric_alarm" "test" { +{{- template "region" }} alarm_name = var.rName comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = 2 diff --git a/internal/service/codeartifact/domain_identity_gen_test.go b/internal/service/codeartifact/domain_identity_gen_test.go index 7cb63b1f821d..cd77b9c9b887 100644 --- a/internal/service/codeartifact/domain_identity_gen_test.go +++ b/internal/service/codeartifact/domain_identity_gen_test.go @@ -33,10 +33,11 @@ func testAccCodeArtifactDomain_IdentitySerial(t *testing.T) { func testAccCodeArtifactDomain_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_domain.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -122,7 +123,7 @@ func testAccCodeArtifactDomain_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codeartifact_domain.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,10 +240,11 @@ func testAccCodeArtifactDomain_Identity_RegionOverride(t *testing.T) { func testAccCodeArtifactDomain_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_domain.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeartifact/domain_permissions_policy_identity_gen_test.go b/internal/service/codeartifact/domain_permissions_policy_identity_gen_test.go index 6e658290e129..f897420687b2 100644 --- a/internal/service/codeartifact/domain_permissions_policy_identity_gen_test.go +++ b/internal/service/codeartifact/domain_permissions_policy_identity_gen_test.go @@ -33,10 +33,11 @@ func testAccCodeArtifactDomainPermissionsPolicy_IdentitySerial(t *testing.T) { func testAccCodeArtifactDomainPermissionsPolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_domain_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -121,7 +122,7 @@ func testAccCodeArtifactDomainPermissionsPolicy_Identity_RegionOverride(t *testi resourceName := "aws_codeartifact_domain_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -237,10 +238,11 @@ func testAccCodeArtifactDomainPermissionsPolicy_Identity_RegionOverride(t *testi func testAccCodeArtifactDomainPermissionsPolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_domain_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeartifact/repository_identity_gen_test.go b/internal/service/codeartifact/repository_identity_gen_test.go index c58eab0f8a15..3e1f7c065654 100644 --- a/internal/service/codeartifact/repository_identity_gen_test.go +++ b/internal/service/codeartifact/repository_identity_gen_test.go @@ -33,10 +33,11 @@ func testAccCodeArtifactRepository_IdentitySerial(t *testing.T) { func testAccCodeArtifactRepository_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_repository.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -122,7 +123,7 @@ func testAccCodeArtifactRepository_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codeartifact_repository.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,10 +240,11 @@ func testAccCodeArtifactRepository_Identity_RegionOverride(t *testing.T) { func testAccCodeArtifactRepository_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_repository.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeartifact/repository_permissions_policy_identity_gen_test.go b/internal/service/codeartifact/repository_permissions_policy_identity_gen_test.go index 08b151290337..1c408eae7305 100644 --- a/internal/service/codeartifact/repository_permissions_policy_identity_gen_test.go +++ b/internal/service/codeartifact/repository_permissions_policy_identity_gen_test.go @@ -33,10 +33,11 @@ func testAccCodeArtifactRepositoryPermissionsPolicy_IdentitySerial(t *testing.T) func testAccCodeArtifactRepositoryPermissionsPolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_repository_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -121,7 +122,7 @@ func testAccCodeArtifactRepositoryPermissionsPolicy_Identity_RegionOverride(t *t resourceName := "aws_codeartifact_repository_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -237,10 +238,11 @@ func testAccCodeArtifactRepositoryPermissionsPolicy_Identity_RegionOverride(t *t func testAccCodeArtifactRepositoryPermissionsPolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codeartifact_repository_permissions_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeartifact/service_endpoint_resolver_gen.go b/internal/service/codeartifact/service_endpoint_resolver_gen.go index 0dbf8a6633e5..61629b968d61 100644 --- a/internal/service/codeartifact/service_endpoint_resolver_gen.go +++ b/internal/service/codeartifact/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codeartifact.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codeartifact endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codeartifact endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index b437ffbecc4e..47c7ecdd8409 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codebuild/fleet_identity_gen_test.go b/internal/service/codebuild/fleet_identity_gen_test.go index 79001c2d2b4e..544c89dd2ea6 100644 --- a/internal/service/codebuild/fleet_identity_gen_test.go +++ b/internal/service/codebuild/fleet_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccCodeBuildFleet_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codebuild_fleet.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccCodeBuildFleet_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codebuild_fleet.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccCodeBuildFleet_Identity_RegionOverride(t *testing.T) { func TestAccCodeBuildFleet_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codebuild_fleet.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codebuild/project_identity_gen_test.go b/internal/service/codebuild/project_identity_gen_test.go index 8b52057f6236..189fb3f4062b 100644 --- a/internal/service/codebuild/project_identity_gen_test.go +++ b/internal/service/codebuild/project_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeBuildProject_Identity_Basic(t *testing.T) { resourceName := "aws_codebuild_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccCodeBuildProject_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codebuild_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -244,7 +244,7 @@ func TestAccCodeBuildProject_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codebuild_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codebuild/report_group_identity_gen_test.go b/internal/service/codebuild/report_group_identity_gen_test.go index f42293e2bd3b..9cae3b523866 100644 --- a/internal/service/codebuild/report_group_identity_gen_test.go +++ b/internal/service/codebuild/report_group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeBuildReportGroup_Identity_Basic(t *testing.T) { resourceName := "aws_codebuild_report_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -116,7 +116,7 @@ func TestAccCodeBuildReportGroup_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codebuild_report_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -244,7 +244,7 @@ func TestAccCodeBuildReportGroup_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codebuild_report_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codebuild/resource_policy_identity_gen_test.go b/internal/service/codebuild/resource_policy_identity_gen_test.go index 90829c9be154..c509fbcab669 100644 --- a/internal/service/codebuild/resource_policy_identity_gen_test.go +++ b/internal/service/codebuild/resource_policy_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeBuildResourcePolicy_Identity_Basic(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCodeBuildResourcePolicy_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccCodeBuildResourcePolicy_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codebuild/service_endpoint_resolver_gen.go b/internal/service/codebuild/service_endpoint_resolver_gen.go index 6d53d631f818..30d0a25780ab 100644 --- a/internal/service/codebuild/service_endpoint_resolver_gen.go +++ b/internal/service/codebuild/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codebuild.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codebuild endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codebuild endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index 1dd22158f65a..37297f24583c 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codebuild/source_credential_identity_gen_test.go b/internal/service/codebuild/source_credential_identity_gen_test.go index bf293d49c5da..8efb868ac1c3 100644 --- a/internal/service/codebuild/source_credential_identity_gen_test.go +++ b/internal/service/codebuild/source_credential_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeBuildSourceCredential_Identity_Basic(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccCodeBuildSourceCredential_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -252,7 +252,7 @@ func TestAccCodeBuildSourceCredential_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codecatalyst/service_endpoint_resolver_gen.go b/internal/service/codecatalyst/service_endpoint_resolver_gen.go index b872e775e929..b4e731da0eb5 100644 --- a/internal/service/codecatalyst/service_endpoint_resolver_gen.go +++ b/internal/service/codecatalyst/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codecatalyst.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codecatalyst endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codecatalyst endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codecommit/service_endpoint_resolver_gen.go b/internal/service/codecommit/service_endpoint_resolver_gen.go index cebee387ec6d..2a24886b8c51 100644 --- a/internal/service/codecommit/service_endpoint_resolver_gen.go +++ b/internal/service/codecommit/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codecommit.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codecommit endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codecommit endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index f14c14dfdb62..40410f0c1b67 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codeconnections/connection.go b/internal/service/codeconnections/connection.go index 7d5b4c3c23c8..eecfab53d039 100644 --- a/internal/service/codeconnections/connection.go +++ b/internal/service/codeconnections/connection.go @@ -37,6 +37,7 @@ import ( // @Tags(identifierAttribute="arn") // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/codeconnections/types;types.Connection") +// @Testing(preIdentityVersion="v5.100.0") func newConnectionResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &connectionResource{} diff --git a/internal/service/codeconnections/connection_identity_gen_test.go b/internal/service/codeconnections/connection_identity_gen_test.go index 49d0653206a8..229def0611ba 100644 --- a/internal/service/codeconnections/connection_identity_gen_test.go +++ b/internal/service/codeconnections/connection_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeConnectionsConnection_Identity_Basic(t *testing.T) { resourceName := "aws_codeconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCodeConnectionsConnection_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codeconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccCodeConnectionsConnection_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codeconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeconnections/connection_tags_gen_test.go b/internal/service/codeconnections/connection_tags_gen_test.go index 74f3de0814af..ee2211c3a2f8 100644 --- a/internal/service/codeconnections/connection_tags_gen_test.go +++ b/internal/service/codeconnections/connection_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCodeConnectionsConnection_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccCodeConnectionsConnection_tags(t *testing.T) { func TestAccCodeConnectionsConnection_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccCodeConnectionsConnection_tags_null(t *testing.T) { func TestAccCodeConnectionsConnection_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccCodeConnectionsConnection_tags_EmptyMap(t *testing.T) { func TestAccCodeConnectionsConnection_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccCodeConnectionsConnection_tags_AddOnUpdate(t *testing.T) { func TestAccCodeConnectionsConnection_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccCodeConnectionsConnection_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCodeConnectionsConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccCodeConnectionsConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCodeConnectionsConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccCodeConnectionsConnection_tags_EmptyTag_OnUpdate_Replace(t *testing. func TestAccCodeConnectionsConnection_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_providerOnly(t *testing.T func TestAccCodeConnectionsConnection_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_nonOverlapping(t *testing func TestAccCodeConnectionsConnection_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_overlapping(t *testing.T) func TestAccCodeConnectionsConnection_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_updateToProviderOnly(t *t func TestAccCodeConnectionsConnection_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_updateToResourceOnly(t *t func TestAccCodeConnectionsConnection_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_emptyResourceTag(t *testi func TestAccCodeConnectionsConnection_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_emptyProviderOnlyTag(t *t func TestAccCodeConnectionsConnection_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_nullOverlappingResourceTa func TestAccCodeConnectionsConnection_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccCodeConnectionsConnection_tags_DefaultTags_nullNonOverlappingResourc func TestAccCodeConnectionsConnection_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccCodeConnectionsConnection_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCodeConnectionsConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccCodeConnectionsConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T func TestAccCodeConnectionsConnection_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccCodeConnectionsConnection_tags_ComputedTag_OnUpdate_Replace(t *testi func TestAccCodeConnectionsConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccCodeConnectionsConnection_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccCodeConnectionsConnection_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Connection resourceName := "aws_codeconnections_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/codeconnections/host.go b/internal/service/codeconnections/host.go index f4b0d07de13b..adfd583017ae 100644 --- a/internal/service/codeconnections/host.go +++ b/internal/service/codeconnections/host.go @@ -36,6 +36,7 @@ import ( // @Tags(identifierAttribute="arn") // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/codeconnections/types;types.Host") +// @Testing(preIdentityVersion="v5.100.0") func newHostResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &hostResource{} diff --git a/internal/service/codeconnections/host_identity_gen_test.go b/internal/service/codeconnections/host_identity_gen_test.go index eed0d1626de8..9dcbb9a1a72b 100644 --- a/internal/service/codeconnections/host_identity_gen_test.go +++ b/internal/service/codeconnections/host_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeConnectionsHost_Identity_Basic(t *testing.T) { resourceName := "aws_codeconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCodeConnectionsHost_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codeconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccCodeConnectionsHost_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codeconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codeconnections/host_tags_gen_test.go b/internal/service/codeconnections/host_tags_gen_test.go index 07199032c979..a1cb2684a20b 100644 --- a/internal/service/codeconnections/host_tags_gen_test.go +++ b/internal/service/codeconnections/host_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCodeConnectionsHost_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccCodeConnectionsHost_tags(t *testing.T) { func TestAccCodeConnectionsHost_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccCodeConnectionsHost_tags_null(t *testing.T) { func TestAccCodeConnectionsHost_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccCodeConnectionsHost_tags_EmptyMap(t *testing.T) { func TestAccCodeConnectionsHost_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccCodeConnectionsHost_tags_AddOnUpdate(t *testing.T) { func TestAccCodeConnectionsHost_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccCodeConnectionsHost_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCodeConnectionsHost_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccCodeConnectionsHost_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCodeConnectionsHost_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccCodeConnectionsHost_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccCodeConnectionsHost_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccCodeConnectionsHost_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccCodeConnectionsHost_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_overlapping(t *testing.T) { func TestAccCodeConnectionsHost_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccCodeConnectionsHost_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccCodeConnectionsHost_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccCodeConnectionsHost_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccCodeConnectionsHost_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccCodeConnectionsHost_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccCodeConnectionsHost_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccCodeConnectionsHost_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccCodeConnectionsHost_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCodeConnectionsHost_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccCodeConnectionsHost_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccCodeConnectionsHost_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccCodeConnectionsHost_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccCodeConnectionsHost_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccCodeConnectionsHost_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccCodeConnectionsHost_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Host resourceName := "aws_codeconnections_host.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/codeconnections/service_endpoint_resolver_gen.go b/internal/service/codeconnections/service_endpoint_resolver_gen.go index 9ee7a27a43aa..fd577895d98d 100644 --- a/internal/service/codeconnections/service_endpoint_resolver_gen.go +++ b/internal/service/codeconnections/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codeconnections. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codeconnections endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codeconnections endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codeconnections/service_endpoints_gen_test.go b/internal/service/codeconnections/service_endpoints_gen_test.go index 99c39cd14209..690a98ff83db 100644 --- a/internal/service/codeconnections/service_endpoints_gen_test.go +++ b/internal/service/codeconnections/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codeguruprofiler/service_endpoint_resolver_gen.go b/internal/service/codeguruprofiler/service_endpoint_resolver_gen.go index 6f115a1df583..43a4ce62979a 100644 --- a/internal/service/codeguruprofiler/service_endpoint_resolver_gen.go +++ b/internal/service/codeguruprofiler/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codeguruprofiler }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codeguruprofiler endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codeguruprofiler endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index 286f64d4c0b0..a6eb0c2acb3a 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codegurureviewer/repository_association_identity_gen_test.go b/internal/service/codegurureviewer/repository_association_identity_gen_test.go index 19c7e5254737..7aaa44facfb3 100644 --- a/internal/service/codegurureviewer/repository_association_identity_gen_test.go +++ b/internal/service/codegurureviewer/repository_association_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_Identity_Basic(t *testing.T) { resourceName := "aws_codegurureviewer_repository_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_Identity_RegionOverride(t *tes resourceName := "aws_codegurureviewer_repository_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -252,7 +252,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_Identity_ExistingResource(t *t resourceName := "aws_codegurureviewer_repository_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codegurureviewer/service_endpoint_resolver_gen.go b/internal/service/codegurureviewer/service_endpoint_resolver_gen.go index 0d7e0ab38a23..6ca55099ed2f 100644 --- a/internal/service/codegurureviewer/service_endpoint_resolver_gen.go +++ b/internal/service/codegurureviewer/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codegurureviewer }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codegurureviewer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codegurureviewer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index bf89631af936..cab6491f6600 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -524,7 +524,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codepipeline/service_endpoint_resolver_gen.go b/internal/service/codepipeline/service_endpoint_resolver_gen.go index c0b3834345d7..d7b579b09757 100644 --- a/internal/service/codepipeline/service_endpoint_resolver_gen.go +++ b/internal/service/codepipeline/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codepipeline.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codepipeline endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codepipeline endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index 1d7fa4fed182..543c7203b9d6 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codepipeline/webhook_identity_gen_test.go b/internal/service/codepipeline/webhook_identity_gen_test.go index 046d2da3e779..2ab627ad77da 100644 --- a/internal/service/codepipeline/webhook_identity_gen_test.go +++ b/internal/service/codepipeline/webhook_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccCodePipelineWebhook_Identity_Basic(t *testing.T) { resourceName := "aws_codepipeline_webhook.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -118,7 +118,7 @@ func TestAccCodePipelineWebhook_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codepipeline_webhook.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -244,7 +244,7 @@ func TestAccCodePipelineWebhook_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codepipeline_webhook.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codestarconnections/connection_identity_gen_test.go b/internal/service/codestarconnections/connection_identity_gen_test.go index dbb8797e625b..d274b5e0ecff 100644 --- a/internal/service/codestarconnections/connection_identity_gen_test.go +++ b/internal/service/codestarconnections/connection_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeStarConnectionsConnection_Identity_Basic(t *testing.T) { resourceName := "aws_codestarconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCodeStarConnectionsConnection_Identity_RegionOverride(t *testing.T) resourceName := "aws_codestarconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccCodeStarConnectionsConnection_Identity_ExistingResource(t *testing.T resourceName := "aws_codestarconnections_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codestarconnections/host_identity_gen_test.go b/internal/service/codestarconnections/host_identity_gen_test.go index 1c61706628d0..c1ccf36bf0d1 100644 --- a/internal/service/codestarconnections/host_identity_gen_test.go +++ b/internal/service/codestarconnections/host_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCodeStarConnectionsHost_Identity_Basic(t *testing.T) { resourceName := "aws_codestarconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccCodeStarConnectionsHost_Identity_RegionOverride(t *testing.T) { resourceName := "aws_codestarconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccCodeStarConnectionsHost_Identity_ExistingResource(t *testing.T) { resourceName := "aws_codestarconnections_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codestarconnections/service_endpoint_resolver_gen.go b/internal/service/codestarconnections/service_endpoint_resolver_gen.go index 0309b4aabb71..451c75d2a63d 100644 --- a/internal/service/codestarconnections/service_endpoint_resolver_gen.go +++ b/internal/service/codestarconnections/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codestarconnecti }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codestarconnections endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codestarconnections endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index 6105907f9700..4981f221e057 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/codestarnotifications/notification_rule.go b/internal/service/codestarnotifications/notification_rule.go index d7adb4ef1ef2..f52424dcc1ad 100644 --- a/internal/service/codestarnotifications/notification_rule.go +++ b/internal/service/codestarnotifications/notification_rule.go @@ -273,7 +273,7 @@ func cleanupNotificationRuleTargets(ctx context.Context, conn *codestarnotificat TargetAddress: aws.String(target[names.AttrAddress].(string)), } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, targetSubscriptionTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, targetSubscriptionTimeout, func(ctx context.Context) (any, error) { return conn.DeleteTarget(ctx, input) }, "ValidationException", notificationRuleErrorSubscribed) diff --git a/internal/service/codestarnotifications/notification_rule_identity_gen_test.go b/internal/service/codestarnotifications/notification_rule_identity_gen_test.go index 9ff2bec514d9..a34627ae3f7f 100644 --- a/internal/service/codestarnotifications/notification_rule_identity_gen_test.go +++ b/internal/service/codestarnotifications/notification_rule_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccCodeStarNotificationsNotificationRule_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codestarnotifications_notification_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccCodeStarNotificationsNotificationRule_Identity_RegionOverride(t *tes resourceName := "aws_codestarnotifications_notification_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -225,10 +226,11 @@ func TestAccCodeStarNotificationsNotificationRule_Identity_RegionOverride(t *tes func TestAccCodeStarNotificationsNotificationRule_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_codestarnotifications_notification_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/codestarnotifications/service_endpoint_resolver_gen.go b/internal/service/codestarnotifications/service_endpoint_resolver_gen.go index 61b664d96438..6008a1692062 100644 --- a/internal/service/codestarnotifications/service_endpoint_resolver_gen.go +++ b/internal/service/codestarnotifications/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codestarnotifica }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codestarnotifications endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codestarnotifications endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index c56f4c48c06e..bad8f3da2b2e 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cognitoidentity/service_endpoint_resolver_gen.go b/internal/service/cognitoidentity/service_endpoint_resolver_gen.go index c14463b14c56..615a86f4c443 100644 --- a/internal/service/cognitoidentity/service_endpoint_resolver_gen.go +++ b/internal/service/cognitoidentity/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cognitoidentity. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cognitoidentity endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cognitoidentity endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index 97d1c5286400..425d4095f71a 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cognitoidp/log_delivery_configuration_identity_gen_test.go b/internal/service/cognitoidp/log_delivery_configuration_identity_gen_test.go index 7ca63fd1f9b5..f0c97acdb84c 100644 --- a/internal/service/cognitoidp/log_delivery_configuration_identity_gen_test.go +++ b/internal/service/cognitoidp/log_delivery_configuration_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccCognitoIDPLogDeliveryConfiguration_Identity_Basic(t *testing.T) { resourceName := "aws_cognito_log_delivery_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -114,7 +114,7 @@ func TestAccCognitoIDPLogDeliveryConfiguration_Identity_RegionOverride(t *testin resourceName := "aws_cognito_log_delivery_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -204,7 +204,7 @@ func TestAccCognitoIDPLogDeliveryConfiguration_Identity_ExistingResource(t *test resourceName := "aws_cognito_log_delivery_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/cognitoidp/managed_user_pool_client.go b/internal/service/cognitoidp/managed_user_pool_client.go index 129d9a0b3e8a..62e082bcb496 100644 --- a/internal/service/cognitoidp/managed_user_pool_client.go +++ b/internal/service/cognitoidp/managed_user_pool_client.go @@ -493,7 +493,7 @@ func (r *managedUserPoolClientResource) Create(ctx context.Context, request reso const ( timeout = 2 * time.Minute ) - output, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, timeout, func() (any, error) { + output, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateUserPoolClient(ctx, &input) }) if err != nil { @@ -605,7 +605,7 @@ func (r *managedUserPoolClientResource) Update(ctx context.Context, request reso const ( timeout = 2 * time.Minute ) - output, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, timeout, func() (any, error) { + output, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateUserPoolClient(ctx, &input) }) diff --git a/internal/service/cognitoidp/risk_configuration.go b/internal/service/cognitoidp/risk_configuration.go index db27296c2ec2..e546ef12e0f5 100644 --- a/internal/service/cognitoidp/risk_configuration.go +++ b/internal/service/cognitoidp/risk_configuration.go @@ -115,7 +115,7 @@ func resourceRiskConfiguration() *schema.Resource { }, "notify_configuration": { Type: schema.TypeList, - Required: true, + Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -580,7 +580,7 @@ func flattenAccountTakeoverRiskConfigurationType(apiObject *awstypes.AccountTake } if v := apiObject.NotifyConfiguration; v != nil { - tfMap["notify_configuration"] = flattemNotifyConfigurationType(v) + tfMap["notify_configuration"] = flattenNotifyConfigurationType(v) } return []any{tfMap} @@ -698,7 +698,7 @@ func expandNotifyConfigurationType(tfList []any) *awstypes.NotifyConfigurationTy return apiObject } -func flattemNotifyConfigurationType(apiObject *awstypes.NotifyConfigurationType) []any { +func flattenNotifyConfigurationType(apiObject *awstypes.NotifyConfigurationType) []any { if apiObject == nil { return nil } diff --git a/internal/service/cognitoidp/risk_configuration_test.go b/internal/service/cognitoidp/risk_configuration_test.go index 88ab69c7652f..648b322eae6c 100644 --- a/internal/service/cognitoidp/risk_configuration_test.go +++ b/internal/service/cognitoidp/risk_configuration_test.go @@ -136,6 +136,43 @@ func TestAccCognitoIDPRiskConfiguration_compromised(t *testing.T) { }) } +func TestAccCognitoIDPRiskConfiguration_takeover_without_notification(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_cognito_risk_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.CognitoIDPServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRiskConfigurationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRiskConfigurationConfig_takeover_without_notification(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRiskConfigurationExists(ctx, resourceName), + resource.TestCheckResourceAttrPair(resourceName, names.AttrUserPoolID, "aws_cognito_user_pool.test", names.AttrID), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.medium_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.medium_action.0.event_action", "MFA_REQUIRED"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.medium_action.0.notify", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.high_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.high_action.0.event_action", "BLOCK"), + resource.TestCheckResourceAttr(resourceName, "account_takeover_risk_configuration.0.actions.0.high_action.0.notify", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "compromised_credentials_risk_configuration.#", "0"), + resource.TestCheckResourceAttr(resourceName, "risk_exception_configuration.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccCognitoIDPRiskConfiguration_disappears(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -404,3 +441,28 @@ resource "aws_cognito_user_pool" "test" { } `, rName) } + +func testAccRiskConfigurationConfig_takeover_without_notification(rName string) string { + return fmt.Sprintf(` +resource "aws_cognito_risk_configuration" "test" { + user_pool_id = aws_cognito_user_pool.test.id + + account_takeover_risk_configuration { + actions { + medium_action { + event_action = "MFA_REQUIRED" + notify = false + } + high_action { + event_action = "BLOCK" + notify = false + } + } + } +} + +resource "aws_cognito_user_pool" "test" { + name = %[1]q +} +`, rName) +} diff --git a/internal/service/cognitoidp/service_endpoint_resolver_gen.go b/internal/service/cognitoidp/service_endpoint_resolver_gen.go index 703a68b75e7d..16da1d321ff5 100644 --- a/internal/service/cognitoidp/service_endpoint_resolver_gen.go +++ b/internal/service/cognitoidp/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params cognitoidentityp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up cognitoidentityprovider endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up cognitoidentityprovider endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index 08f7d88fda4e..843d3d3c83d5 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -603,7 +603,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cognitoidp/user_pool_client.go b/internal/service/cognitoidp/user_pool_client.go index c1da9de2fe57..ebc38a887c5f 100644 --- a/internal/service/cognitoidp/user_pool_client.go +++ b/internal/service/cognitoidp/user_pool_client.go @@ -472,7 +472,7 @@ func (r *userPoolClientResource) Update(ctx context.Context, request resource.Up const ( timeout = 2 * time.Minute ) - output, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, timeout, func() (any, error) { + output, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateUserPoolClient(ctx, &input) }) diff --git a/internal/service/cognitoidp/user_pool_data_source_tags_gen_test.go b/internal/service/cognitoidp/user_pool_data_source_tags_gen_test.go index 87120e1559e9..98eeeff2a1f3 100644 --- a/internal/service/cognitoidp/user_pool_data_source_tags_gen_test.go +++ b/internal/service/cognitoidp/user_pool_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccCognitoIDPUserPoolDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccCognitoIDPUserPoolDataSource_tags(t *testing.T) { func TestAccCognitoIDPUserPoolDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccCognitoIDPUserPoolDataSource_tags_NullMap(t *testing.T) { func TestAccCognitoIDPUserPoolDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccCognitoIDPUserPoolDataSource_tags_EmptyMap(t *testing.T) { func TestAccCognitoIDPUserPoolDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccCognitoIDPUserPoolDataSource_tags_DefaultTags_nonOverlapping(t *test func TestAccCognitoIDPUserPoolDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccCognitoIDPUserPoolDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccCognitoIDPUserPoolDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/cognitoidp/user_pool_tags_gen_test.go b/internal/service/cognitoidp/user_pool_tags_gen_test.go index 007d1421413e..bba310e219c3 100644 --- a/internal/service/cognitoidp/user_pool_tags_gen_test.go +++ b/internal/service/cognitoidp/user_pool_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccCognitoIDPUserPool_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccCognitoIDPUserPool_tags(t *testing.T) { func TestAccCognitoIDPUserPool_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccCognitoIDPUserPool_tags_null(t *testing.T) { func TestAccCognitoIDPUserPool_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccCognitoIDPUserPool_tags_EmptyMap(t *testing.T) { func TestAccCognitoIDPUserPool_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccCognitoIDPUserPool_tags_AddOnUpdate(t *testing.T) { func TestAccCognitoIDPUserPool_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccCognitoIDPUserPool_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccCognitoIDPUserPool_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccCognitoIDPUserPool_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccCognitoIDPUserPool_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccCognitoIDPUserPool_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccCognitoIDPUserPool_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccCognitoIDPUserPool_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccCognitoIDPUserPool_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_overlapping(t *testing.T) { func TestAccCognitoIDPUserPool_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccCognitoIDPUserPool_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccCognitoIDPUserPool_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccCognitoIDPUserPool_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccCognitoIDPUserPool_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccCognitoIDPUserPool_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccCognitoIDPUserPool_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccCognitoIDPUserPool_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccCognitoIDPUserPool_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccCognitoIDPUserPool_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccCognitoIDPUserPool_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccCognitoIDPUserPool_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccCognitoIDPUserPool_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccCognitoIDPUserPool_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccCognitoIDPUserPool_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccCognitoIDPUserPool_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.UserPoolType resourceName := "aws_cognito_user_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/comprehend/document_classifier_identity_gen_test.go b/internal/service/comprehend/document_classifier_identity_gen_test.go index 01e20f22cbd4..3d149a357c0d 100644 --- a/internal/service/comprehend/document_classifier_identity_gen_test.go +++ b/internal/service/comprehend/document_classifier_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccComprehendDocumentClassifier_Identity_Basic(t *testing.T) { resourceName := "aws_comprehend_document_classifier.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccComprehendDocumentClassifier_Identity_RegionOverride(t *testing.T) { resourceName := "aws_comprehend_document_classifier.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccComprehendDocumentClassifier_Identity_ExistingResource(t *testing.T) resourceName := "aws_comprehend_document_classifier.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/comprehend/entity_recognizer_identity_gen_test.go b/internal/service/comprehend/entity_recognizer_identity_gen_test.go index f86c253591bc..06c220b40ee4 100644 --- a/internal/service/comprehend/entity_recognizer_identity_gen_test.go +++ b/internal/service/comprehend/entity_recognizer_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccComprehendEntityRecognizer_Identity_Basic(t *testing.T) { resourceName := "aws_comprehend_entity_recognizer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccComprehendEntityRecognizer_Identity_RegionOverride(t *testing.T) { resourceName := "aws_comprehend_entity_recognizer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccComprehendEntityRecognizer_Identity_ExistingResource(t *testing.T) { resourceName := "aws_comprehend_entity_recognizer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/comprehend/service_endpoint_resolver_gen.go b/internal/service/comprehend/service_endpoint_resolver_gen.go index b0affcf92068..56a15e2fcf38 100644 --- a/internal/service/comprehend/service_endpoint_resolver_gen.go +++ b/internal/service/comprehend/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params comprehend.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up comprehend endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up comprehend endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index 9b81f6139ff8..57e82777efca 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/comprehend/test-fixtures/document_classifier/documents.csv b/internal/service/comprehend/test-fixtures/document_classifier/documents.csv index 610aba6048c7..6680fbf79142 100644 --- a/internal/service/comprehend/test-fixtures/document_classifier/documents.csv +++ b/internal/service/comprehend/test-fixtures/document_classifier/documents.csv @@ -1,100 +1,100 @@ -SPAM,"Dear Gerson Parker,\n\nBuy a Awesome Rubber Table from Grady-Stiedemann now!\n" -SPAM,"Hello Dr. Eunice Leannon,\n\nNow available!\n\nA Awesome Wooden Hat from Kiehn DDS\n" -SPAM,"Dear Delaney Fisher,\n\nBuy a Sleek Rubber Chair from Kilback-Hettinger now!\n" -SPAM,"Hello Mr. Elias Quitzon,\n\nNow available!\n\nA Practical Cotton Gloves from Schiller, Kemmer and Gulgowski\n" -PHISHING,"Dear Miss Marquise Jerde,\n\nYour transaction VvAr5Zg2JY has failed.\n\nCall 849.371.9905 for help.\n" -PHISHING,"Taryn Pfannerstill,\n\nYour order number 1tVfsJHalz has been returned.\n\nCall 756.681.2363 x628 to get help.\n" -PHISHING,"Hello Jett Armstrong,\n\nCall 737-319-3312 for help with your order brEaM7qfDv. Otherwise it will be returned to the sender.\n" -PHISHING,"Hello Graham Stoltenberg,\n\nCall 523-585-1577 for help with your order vh0wYmrvrv. Otherwise it will be returned to the sender.\n" -SPAM,"Hello Ulises Davis,\n\nNow available!\n\nA Small Granite Table from Jaskolski-Prohaska\n" -SPAM,"Hello Ms. Santos Weimann,\n\nNow available!\n\nA Ergonomic Plastic Computer from Robel-Ziemann\n" -SPAM,"Dear Lorna Hodkiewicz,\n\nBuy a Fantastic Steel Chair from Adams PhD now!\n" -PHISHING,"Aracely Christiansen,\n\nYour order number T8u4P1yQfG has been returned.\n\nCall 747-226-9061 to get help.\n" -SPAM,"Angeline Lebsack,\n\nDon't miss out on buying Wisozk-Rowe's Gorgeous Granite Computer today!\n" -SPAM,"Asha Greenholt,\n\nDon't miss out on buying Bernier PhD's Ergonomic Wooden Table today!\n" -PHISHING,"Dear Miss Flavio Smith,\n\nYour transaction hQ7oGKDHJd has failed.\n\nCall 442.751.9030 x9030 for help.\n" -SPAM,"Dear Ms. Carolina Mante,\n\nBuy a Rustic Plastic Table from Mayert V now!\n" -SPAM,"Hello Mr. Molly Goldner,\n\nNow available!\n\nA Rustic Cotton Car from Crona, McClure and Harber\n" -SPAM,"Hello Mia Larkin II,\n\nNow available!\n\nA Intelligent Cotton Car from Lesch III\n" -SPAM,"Al Gerlach V,\n\nDon't miss out on buying Daniel Jr.'s Intelligent Granite Shirt today!\n" -SPAM,"Dear Heath Kessler,\n\nBuy a Small Cotton Table from Kohler, Lindgren and Jacobson now!\n" -SPAM,"Dr. Ahmed Schneider,\n\nDon't miss out on buying Bogisich, Turcotte and Fay's Ergonomic Concrete Table today!\n" -PHISHING,"Dear Alena Mueller,\n\nYour transaction Kc0ov0TbVO has failed.\n\nCall 340.200.4353 x1049 for help.\n" -SPAM,"Dear Dewayne Turner,\n\nBuy a Rustic Plastic Table from Will II now!\n" -PHISHING,"Kaleb Durgan,\n\nYour order number qo5aid70LZ has been returned.\n\nCall 1-271-529-2911 to get help.\n" -SPAM,"Dear Rickie Reilly,\n\nBuy a Intelligent Cotton Table from Von, Koss and Cormier now!\n" -SPAM,"Brant Hettinger,\n\nDon't miss out on buying Schamberger-Bartoletti's Incredible Steel Shoes today!\n" -SPAM,"Dear Miss Heath Smith,\n\nBuy a Intelligent Rubber Shirt from Lindgren-Goldner now!\n" -PHISHING,"Modesto Monahan DVM,\n\nYour order number 8S3xS6mvEc has been returned.\n\nCall 1-526-152-9870 to get help.\n" -PHISHING,"Dear Genesis Wintheiser II,\n\nYour transaction 133wf0wD7e has failed.\n\nCall (330) 015-6966 for help.\n" -SPAM,"Hello Napoleon Sauer,\n\nNow available!\n\nA Practical Granite Chair from Lubowitz, Bartell and Mohr\n" -SPAM,"Dear Jennifer Buckridge,\n\nBuy a Gorgeous Rubber Table from Stroman DVM now!\n" -SPAM,"Dear Weldon Beatty IV,\n\nBuy a Sleek Wooden Computer from Bartell IV now!\n" -PHISHING,"Hello Nicholaus Beer,\n\nCall 1-806-724-1386 x5254 for help with your order FqmAcdUQBU. Otherwise it will be returned to the sender.\n" -SPAM,"Hello Dr. Aron Reichert,\n\nNow available!\n\nA Gorgeous Cotton Pants from Hagenes-Torp\n" -SPAM,"Hello Kathlyn Bechtelar,\n\nNow available!\n\nA Awesome Rubber Table from Zulauf Jr.\n" -SPAM,"Dear Dedrick Corkery V,\n\nBuy a Incredible Plastic Pants from Kirlin IV now!\n" -PHISHING,"Hello Margarett Kunze,\n\nCall (744) 342-3400 for help with your order Hs28ZR7V52. Otherwise it will be returned to the sender.\n" -SPAM,"Dear Maegan Trantow,\n\nBuy a Small Concrete Car from Greenholt II now!\n" -SPAM,"Granville O'Connell,\n\nDon't miss out on buying Osinski, Pollich and Block's Gorgeous Plastic Hat today!\n" -PHISHING,"Hello Sherman Waelchi II,\n\nCall (836) 650-2349 for help with your order u0u8Bz4LFX. Otherwise it will be returned to the sender.\n" -SPAM,"Dear Murl Jacobi,\n\nBuy a Gorgeous Steel Shirt from Rowe, Quigley and Monahan now!\n" -SPAM,"Katelin Blick,\n\nDon't miss out on buying Rau, Moore and Will's Gorgeous Granite Shoes today!\n" -SPAM,"Savanna Kuhlman,\n\nDon't miss out on buying Berge, Hane and Bartoletti's Ergonomic Plastic Chair today!\n" -SPAM,"Hello Mr. Marlin Nitzsche,\n\nNow available!\n\nA Small Wooden Shirt from Paucek, Willms and Beier\n" -SPAM,"Thomas Towne,\n\nDon't miss out on buying Herzog-Hagenes's Practical Granite Table today!\n" -PHISHING,"Melisa Barton Jr.,\n\nYour order number glADPbXwsV has been returned.\n\nCall 477-926-9464 x9324 to get help.\n" -PHISHING,"Norris Rodriguez,\n\nYour order number Tda57LYtFu has been returned.\n\nCall 1-413-187-4231 x0502 to get help.\n" -PHISHING,"Mrs. Bethel Carroll,\n\nYour order number J6xmnKvbV7 has been returned.\n\nCall 262-359-0480 x7240 to get help.\n" -PHISHING,"Dear Miss Jarvis Langosh,\n\nYour transaction fpnGt85S0r has failed.\n\nCall 331-139-3076 x108 for help.\n" -SPAM,"Hello Lucas Frami,\n\nNow available!\n\nA Sleek Steel Hat from Gutkowski-Hahn\n" -SPAM,"Ms. Brittany Flatley,\n\nDon't miss out on buying Reinger-Breitenberg's Intelligent Wooden Table today!\n" -SPAM,"Hello Miss Hermina Gaylord,\n\nNow available!\n\nA Sleek Concrete Car from Windler-Lakin\n" -SPAM,"Hello Brooke Turner,\n\nNow available!\n\nA Small Concrete Computer from Kohler DVM\n" -PHISHING,"Sandra Hartmann,\n\nYour order number m0xwL3WB3I has been returned.\n\nCall (103) 816-8172 x77407 to get help.\n" -PHISHING,"Roslyn Jacobi,\n\nYour order number 6W52YP4eN6 has been returned.\n\nCall 825-473-1315 to get help.\n" -PHISHING,"Mr. Hudson Olson,\n\nYour order number hxYmRmAL4i has been returned.\n\nCall 953.009.3128 x16955 to get help.\n" -SPAM,"Hello Domenico Ondricka,\n\nNow available!\n\nA Intelligent Steel Hat from Orn, Muller and Krajcik\n" -PHISHING,"Loren Howell,\n\nYour order number 2VQ317gxaD has been returned.\n\nCall 872.335.0711 to get help.\n" -SPAM,"Tyshawn Volkman,\n\nDon't miss out on buying Toy, Parisian and Beatty's Awesome Plastic Table today!\n" -SPAM,"Dear Vidal Von,\n\nBuy a Incredible Rubber Shoes from Ratke, Jaskolski and Kertzmann now!\n" -PHISHING,"Lexi Skiles,\n\nYour order number MQva1tgMkb has been returned.\n\nCall 601-114-7684 x4783 to get help.\n" -SPAM,"Dear Derek Keeling,\n\nBuy a Incredible Rubber Pants from Auer-Leffler now!\n" -PHISHING,"Dear Miss Xavier Farrell,\n\nYour transaction mKbwVCQbhO has failed.\n\nCall 940.934.0097 x5583 for help.\n" -SPAM,"Jodie Homenick,\n\nDon't miss out on buying Nienow-Daniel's Small Wooden Shoes today!\n" -SPAM,"Dear Dr. Roxanne Weimann,\n\nBuy a Fantastic Rubber Table from Kuvalis-Ledner now!\n" -PHISHING,"Dear Weston Murazik,\n\nYour transaction aXErjPh1a3 has failed.\n\nCall 706-538-1102 for help.\n" -SPAM,"Hello Dr. Lorena Jerde,\n\nNow available!\n\nA Intelligent Steel Shoes from Schneider-Pouros\n" -SPAM,"Andreane Johns,\n\nDon't miss out on buying Fay IV's Fantastic Wooden Car today!\n" -PHISHING,"Hello Grant Lesch V,\n\nCall (539) 134-0217 for help with your order YzNiM1s5ta. Otherwise it will be returned to the sender.\n" -PHISHING,"Dear Ms. Lauryn Stark,\n\nYour transaction VSuFzoRvlp has failed.\n\nCall (174) 665-5559 for help.\n" -PHISHING,"Hello Mariam Schultz,\n\nCall 260.307.7248 for help with your order SKQPNL4pd4. Otherwise it will be returned to the sender.\n" -PHISHING,"Joanne Aufderhar,\n\nYour order number LG3a2cyYwA has been returned.\n\nCall 844.982.8008 to get help.\n" -PHISHING,"Hello Estella Hickle,\n\nCall 1-612-967-8683 x836 for help with your order vYfqTwp1eM. Otherwise it will be returned to the sender.\n" -PHISHING,"Hello Ewald Cronin,\n\nCall 544-301-9279 x995 for help with your order uFqjeJZxXN. Otherwise it will be returned to the sender.\n" -SPAM,"Hello Russel Langosh,\n\nNow available!\n\nA Practical Granite Computer from Boehm-Waelchi\n" -PHISHING,"Marty Swaniawski,\n\nYour order number FPa7TqGwmC has been returned.\n\nCall (456) 156-1419 x4820 to get help.\n" -PHISHING,"Mireille Keeling V,\n\nYour order number BMn2c6TZ1n has been returned.\n\nCall 832-286-0025 to get help.\n" -SPAM,"Jackie Reinger V,\n\nDon't miss out on buying Lindgren-Cronin's Practical Wooden Hat today!\n" -SPAM,"Dear Nellie Morar DVM,\n\nBuy a Awesome Plastic Pants from Schultz IV now!\n" -PHISHING,"Hello Allison Zemlak,\n\nCall (825) 541-7656 for help with your order DHIFdYRC8a. Otherwise it will be returned to the sender.\n" -SPAM,"Dear Stacy Fadel DDS,\n\nBuy a Intelligent Concrete Shirt from Anderson-Sanford now!\n" -PHISHING,"Dear Kathryne Tromp,\n\nYour transaction 0hsRFeFFQV has failed.\n\nCall 856-325-2229 for help.\n" -PHISHING,"Dear Kameron Schuster,\n\nYour transaction Jc64U5Z6bN has failed.\n\nCall 847-556-6672 for help.\n" -PHISHING,"Dear Cody Hilll,\n\nYour transaction 8JCmPX02QI has failed.\n\nCall 332.053.6289 x8723 for help.\n" -SPAM,"Hailie Hudson,\n\nDon't miss out on buying Heller, Fritsch and Larson's Gorgeous Cotton Gloves today!\n" -PHISHING,"Dear Quentin Morar,\n\nYour transaction v73CDOjujv has failed.\n\nCall (155) 212-4077 x101 for help.\n" -SPAM,"Dear Carley Runolfsdottir,\n\nBuy a Intelligent Wooden Shirt from Bogan, Bahringer and Hickle now!\n" -PHISHING,"Tyler Bayer,\n\nYour order number LuZbltqNac has been returned.\n\nCall 941-426-1385 x0820 to get help.\n" -SPAM,"Dear Mason Beatty,\n\nBuy a Awesome Plastic Hat from Koss, Upton and Jast now!\n" -SPAM,"Hello Bryana Upton,\n\nNow available!\n\nA Ergonomic Concrete Hat from Cummings-Douglas\n" -PHISHING,"Dear Giovanna Lebsack I,\n\nYour transaction U4w4gmd9gU has failed.\n\nCall 1-579-711-4905 x878 for help.\n" -PHISHING,"Dear Osvaldo Emard,\n\nYour transaction bG82oF1Ooe has failed.\n\nCall 650.367.4781 x67845 for help.\n" -PHISHING,"Dear Mrs. Vicky Hahn,\n\nYour transaction zdfgf1wDy5 has failed.\n\nCall 1-548-394-5141 x6462 for help.\n" -PHISHING,"Dear Dr. Seamus Keebler,\n\nYour transaction fQHpi64Fz0 has failed.\n\nCall (113) 105-1446 x282 for help.\n" -SPAM,"Mrs. Skyla Willms,\n\nDon't miss out on buying McKenzie, Cormier and Volkman's Rustic Concrete Gloves today!\n" -SPAM,"Hello Ollie Crooks,\n\nNow available!\n\nA Gorgeous Plastic Car from Murphy-Hills\n" -SPAM,"Dear Dr. Jarret Block,\n\nBuy a Awesome Wooden Pants from Schiller, Baumbach and Orn now!\n" -PHISHING,"Florine West,\n\nYour order number SuyZnOCgV1 has been returned.\n\nCall 591-926-5276 x1996 to get help.\n" -SPAM,"Dear Jason Fritsch,\n\nBuy a Practical Wooden Car from Carter-Hane now!\n" -PHISHING,"Hello Kayleigh Goldner DDS,\n\nCall 750.906.1703 x8827 for help with your order aUyaWd3SnK. Otherwise it will be returned to the sender.\n" +SPAM,"Dear Miller Zulauf,\n\nBuy a Boulevard Tank 7 from Gottlieb PLC now!\n" +SPAM,"Dear Ms. Kavon Konopelski PhD,\n\nBuy a Hill Farmstead Abner from Schmidt, Schmidt and Schmidt now!\n" +SPAM,"Dear Ms. Hannah Mante I,\n\nBuy a Bell’s Two Hearted from Stamm-Stamm now!\n" +SPAM,"Tyler Will,\n\nDon't miss out on buying Bahringer, Bahringer and Bahringer's Avery Mephistopheles Stout today!\n" +PHISHING,"Ms. Jakayla Vandervort,\n\nYour order number zwrfmprbhc has been returned.\n\nCall +1-261-844-1689 to get help.\n" +PHISHING,"Dear Kayleigh Bashirian I,\n\nYour transaction dlmiqubfcf has failed.\n\nCall 1-984-227-1127 for help.\n" +PHISHING,"Nia Batz,\n\nYour order number liiwbinqlq has been returned.\n\nCall 402-250-8383 x9865 to get help.\n" +PHISHING,"Mr. Gus Rice,\n\nYour order number xmpawgudin has been returned.\n\nCall 685.225.2961 x4503 to get help.\n" +SPAM,"Hello Elena Runolfsdottir IV,\n\nNow available!\n\nA Founders Red’s Rye from Witting Group\n" +SPAM,"Hello Ms. Marisa Borer V,\n\nNow available!\n\nA Haymarket Angry Birds Rye IPA from Larkin Inc\n" +PHISHING,"Hello Dale Wilkinson,\n\nCall 524.541.3910 x2765 for help with your order hxqmmhkgnq. Otherwise it will be returned to the sender.\n" +PHISHING,"Hello Mr. Zachery O'Keefe II,\n\nCall (754) 290-9755 x28617 for help with your order vvlcglhavy. Otherwise it will be returned to the sender.\n" +SPAM,"Rickey Hoeger,\n\nDon't miss out on buying Braun, Braun and Braun's Great Divide Yeti today!\n" +SPAM,"Dear Adella Feeney,\n\nBuy a Brooklyn Brewery Lager from Lubowitz and Sons now!\n" +SPAM,"Ms. Hollie Nikolaus Sr.,\n\nDon't miss out on buying Barrows-Barrows's Brooklyn Brewery Lager today!\n" +SPAM,"Hello Violet Schneider,\n\nNow available!\n\nA New Belgium Fat Tire from Von, Von and Von\n" +PHISHING,"Dear Sandrine Zulauf MD,\n\nYour transaction xfsocadaet has failed.\n\nCall 361.648.3656 x289 for help.\n" +PHISHING,"Mr. Charley Fahey,\n\nYour order number lfcbxzffto has been returned.\n\nCall 964.814.6026 x582 to get help.\n" +PHISHING,"Hello Lily Ritchie MD,\n\nCall +1 (235) 218-2052 for help with your order ayqcgejtvo. Otherwise it will be returned to the sender.\n" +SPAM,"Dear Weldon Leuschke,\n\nBuy a Boulevard Tank 7 from Shields-Shields now!\n" +SPAM,"Hello Thea Cronin,\n\nNow available!\n\nA Brewery Ommegang Three Philosophers from Oberbrunner, Oberbrunner and Oberbrunner\n" +SPAM,"Hello Rhett Shanahan,\n\nNow available!\n\nA Floyds Dark Lord from Bosco LLC\n" +PHISHING,"Carley Torphy,\n\nYour order number ahkptypafk has been returned.\n\nCall +1-621-812-1206 to get help.\n" +PHISHING,"Hello Ms. Adella Runolfsdottir DDS,\n\nCall 374.890.8913 for help with your order dvxyktwiso. Otherwise it will be returned to the sender.\n" +SPAM,"Hello Alan Walter Sr.,\n\nNow available!\n\nA Green Flash Palate Wrecker from Graham, Graham and Graham\n" +PHISHING,"Hello Molly Grant,\n\nCall (306) 627-7209 x71992 for help with your order qpnazfoijv. Otherwise it will be returned to the sender.\n" +PHISHING,"Dear Bailey Smith,\n\nYour transaction nvuisehndq has failed.\n\nCall 585-505-6343 x187 for help.\n" +PHISHING,"Mr. Jabari Borer,\n\nYour order number hbiqmmnjlu has been returned.\n\nCall 517-338-4467 x4199 to get help.\n" +SPAM,"Hilton O'Keefe,\n\nDon't miss out on buying Weissnat-Weissnat's Perennial Artisan Ales Abraxas Imperial Stout today!\n" +SPAM,"Ms. Carolina Jakubowski IV,\n\nDon't miss out on buying McLaughlin-McLaughlin's 21st Amendment Bitter American today!\n" +PHISHING,"Hello Stone Wisoky,\n\nCall 1-937-892-3418 x056 for help with your order eejtolsuzc. Otherwise it will be returned to the sender.\n" +SPAM,"Rylan Roob,\n\nDon't miss out on buying Harris-Harris's Saint Arnold Fancy Lawnmower today!\n" +PHISHING,"Dear Ms. Bonita Deckow V,\n\nYour transaction lobmlodwbi has failed.\n\nCall 673.284.1552 for help.\n" +SPAM,"Wilton Jaskolski,\n\nDon't miss out on buying Lubowitz PLC's Allagash White today!\n" +PHISHING,"Vernon Purdy,\n\nYour order number lewpstaxpn has been returned.\n\nCall 335.317.6581 x81749 to get help.\n" +SPAM,"Mallory Dietrich,\n\nDon't miss out on buying Yost-Yost's Deschutes Black Butte Porter today!\n" +PHISHING,"Guadalupe Stanton,\n\nYour order number iddgbzfnqp has been returned.\n\nCall +1.683.241.2135 to get help.\n" +PHISHING,"Dear Kasandra Ritchie,\n\nYour transaction myenxkuxto has failed.\n\nCall +1-458-407-6700 for help.\n" +PHISHING,"Hello Skylar Fritsch,\n\nCall 601-258-3052 x98651 for help with your order okbxafunej. Otherwise it will be returned to the sender.\n" +SPAM,"Dear Laney Nitzsche,\n\nBuy a Sierra Nevada Bigfoot Barleywine-Style Ale from Terry, Terry and Terry now!\n" +PHISHING,"Hello Gracie Cremin IV,\n\nCall (915) 290-2958 for help with your order esnlpvbxgw. Otherwise it will be returned to the sender.\n" +SPAM,"Kaelyn Schaden,\n\nDon't miss out on buying Bergnaum-Bergnaum's New Belgium Fat Tire today!\n" +SPAM,"Andres Borer,\n\nDon't miss out on buying Franecki-Franecki's Firestone Walker Parabola today!\n" +SPAM,"Dear Ms. Laurence Windler MD,\n\nBuy a Dale’s Pale Ale from Aufderhar Ltd now!\n" +SPAM,"Hello Leon Ferry,\n\nNow available!\n\nA Allagash Curieux from Little, Little and Little\n" +PHISHING,"Hello Reuben Green,\n\nCall +1.517.604.7444 for help with your order lceqaessmo. Otherwise it will be returned to the sender.\n" +SPAM,"Dear Ms. Alayna Jacobs,\n\nBuy a Avery Uncle Jacob’s Stout from Daugherty-Daugherty now!\n" +SPAM,"Hello Kade Schumm,\n\nNow available!\n\nA Foothills Brewing Sexual Chocolate from Kovacek-Kovacek\n" +SPAM,"Candida Boyer,\n\nDon't miss out on buying Krajcik, Krajcik and Krajcik's Great Lakes Edmund Fitzgerald Porter today!\n" +SPAM,"Mariana Nienow DVM,\n\nDon't miss out on buying Ward PLC's New Belgium Lips of Faith La Folie today!\n" +SPAM,"Hello Bret Grady,\n\nNow available!\n\nA Highland Cold Mountain Winter Ale from Beahan-Beahan\n" +PHISHING,"Hello Lillie Lebsack,\n\nCall 316.982.2906 x27941 for help with your order zlglrwnipa. Otherwise it will be returned to the sender.\n" +PHISHING,"Susanna Rolfson,\n\nYour order number xkrcxnrdrk has been returned.\n\nCall (223) 441-5035 x6167 to get help.\n" +SPAM,"Mr. Domenico Kertzmann I,\n\nDon't miss out on buying Hintz, Hintz and Hintz's Wild Heaven Eschaton today!\n" +SPAM,"Hillary Schinner,\n\nDon't miss out on buying Strosin-Strosin's Bell’s Two Hearted today!\n" +SPAM,"Harry O'Kon,\n\nDon't miss out on buying Gerhold, Gerhold and Gerhold's Green Flash Palate Wrecker today!\n" +PHISHING,"Dear Forrest Ullrich,\n\nYour transaction xvbzkmqyrz has failed.\n\nCall +1 (992) 894-5548 for help.\n" +PHISHING,"Dear Ms. Dayna Gislason Jr.,\n\nYour transaction oxhvreavun has failed.\n\nCall 779-772-8691 for help.\n" +PHISHING,"Hello Constance Hand,\n\nCall 1-572-597-2202 for help with your order gqxeptgike. Otherwise it will be returned to the sender.\n" +SPAM,"Dear Neha Bayer,\n\nBuy a Terrapin Wake n Bake from Green Inc now!\n" +SPAM,"Mr. Lavern Walter,\n\nDon't miss out on buying Mayert-Mayert's Bell’s Hop Slam today!\n" +SPAM,"Dear Andrew Heller,\n\nBuy a The Bruery Saison Rue from Waters Group now!\n" +SPAM,"Ms. Karianne Dibbert Sr.,\n\nDon't miss out on buying Langworth-Langworth's Hill Farmstead Abner today!\n" +PHISHING,"Ms. Corine Homenick,\n\nYour order number yuwrwkhrjq has been returned.\n\nCall (913) 489-1702 to get help.\n" +PHISHING,"Hello Mr. Leopoldo VonRueden DDS,\n\nCall 1-658-996-7312 x7820 for help with your order elyqdcwyjc. Otherwise it will be returned to the sender.\n" +SPAM,"Hello Providenci Heidenreich,\n\nNow available!\n\nA Fullsteam Carver from Williamson Ltd\n" +SPAM,"Dear Ms. Yasmine Harber,\n\nBuy a Ten Fidy from Abbott, Abbott and Abbott now!\n" +SPAM,"Jasper Block,\n\nDon't miss out on buying Price-Price's Westbrook Mexican Cake today!\n" +PHISHING,"Thurman Blick MD,\n\nYour order number mhanpuruge has been returned.\n\nCall (609) 564-5086 to get help.\n" +SPAM,"Dear Jarret Homenick,\n\nBuy a Cigar City Hanaphu Imperial Stout from Christiansen PLC now!\n" +PHISHING,"Hello Bryana Fadel,\n\nCall 1-242-357-5173 x1449 for help with your order amcchfhseb. Otherwise it will be returned to the sender.\n" +SPAM,"Hello Marietta Hoeger,\n\nNow available!\n\nA Firestone Walker Velvet Merkin from Herzog, Herzog and Herzog\n" +SPAM,"Alejandrin Rogahn,\n\nDon't miss out on buying Kerluke, Kerluke and Kerluke's Hill Farmstead Everett Porter today!\n" +PHISHING,"Kian Walter,\n\nYour order number yafdhzsphd has been returned.\n\nCall +1-462-307-4667 to get help.\n" +SPAM,"Hello Mr. Marquis Okuneva,\n\nNow available!\n\nA Anchor Steam Beer from Pfannerstill-Pfannerstill\n" +SPAM,"Hello Rosella Green,\n\nNow available!\n\nA Wicked Weed Serenity from Klein, Klein and Klein\n" +SPAM,"Mr. Hyman McDermott,\n\nDon't miss out on buying Rippin PLC's The Bruery Sans Pagaie today!\n" +SPAM,"Dear Dwight Russel,\n\nBuy a Wild Heaven Eschaton from Abbott PLC now!\n" +SPAM,"Nettie Kreiger,\n\nDon't miss out on buying Casper Group's Great Divide Yeti today!\n" +PHISHING,"Dear Raymundo Wuckert,\n\nYour transaction ozqflyxkpv has failed.\n\nCall 749.409.2335 for help.\n" +PHISHING,"Hello Ms. Eva Schamberger DVM,\n\nCall +1-938-771-0587 for help with your order hwihmypuuv. Otherwise it will be returned to the sender.\n" +PHISHING,"Hello Lincoln Cole,\n\nCall 640.721.2514 for help with your order vxzhfsepwz. Otherwise it will be returned to the sender.\n" +PHISHING,"Dear Mr. Terrill O'Conner,\n\nYour transaction wupxwtkiny has failed.\n\nCall 1-937-354-6546 x14927 for help.\n" +PHISHING,"Dear Ms. Valentina Johnson DDS,\n\nYour transaction txxutugwto has failed.\n\nCall 327-497-8512 x16391 for help.\n" +PHISHING,"Hello Aiyana Senger,\n\nCall 1-457-680-2828 x090 for help with your order xopgerkxib. Otherwise it will be returned to the sender.\n" +PHISHING,"Edward Block,\n\nYour order number joqubrmvvg has been returned.\n\nCall (513) 464-7385 x346 to get help.\n" +SPAM,"Dear Retta Donnelly,\n\nBuy a Odell 90 Shilling Ale from Windler-Windler now!\n" +SPAM,"Bennie Walter,\n\nDon't miss out on buying Stracke, Stracke and Stracke's Revolution Anti-Hero IPA today!\n" +SPAM,"Peter Miller,\n\nDon't miss out on buying Hermiston PLC's Schlafly Pumpkin Ale today!\n" +SPAM,"Dear Mr. Tremayne Stark,\n\nBuy a Ballast Point Sculpin from Shields Inc now!\n" +PHISHING,"Hello Terrence O'Conner,\n\nCall 204.354.8255 for help with your order zbfguftyqp. Otherwise it will be returned to the sender.\n" +PHISHING,"Hello Oma Bergnaum III,\n\nCall 392.896.4135 x39029 for help with your order rutmdrozem. Otherwise it will be returned to the sender.\n" +SPAM,"Ms. Eleanora Bechtelar I,\n\nDon't miss out on buying Hoppe, Hoppe and Hoppe's Hill Farmstead Everett Porter today!\n" +PHISHING,"Dear Theodore Christiansen,\n\nYour transaction jikdggshvz has failed.\n\nCall 880.778.3256 for help.\n" +SPAM,"Ms. Alexandrea Schumm III,\n\nDon't miss out on buying Hand Inc's Smuttynose Finest Kind IPA today!\n" +SPAM,"Dear Amiya Quigley,\n\nBuy a New Glarus Brewing Serendipity from Smith-Smith now!\n" +SPAM,"Hello Kailey Towne Jr.,\n\nNow available!\n\nA 21st Amendment Bitter American from Rutherford-Rutherford\n" +SPAM,"Hello Aliyah Fisher,\n\nNow available!\n\nA Stone Enjoy By… IPA from Hane-Hane\n" +PHISHING,"Amanda Lakin,\n\nYour order number tofunjxtjv has been returned.\n\nCall 978-619-5434 x06171 to get help.\n" +PHISHING,"Dear Angelo Pfeffer,\n\nYour transaction jnwsxqgrxq has failed.\n\nCall 789-697-1286 x80594 for help.\n" diff --git a/internal/service/comprehend/test-fixtures/entity_recognizer/annotations.csv b/internal/service/comprehend/test-fixtures/entity_recognizer/annotations.csv index b60f915fc593..2a80dbd182ae 100644 --- a/internal/service/comprehend/test-fixtures/entity_recognizer/annotations.csv +++ b/internal/service/comprehend/test-fixtures/entity_recognizer/annotations.csv @@ -1,1001 +1,1001 @@ File,Line,Begin Offset,End Offset,Type -documents.txt,0,19,32,MANAGER -documents.txt,1,0,15,MANAGER -documents.txt,2,0,22,MANAGER -documents.txt,3,0,14,MANAGER -documents.txt,4,0,13,ENGINEER -documents.txt,5,0,15,ENGINEER -documents.txt,6,0,14,ENGINEER -documents.txt,7,25,41,ENGINEER -documents.txt,8,0,19,MANAGER -documents.txt,9,25,38,MANAGER -documents.txt,10,0,16,MANAGER -documents.txt,11,0,12,ENGINEER -documents.txt,12,0,10,MANAGER -documents.txt,13,36,54,MANAGER -documents.txt,14,20,33,ENGINEER -documents.txt,15,0,22,MANAGER -documents.txt,16,0,14,MANAGER -documents.txt,17,0,21,MANAGER -documents.txt,18,0,15,MANAGER -documents.txt,19,0,15,MANAGER +documents.txt,0,0,13,MANAGER +documents.txt,1,0,14,MANAGER +documents.txt,2,0,21,MANAGER +documents.txt,3,0,15,MANAGER +documents.txt,4,0,17,ENGINEER +documents.txt,5,0,22,ENGINEER +documents.txt,6,37,56,ENGINEER +documents.txt,7,0,13,ENGINEER +documents.txt,8,25,42,MANAGER +documents.txt,9,25,48,MANAGER +documents.txt,10,0,11,ENGINEER +documents.txt,11,25,39,ENGINEER +documents.txt,12,0,17,MANAGER +documents.txt,13,0,11,MANAGER +documents.txt,14,0,20,MANAGER +documents.txt,15,0,14,MANAGER +documents.txt,16,20,41,ENGINEER +documents.txt,17,0,12,ENGINEER +documents.txt,18,0,13,ENGINEER +documents.txt,19,0,14,MANAGER documents.txt,20,0,14,MANAGER -documents.txt,21,20,35,ENGINEER -documents.txt,22,19,36,MANAGER -documents.txt,23,37,55,ENGINEER -documents.txt,24,0,12,MANAGER -documents.txt,25,0,12,MANAGER -documents.txt,26,19,36,MANAGER -documents.txt,27,0,13,ENGINEER -documents.txt,28,0,15,ENGINEER -documents.txt,29,0,15,MANAGER -documents.txt,30,0,17,MANAGER -documents.txt,31,0,13,MANAGER -documents.txt,32,0,13,ENGINEER -documents.txt,33,25,39,MANAGER -documents.txt,34,25,41,MANAGER -documents.txt,35,0,11,MANAGER -documents.txt,36,25,45,ENGINEER -documents.txt,37,0,15,MANAGER -documents.txt,38,0,12,MANAGER -documents.txt,39,0,14,ENGINEER -documents.txt,40,0,15,MANAGER +documents.txt,21,25,41,MANAGER +documents.txt,22,0,12,ENGINEER +documents.txt,23,0,14,ENGINEER +documents.txt,24,0,23,MANAGER +documents.txt,25,25,42,ENGINEER +documents.txt,26,0,14,ENGINEER +documents.txt,27,0,18,ENGINEER +documents.txt,28,0,13,MANAGER +documents.txt,29,36,53,MANAGER +documents.txt,30,0,15,ENGINEER +documents.txt,31,0,15,MANAGER +documents.txt,32,0,15,ENGINEER +documents.txt,33,0,12,MANAGER +documents.txt,34,0,20,ENGINEER +documents.txt,35,0,21,MANAGER +documents.txt,36,0,15,ENGINEER +documents.txt,37,0,16,ENGINEER +documents.txt,38,0,16,ENGINEER +documents.txt,39,0,19,MANAGER +documents.txt,40,25,39,ENGINEER documents.txt,41,0,12,MANAGER -documents.txt,42,0,14,MANAGER -documents.txt,43,0,15,MANAGER -documents.txt,44,0,14,MANAGER -documents.txt,45,37,55,ENGINEER -documents.txt,46,0,14,ENGINEER -documents.txt,47,0,12,ENGINEER -documents.txt,48,20,33,ENGINEER -documents.txt,49,25,37,MANAGER -documents.txt,50,0,15,MANAGER -documents.txt,51,0,12,MANAGER -documents.txt,52,25,40,MANAGER -documents.txt,53,0,15,ENGINEER -documents.txt,54,37,51,ENGINEER -documents.txt,55,0,18,ENGINEER -documents.txt,56,25,38,MANAGER -documents.txt,57,0,18,ENGINEER -documents.txt,58,0,11,MANAGER -documents.txt,59,0,18,MANAGER -documents.txt,60,0,13,ENGINEER -documents.txt,61,19,35,MANAGER -documents.txt,62,0,14,ENGINEER -documents.txt,63,0,13,MANAGER -documents.txt,64,0,13,MANAGER -documents.txt,65,20,42,ENGINEER -documents.txt,66,25,41,MANAGER -documents.txt,67,0,22,MANAGER -documents.txt,68,25,41,ENGINEER -documents.txt,69,20,38,ENGINEER -documents.txt,70,0,11,ENGINEER -documents.txt,71,37,52,ENGINEER -documents.txt,72,0,20,ENGINEER -documents.txt,73,25,39,ENGINEER -documents.txt,74,0,11,MANAGER -documents.txt,75,0,13,ENGINEER -documents.txt,76,37,53,ENGINEER +documents.txt,42,0,15,MANAGER +documents.txt,43,19,43,MANAGER +documents.txt,44,0,13,MANAGER +documents.txt,45,0,15,ENGINEER +documents.txt,46,0,27,MANAGER +documents.txt,47,0,10,MANAGER +documents.txt,48,0,14,MANAGER +documents.txt,49,0,10,MANAGER +documents.txt,50,0,12,MANAGER +documents.txt,51,0,16,ENGINEER +documents.txt,52,0,10,ENGINEER +documents.txt,53,0,18,MANAGER +documents.txt,54,36,50,MANAGER +documents.txt,55,0,12,MANAGER +documents.txt,56,0,13,ENGINEER +documents.txt,57,0,11,ENGINEER +documents.txt,58,0,13,ENGINEER +documents.txt,59,19,34,MANAGER +documents.txt,60,0,13,MANAGER +documents.txt,61,19,28,MANAGER +documents.txt,62,0,12,MANAGER +documents.txt,63,0,14,ENGINEER +documents.txt,64,0,16,ENGINEER +documents.txt,65,0,17,MANAGER +documents.txt,66,0,19,MANAGER +documents.txt,67,36,52,MANAGER +documents.txt,68,0,11,ENGINEER +documents.txt,69,0,11,MANAGER +documents.txt,70,0,23,ENGINEER +documents.txt,71,0,22,MANAGER +documents.txt,72,36,47,MANAGER +documents.txt,73,37,58,ENGINEER +documents.txt,74,0,20,MANAGER +documents.txt,75,0,14,MANAGER +documents.txt,76,0,13,MANAGER documents.txt,77,0,17,MANAGER -documents.txt,78,0,9,MANAGER -documents.txt,79,25,43,ENGINEER -documents.txt,80,19,35,MANAGER -documents.txt,81,0,14,ENGINEER -documents.txt,82,20,30,ENGINEER +documents.txt,78,36,49,MANAGER +documents.txt,79,0,17,ENGINEER +documents.txt,80,25,38,ENGINEER +documents.txt,81,0,28,ENGINEER +documents.txt,82,0,11,ENGINEER documents.txt,83,0,17,ENGINEER -documents.txt,84,36,53,MANAGER -documents.txt,85,0,20,ENGINEER -documents.txt,86,0,11,MANAGER -documents.txt,87,0,16,ENGINEER -documents.txt,88,19,35,MANAGER -documents.txt,89,0,18,MANAGER -documents.txt,90,0,12,ENGINEER -documents.txt,91,20,31,ENGINEER -documents.txt,92,20,31,ENGINEER -documents.txt,93,0,18,ENGINEER -documents.txt,94,0,13,MANAGER -documents.txt,95,25,38,MANAGER -documents.txt,96,0,18,MANAGER -documents.txt,97,37,48,ENGINEER -documents.txt,98,0,17,MANAGER -documents.txt,99,0,18,ENGINEER -documents.txt,100,0,10,MANAGER -documents.txt,101,0,15,MANAGER -documents.txt,102,0,21,ENGINEER -documents.txt,103,0,14,MANAGER -documents.txt,104,0,15,MANAGER -documents.txt,105,20,35,ENGINEER -documents.txt,106,0,16,MANAGER -documents.txt,107,0,14,ENGINEER -documents.txt,108,0,17,MANAGER -documents.txt,109,0,13,MANAGER -documents.txt,110,0,23,MANAGER -documents.txt,111,0,17,MANAGER -documents.txt,112,0,24,MANAGER -documents.txt,113,37,58,ENGINEER -documents.txt,114,0,12,ENGINEER -documents.txt,115,0,11,ENGINEER -documents.txt,116,0,14,ENGINEER -documents.txt,117,36,48,MANAGER -documents.txt,118,0,13,ENGINEER -documents.txt,119,0,13,ENGINEER -documents.txt,120,20,33,ENGINEER -documents.txt,121,0,15,MANAGER -documents.txt,122,0,19,ENGINEER -documents.txt,123,0,13,MANAGER -documents.txt,124,0,17,MANAGER -documents.txt,125,0,12,ENGINEER -documents.txt,126,0,16,MANAGER -documents.txt,127,25,42,MANAGER -documents.txt,128,25,36,ENGINEER -documents.txt,129,0,11,ENGINEER -documents.txt,130,0,15,ENGINEER -documents.txt,131,19,33,MANAGER -documents.txt,132,0,20,MANAGER -documents.txt,133,0,18,ENGINEER -documents.txt,134,37,49,ENGINEER -documents.txt,135,37,49,ENGINEER -documents.txt,136,20,37,ENGINEER -documents.txt,137,0,17,ENGINEER -documents.txt,138,0,17,ENGINEER -documents.txt,139,0,13,ENGINEER -documents.txt,140,37,57,ENGINEER -documents.txt,141,0,9,ENGINEER -documents.txt,142,0,12,MANAGER -documents.txt,143,0,10,MANAGER -documents.txt,144,0,16,MANAGER -documents.txt,145,19,30,MANAGER -documents.txt,146,19,37,MANAGER -documents.txt,147,0,12,MANAGER -documents.txt,148,0,18,MANAGER -documents.txt,149,0,12,MANAGER -documents.txt,150,0,10,ENGINEER -documents.txt,151,0,11,ENGINEER -documents.txt,152,37,48,ENGINEER -documents.txt,153,25,36,MANAGER -documents.txt,154,0,11,ENGINEER -documents.txt,155,20,35,ENGINEER -documents.txt,156,0,13,ENGINEER -documents.txt,157,0,14,MANAGER -documents.txt,158,0,18,MANAGER -documents.txt,159,0,18,MANAGER -documents.txt,160,20,34,ENGINEER -documents.txt,161,25,42,MANAGER -documents.txt,162,36,52,MANAGER -documents.txt,163,0,13,ENGINEER -documents.txt,164,0,15,MANAGER -documents.txt,165,0,12,ENGINEER -documents.txt,166,0,11,MANAGER -documents.txt,167,0,17,MANAGER -documents.txt,168,0,13,MANAGER -documents.txt,169,0,14,MANAGER -documents.txt,170,0,15,MANAGER -documents.txt,171,25,39,ENGINEER -documents.txt,172,0,17,MANAGER -documents.txt,173,0,13,MANAGER +documents.txt,84,25,44,ENGINEER +documents.txt,85,37,52,ENGINEER +documents.txt,86,0,13,MANAGER +documents.txt,87,36,49,MANAGER +documents.txt,88,36,47,MANAGER +documents.txt,89,0,15,MANAGER +documents.txt,90,0,13,ENGINEER +documents.txt,91,25,45,ENGINEER +documents.txt,92,0,14,MANAGER +documents.txt,93,0,15,ENGINEER +documents.txt,94,0,10,MANAGER +documents.txt,95,0,20,MANAGER +documents.txt,96,25,36,MANAGER +documents.txt,97,0,15,MANAGER +documents.txt,98,37,53,ENGINEER +documents.txt,99,0,17,ENGINEER +documents.txt,100,0,16,ENGINEER +documents.txt,101,25,45,ENGINEER +documents.txt,102,25,47,MANAGER +documents.txt,103,0,16,MANAGER +documents.txt,104,0,19,ENGINEER +documents.txt,105,0,20,ENGINEER +documents.txt,106,0,14,ENGINEER +documents.txt,107,0,14,MANAGER +documents.txt,108,0,12,MANAGER +documents.txt,109,0,12,ENGINEER +documents.txt,110,0,12,MANAGER +documents.txt,111,36,52,MANAGER +documents.txt,112,0,20,MANAGER +documents.txt,113,36,50,MANAGER +documents.txt,114,0,11,MANAGER +documents.txt,115,0,14,MANAGER +documents.txt,116,0,17,ENGINEER +documents.txt,117,0,18,ENGINEER +documents.txt,118,0,12,MANAGER +documents.txt,119,0,18,MANAGER +documents.txt,120,0,17,ENGINEER +documents.txt,121,0,18,ENGINEER +documents.txt,122,0,14,MANAGER +documents.txt,123,0,19,ENGINEER +documents.txt,124,0,16,ENGINEER +documents.txt,125,0,21,MANAGER +documents.txt,126,19,36,MANAGER +documents.txt,127,0,15,MANAGER +documents.txt,128,0,15,MANAGER +documents.txt,129,0,14,ENGINEER +documents.txt,130,0,19,MANAGER +documents.txt,131,0,13,ENGINEER +documents.txt,132,0,11,MANAGER +documents.txt,133,0,18,MANAGER +documents.txt,134,0,13,MANAGER +documents.txt,135,25,39,ENGINEER +documents.txt,136,0,14,MANAGER +documents.txt,137,0,12,MANAGER +documents.txt,138,0,13,MANAGER +documents.txt,139,37,50,ENGINEER +documents.txt,140,0,15,MANAGER +documents.txt,141,0,13,ENGINEER +documents.txt,142,0,11,ENGINEER +documents.txt,143,37,58,ENGINEER +documents.txt,144,0,19,ENGINEER +documents.txt,145,0,14,MANAGER +documents.txt,146,0,16,ENGINEER +documents.txt,147,0,20,MANAGER +documents.txt,148,0,24,MANAGER +documents.txt,149,0,14,ENGINEER +documents.txt,150,0,15,ENGINEER +documents.txt,151,0,13,ENGINEER +documents.txt,152,20,33,ENGINEER +documents.txt,153,0,15,MANAGER +documents.txt,154,0,20,ENGINEER +documents.txt,155,37,52,ENGINEER +documents.txt,156,0,14,MANAGER +documents.txt,157,0,14,ENGINEER +documents.txt,158,0,13,ENGINEER +documents.txt,159,0,11,MANAGER +documents.txt,160,0,17,ENGINEER +documents.txt,161,25,42,ENGINEER +documents.txt,162,25,35,ENGINEER +documents.txt,163,0,13,MANAGER +documents.txt,164,0,16,ENGINEER +documents.txt,165,0,13,ENGINEER +documents.txt,166,0,12,ENGINEER +documents.txt,167,19,36,MANAGER +documents.txt,168,0,12,MANAGER +documents.txt,169,0,19,MANAGER +documents.txt,170,0,9,ENGINEER +documents.txt,171,37,54,ENGINEER +documents.txt,172,36,49,MANAGER +documents.txt,173,0,23,ENGINEER documents.txt,174,0,14,ENGINEER -documents.txt,175,0,9,MANAGER -documents.txt,176,0,16,MANAGER -documents.txt,177,20,40,ENGINEER -documents.txt,178,0,14,ENGINEER -documents.txt,179,0,15,MANAGER -documents.txt,180,0,14,ENGINEER -documents.txt,181,0,13,MANAGER -documents.txt,182,20,36,ENGINEER -documents.txt,183,0,22,MANAGER -documents.txt,184,0,18,ENGINEER -documents.txt,185,0,17,MANAGER -documents.txt,186,0,13,MANAGER -documents.txt,187,0,15,MANAGER -documents.txt,188,36,47,MANAGER -documents.txt,189,0,20,ENGINEER -documents.txt,190,0,14,MANAGER -documents.txt,191,0,15,ENGINEER -documents.txt,192,0,18,MANAGER -documents.txt,193,0,10,MANAGER -documents.txt,194,0,18,ENGINEER -documents.txt,195,0,12,ENGINEER -documents.txt,196,25,37,MANAGER -documents.txt,197,0,10,ENGINEER -documents.txt,198,0,9,MANAGER -documents.txt,199,0,12,ENGINEER -documents.txt,200,0,16,ENGINEER -documents.txt,201,0,14,ENGINEER -documents.txt,202,0,16,MANAGER -documents.txt,203,37,53,ENGINEER -documents.txt,204,0,17,MANAGER -documents.txt,205,0,14,ENGINEER -documents.txt,206,25,45,MANAGER -documents.txt,207,0,15,MANAGER -documents.txt,208,25,42,MANAGER -documents.txt,209,19,36,MANAGER -documents.txt,210,0,15,MANAGER -documents.txt,211,0,11,MANAGER -documents.txt,212,0,12,MANAGER -documents.txt,213,36,50,MANAGER -documents.txt,214,20,43,ENGINEER -documents.txt,215,0,17,MANAGER -documents.txt,216,0,13,MANAGER -documents.txt,217,0,14,MANAGER -documents.txt,218,0,12,ENGINEER -documents.txt,219,0,13,ENGINEER -documents.txt,220,20,34,ENGINEER -documents.txt,221,0,16,ENGINEER -documents.txt,222,25,40,MANAGER -documents.txt,223,25,42,ENGINEER -documents.txt,224,25,38,MANAGER -documents.txt,225,0,14,MANAGER -documents.txt,226,0,11,MANAGER -documents.txt,227,0,12,MANAGER -documents.txt,228,0,22,ENGINEER -documents.txt,229,0,12,ENGINEER -documents.txt,230,0,15,ENGINEER -documents.txt,231,25,42,MANAGER -documents.txt,232,0,12,ENGINEER -documents.txt,233,0,11,MANAGER -documents.txt,234,36,48,MANAGER -documents.txt,235,0,14,ENGINEER -documents.txt,236,36,49,MANAGER -documents.txt,237,36,55,MANAGER -documents.txt,238,20,38,ENGINEER -documents.txt,239,0,10,ENGINEER -documents.txt,240,0,10,MANAGER -documents.txt,241,0,15,MANAGER -documents.txt,242,0,16,ENGINEER +documents.txt,175,0,17,ENGINEER +documents.txt,176,0,22,MANAGER +documents.txt,177,0,15,ENGINEER +documents.txt,178,0,10,ENGINEER +documents.txt,179,0,17,MANAGER +documents.txt,180,0,15,ENGINEER +documents.txt,181,0,15,MANAGER +documents.txt,182,0,18,MANAGER +documents.txt,183,0,18,MANAGER +documents.txt,184,0,17,ENGINEER +documents.txt,185,0,14,MANAGER +documents.txt,186,37,52,ENGINEER +documents.txt,187,0,20,ENGINEER +documents.txt,188,0,24,ENGINEER +documents.txt,189,0,17,ENGINEER +documents.txt,190,0,26,ENGINEER +documents.txt,191,19,29,MANAGER +documents.txt,192,0,16,ENGINEER +documents.txt,193,25,40,ENGINEER +documents.txt,194,0,14,MANAGER +documents.txt,195,0,15,ENGINEER +documents.txt,196,36,52,MANAGER +documents.txt,197,0,23,ENGINEER +documents.txt,198,0,11,MANAGER +documents.txt,199,0,15,ENGINEER +documents.txt,200,0,12,MANAGER +documents.txt,201,0,17,ENGINEER +documents.txt,202,37,51,ENGINEER +documents.txt,203,25,42,ENGINEER +documents.txt,204,0,12,ENGINEER +documents.txt,205,0,15,MANAGER +documents.txt,206,20,37,ENGINEER +documents.txt,207,19,35,MANAGER +documents.txt,208,25,45,MANAGER +documents.txt,209,36,48,MANAGER +documents.txt,210,0,14,MANAGER +documents.txt,211,25,39,MANAGER +documents.txt,212,0,11,MANAGER +documents.txt,213,0,15,MANAGER +documents.txt,214,0,14,ENGINEER +documents.txt,215,0,11,ENGINEER +documents.txt,216,0,24,MANAGER +documents.txt,217,0,15,MANAGER +documents.txt,218,0,21,MANAGER +documents.txt,219,0,20,MANAGER +documents.txt,220,0,14,MANAGER +documents.txt,221,0,11,MANAGER +documents.txt,222,20,34,ENGINEER +documents.txt,223,0,26,MANAGER +documents.txt,224,0,17,MANAGER +documents.txt,225,0,17,ENGINEER +documents.txt,226,0,15,MANAGER +documents.txt,227,25,46,MANAGER +documents.txt,228,37,50,ENGINEER +documents.txt,229,25,47,ENGINEER +documents.txt,230,20,45,ENGINEER +documents.txt,231,19,32,MANAGER +documents.txt,232,0,20,MANAGER +documents.txt,233,37,50,ENGINEER +documents.txt,234,0,18,MANAGER +documents.txt,235,0,14,MANAGER +documents.txt,236,0,16,ENGINEER +documents.txt,237,0,12,MANAGER +documents.txt,238,0,11,ENGINEER +documents.txt,239,0,10,MANAGER +documents.txt,240,0,17,MANAGER +documents.txt,241,25,40,ENGINEER +documents.txt,242,0,10,ENGINEER documents.txt,243,0,15,ENGINEER -documents.txt,244,0,12,ENGINEER +documents.txt,244,20,35,ENGINEER documents.txt,245,0,11,ENGINEER -documents.txt,246,0,15,MANAGER -documents.txt,247,0,13,MANAGER -documents.txt,248,0,12,ENGINEER -documents.txt,249,0,14,ENGINEER -documents.txt,250,25,37,MANAGER -documents.txt,251,25,36,MANAGER -documents.txt,252,0,12,MANAGER -documents.txt,253,25,40,MANAGER -documents.txt,254,25,39,MANAGER -documents.txt,255,0,17,MANAGER -documents.txt,256,0,18,MANAGER -documents.txt,257,36,50,MANAGER -documents.txt,258,37,52,ENGINEER -documents.txt,259,0,20,ENGINEER -documents.txt,260,0,15,ENGINEER -documents.txt,261,36,48,MANAGER -documents.txt,262,0,13,ENGINEER -documents.txt,263,0,15,MANAGER -documents.txt,264,0,16,MANAGER -documents.txt,265,0,16,ENGINEER -documents.txt,266,0,17,MANAGER -documents.txt,267,36,54,MANAGER -documents.txt,268,0,15,MANAGER -documents.txt,269,0,14,ENGINEER -documents.txt,270,0,18,MANAGER -documents.txt,271,0,11,MANAGER -documents.txt,272,0,21,ENGINEER -documents.txt,273,0,21,ENGINEER -documents.txt,274,0,14,ENGINEER -documents.txt,275,0,14,MANAGER -documents.txt,276,0,18,ENGINEER -documents.txt,277,0,16,ENGINEER -documents.txt,278,0,13,MANAGER -documents.txt,279,0,15,ENGINEER -documents.txt,280,0,13,MANAGER -documents.txt,281,0,18,MANAGER -documents.txt,282,0,8,MANAGER -documents.txt,283,0,12,ENGINEER -documents.txt,284,0,15,MANAGER -documents.txt,285,36,55,MANAGER -documents.txt,286,0,16,ENGINEER -documents.txt,287,25,40,MANAGER -documents.txt,288,19,33,MANAGER -documents.txt,289,0,14,ENGINEER -documents.txt,290,0,13,ENGINEER -documents.txt,291,19,33,MANAGER -documents.txt,292,0,13,MANAGER -documents.txt,293,25,37,ENGINEER -documents.txt,294,0,16,ENGINEER -documents.txt,295,0,25,ENGINEER -documents.txt,296,0,17,ENGINEER -documents.txt,297,37,52,ENGINEER -documents.txt,298,37,53,ENGINEER -documents.txt,299,0,13,MANAGER -documents.txt,300,20,39,ENGINEER -documents.txt,301,0,15,MANAGER -documents.txt,302,0,15,MANAGER -documents.txt,303,0,12,MANAGER -documents.txt,304,0,22,MANAGER -documents.txt,305,25,42,MANAGER -documents.txt,306,0,13,ENGINEER -documents.txt,307,25,43,MANAGER -documents.txt,308,37,55,ENGINEER -documents.txt,309,0,19,MANAGER -documents.txt,310,36,53,MANAGER -documents.txt,311,0,13,ENGINEER -documents.txt,312,0,12,ENGINEER -documents.txt,313,0,12,MANAGER -documents.txt,314,36,49,MANAGER -documents.txt,315,0,18,ENGINEER -documents.txt,316,0,14,ENGINEER -documents.txt,317,0,13,MANAGER -documents.txt,318,25,37,ENGINEER -documents.txt,319,37,49,ENGINEER -documents.txt,320,0,21,ENGINEER -documents.txt,321,0,11,MANAGER -documents.txt,322,0,14,ENGINEER -documents.txt,323,25,44,MANAGER -documents.txt,324,0,13,MANAGER -documents.txt,325,25,35,ENGINEER -documents.txt,326,25,41,MANAGER -documents.txt,327,0,12,ENGINEER -documents.txt,328,0,11,MANAGER -documents.txt,329,0,22,MANAGER -documents.txt,330,0,19,MANAGER -documents.txt,331,0,13,ENGINEER -documents.txt,332,0,15,MANAGER -documents.txt,333,0,13,MANAGER -documents.txt,334,0,13,ENGINEER -documents.txt,335,25,46,MANAGER -documents.txt,336,19,39,MANAGER -documents.txt,337,0,16,ENGINEER -documents.txt,338,0,12,ENGINEER -documents.txt,339,0,11,ENGINEER -documents.txt,340,20,34,ENGINEER -documents.txt,341,0,13,MANAGER -documents.txt,342,0,11,MANAGER -documents.txt,343,0,12,MANAGER -documents.txt,344,0,16,MANAGER -documents.txt,345,0,13,MANAGER -documents.txt,346,0,15,MANAGER -documents.txt,347,0,17,MANAGER -documents.txt,348,37,52,ENGINEER -documents.txt,349,0,12,MANAGER -documents.txt,350,36,50,MANAGER -documents.txt,351,0,12,ENGINEER -documents.txt,352,0,13,ENGINEER -documents.txt,353,0,11,MANAGER -documents.txt,354,36,49,MANAGER -documents.txt,355,0,13,ENGINEER -documents.txt,356,0,18,ENGINEER -documents.txt,357,37,55,ENGINEER -documents.txt,358,20,31,ENGINEER -documents.txt,359,0,20,ENGINEER -documents.txt,360,0,15,ENGINEER -documents.txt,361,0,14,MANAGER -documents.txt,362,0,13,MANAGER -documents.txt,363,19,34,MANAGER -documents.txt,364,0,12,MANAGER -documents.txt,365,0,13,MANAGER -documents.txt,366,0,14,MANAGER -documents.txt,367,0,17,ENGINEER -documents.txt,368,0,13,MANAGER -documents.txt,369,0,17,ENGINEER -documents.txt,370,37,50,ENGINEER -documents.txt,371,0,19,MANAGER -documents.txt,372,25,42,ENGINEER -documents.txt,373,0,14,MANAGER -documents.txt,374,25,38,ENGINEER +documents.txt,246,0,10,MANAGER +documents.txt,247,37,56,ENGINEER +documents.txt,248,0,15,MANAGER +documents.txt,249,19,37,MANAGER +documents.txt,250,0,17,ENGINEER +documents.txt,251,0,11,ENGINEER +documents.txt,252,0,22,MANAGER +documents.txt,253,0,23,ENGINEER +documents.txt,254,0,14,MANAGER +documents.txt,255,0,10,MANAGER +documents.txt,256,0,15,MANAGER +documents.txt,257,0,10,ENGINEER +documents.txt,258,0,13,MANAGER +documents.txt,259,0,16,ENGINEER +documents.txt,260,0,16,MANAGER +documents.txt,261,0,12,MANAGER +documents.txt,262,0,15,MANAGER +documents.txt,263,19,35,MANAGER +documents.txt,264,0,19,ENGINEER +documents.txt,265,0,14,MANAGER +documents.txt,266,0,14,ENGINEER +documents.txt,267,0,24,ENGINEER +documents.txt,268,20,38,ENGINEER +documents.txt,269,0,12,MANAGER +documents.txt,270,25,40,ENGINEER +documents.txt,271,19,42,MANAGER +documents.txt,272,20,35,ENGINEER +documents.txt,273,0,23,MANAGER +documents.txt,274,0,12,ENGINEER +documents.txt,275,0,20,MANAGER +documents.txt,276,0,16,MANAGER +documents.txt,277,0,27,ENGINEER +documents.txt,278,0,12,MANAGER +documents.txt,279,0,23,MANAGER +documents.txt,280,0,18,ENGINEER +documents.txt,281,0,19,ENGINEER +documents.txt,282,0,18,ENGINEER +documents.txt,283,0,16,MANAGER +documents.txt,284,0,14,MANAGER +documents.txt,285,0,18,MANAGER +documents.txt,286,0,18,MANAGER +documents.txt,287,0,25,MANAGER +documents.txt,288,0,13,MANAGER +documents.txt,289,0,18,ENGINEER +documents.txt,290,0,15,MANAGER +documents.txt,291,0,10,MANAGER +documents.txt,292,25,38,ENGINEER +documents.txt,293,19,35,MANAGER +documents.txt,294,25,39,MANAGER +documents.txt,295,25,38,MANAGER +documents.txt,296,0,14,ENGINEER +documents.txt,297,0,13,ENGINEER +documents.txt,298,0,19,MANAGER +documents.txt,299,20,32,ENGINEER +documents.txt,300,0,16,MANAGER +documents.txt,301,0,16,MANAGER +documents.txt,302,37,50,ENGINEER +documents.txt,303,0,19,MANAGER +documents.txt,304,0,20,MANAGER +documents.txt,305,0,15,ENGINEER +documents.txt,306,25,48,MANAGER +documents.txt,307,0,21,ENGINEER +documents.txt,308,0,14,ENGINEER +documents.txt,309,0,12,MANAGER +documents.txt,310,0,18,MANAGER +documents.txt,311,0,23,ENGINEER +documents.txt,312,0,17,MANAGER +documents.txt,313,0,25,ENGINEER +documents.txt,314,0,11,MANAGER +documents.txt,315,0,16,ENGINEER +documents.txt,316,25,38,ENGINEER +documents.txt,317,36,50,MANAGER +documents.txt,318,37,52,ENGINEER +documents.txt,319,25,39,MANAGER +documents.txt,320,25,47,MANAGER +documents.txt,321,25,40,MANAGER +documents.txt,322,0,17,ENGINEER +documents.txt,323,0,12,ENGINEER +documents.txt,324,0,10,MANAGER +documents.txt,325,25,40,ENGINEER +documents.txt,326,20,31,ENGINEER +documents.txt,327,0,13,ENGINEER +documents.txt,328,25,46,ENGINEER +documents.txt,329,0,16,ENGINEER +documents.txt,330,0,10,MANAGER +documents.txt,331,37,55,ENGINEER +documents.txt,332,19,36,MANAGER +documents.txt,333,0,13,ENGINEER +documents.txt,334,0,16,MANAGER +documents.txt,335,25,43,MANAGER +documents.txt,336,0,15,MANAGER +documents.txt,337,36,48,MANAGER +documents.txt,338,36,50,MANAGER +documents.txt,339,0,13,ENGINEER +documents.txt,340,0,17,ENGINEER +documents.txt,341,36,50,MANAGER +documents.txt,342,0,17,ENGINEER +documents.txt,343,36,50,MANAGER +documents.txt,344,0,14,MANAGER +documents.txt,345,25,45,ENGINEER +documents.txt,346,0,16,ENGINEER +documents.txt,347,37,57,ENGINEER +documents.txt,348,0,14,ENGINEER +documents.txt,349,0,14,MANAGER +documents.txt,350,36,52,MANAGER +documents.txt,351,0,15,ENGINEER +documents.txt,352,0,13,MANAGER +documents.txt,353,0,15,ENGINEER +documents.txt,354,0,18,ENGINEER +documents.txt,355,0,10,MANAGER +documents.txt,356,0,11,MANAGER +documents.txt,357,0,16,MANAGER +documents.txt,358,0,17,ENGINEER +documents.txt,359,0,21,MANAGER +documents.txt,360,0,14,MANAGER +documents.txt,361,37,48,ENGINEER +documents.txt,362,0,24,ENGINEER +documents.txt,363,0,21,MANAGER +documents.txt,364,0,11,MANAGER +documents.txt,365,20,36,ENGINEER +documents.txt,366,0,17,ENGINEER +documents.txt,367,0,10,ENGINEER +documents.txt,368,25,41,ENGINEER +documents.txt,369,0,13,MANAGER +documents.txt,370,25,36,ENGINEER +documents.txt,371,20,39,ENGINEER +documents.txt,372,37,51,ENGINEER +documents.txt,373,0,11,ENGINEER +documents.txt,374,25,38,MANAGER documents.txt,375,0,13,ENGINEER -documents.txt,376,0,11,MANAGER -documents.txt,377,0,12,ENGINEER -documents.txt,378,25,40,MANAGER -documents.txt,379,0,15,ENGINEER -documents.txt,380,0,11,ENGINEER -documents.txt,381,0,20,MANAGER -documents.txt,382,0,19,ENGINEER -documents.txt,383,0,24,ENGINEER -documents.txt,384,0,12,ENGINEER -documents.txt,385,0,16,MANAGER +documents.txt,376,0,13,ENGINEER +documents.txt,377,0,11,MANAGER +documents.txt,378,0,17,MANAGER +documents.txt,379,0,17,MANAGER +documents.txt,380,0,15,MANAGER +documents.txt,381,19,31,MANAGER +documents.txt,382,25,45,MANAGER +documents.txt,383,0,12,MANAGER +documents.txt,384,0,15,ENGINEER +documents.txt,385,0,19,ENGINEER documents.txt,386,0,14,MANAGER -documents.txt,387,0,9,MANAGER -documents.txt,388,0,12,MANAGER -documents.txt,389,36,50,MANAGER -documents.txt,390,20,32,ENGINEER -documents.txt,391,0,15,ENGINEER -documents.txt,392,0,17,MANAGER -documents.txt,393,19,34,MANAGER -documents.txt,394,0,17,ENGINEER -documents.txt,395,0,16,ENGINEER -documents.txt,396,0,16,MANAGER -documents.txt,397,0,20,ENGINEER -documents.txt,398,0,17,MANAGER -documents.txt,399,0,16,MANAGER -documents.txt,400,0,12,ENGINEER -documents.txt,401,0,10,MANAGER -documents.txt,402,0,14,MANAGER -documents.txt,403,0,11,ENGINEER -documents.txt,404,25,35,ENGINEER -documents.txt,405,0,13,ENGINEER +documents.txt,387,0,17,ENGINEER +documents.txt,388,19,32,MANAGER +documents.txt,389,0,15,MANAGER +documents.txt,390,0,19,ENGINEER +documents.txt,391,0,13,MANAGER +documents.txt,392,0,18,MANAGER +documents.txt,393,19,35,MANAGER +documents.txt,394,0,18,MANAGER +documents.txt,395,0,14,ENGINEER +documents.txt,396,20,41,ENGINEER +documents.txt,397,0,19,ENGINEER +documents.txt,398,0,16,ENGINEER +documents.txt,399,0,20,MANAGER +documents.txt,400,25,44,MANAGER +documents.txt,401,36,50,MANAGER +documents.txt,402,0,20,ENGINEER +documents.txt,403,0,16,ENGINEER +documents.txt,404,0,12,MANAGER +documents.txt,405,25,41,ENGINEER documents.txt,406,0,13,MANAGER -documents.txt,407,36,47,MANAGER -documents.txt,408,20,31,ENGINEER -documents.txt,409,37,47,ENGINEER -documents.txt,410,0,13,ENGINEER -documents.txt,411,20,34,ENGINEER -documents.txt,412,0,19,MANAGER -documents.txt,413,0,12,ENGINEER -documents.txt,414,0,14,ENGINEER +documents.txt,407,0,19,ENGINEER +documents.txt,408,25,40,ENGINEER +documents.txt,409,0,21,MANAGER +documents.txt,410,0,14,ENGINEER +documents.txt,411,0,11,MANAGER +documents.txt,412,0,17,MANAGER +documents.txt,413,0,13,MANAGER +documents.txt,414,0,14,MANAGER documents.txt,415,0,14,MANAGER -documents.txt,416,20,31,ENGINEER -documents.txt,417,0,13,MANAGER -documents.txt,418,0,17,ENGINEER -documents.txt,419,0,12,ENGINEER -documents.txt,420,0,13,ENGINEER -documents.txt,421,0,15,MANAGER -documents.txt,422,19,37,MANAGER -documents.txt,423,37,50,ENGINEER +documents.txt,416,0,20,MANAGER +documents.txt,417,0,12,MANAGER +documents.txt,418,0,20,MANAGER +documents.txt,419,0,23,ENGINEER +documents.txt,420,37,48,ENGINEER +documents.txt,421,37,51,ENGINEER +documents.txt,422,0,10,MANAGER +documents.txt,423,37,59,ENGINEER documents.txt,424,0,17,MANAGER -documents.txt,425,0,15,ENGINEER -documents.txt,426,0,9,ENGINEER -documents.txt,427,0,11,MANAGER -documents.txt,428,0,13,MANAGER -documents.txt,429,0,13,MANAGER -documents.txt,430,0,17,ENGINEER -documents.txt,431,20,39,ENGINEER -documents.txt,432,19,32,MANAGER -documents.txt,433,0,19,MANAGER -documents.txt,434,25,40,ENGINEER -documents.txt,435,0,14,MANAGER -documents.txt,436,0,16,ENGINEER -documents.txt,437,0,24,ENGINEER -documents.txt,438,19,38,MANAGER -documents.txt,439,0,17,MANAGER -documents.txt,440,36,52,MANAGER -documents.txt,441,0,16,ENGINEER -documents.txt,442,0,20,MANAGER -documents.txt,443,0,11,MANAGER -documents.txt,444,0,12,MANAGER -documents.txt,445,0,16,MANAGER -documents.txt,446,0,13,MANAGER +documents.txt,425,20,31,ENGINEER +documents.txt,426,0,16,MANAGER +documents.txt,427,37,53,ENGINEER +documents.txt,428,0,15,MANAGER +documents.txt,429,0,15,ENGINEER +documents.txt,430,0,16,ENGINEER +documents.txt,431,0,19,ENGINEER +documents.txt,432,0,10,ENGINEER +documents.txt,433,0,18,MANAGER +documents.txt,434,25,38,ENGINEER +documents.txt,435,20,36,ENGINEER +documents.txt,436,0,22,MANAGER +documents.txt,437,0,17,MANAGER +documents.txt,438,0,10,MANAGER +documents.txt,439,25,37,MANAGER +documents.txt,440,0,17,MANAGER +documents.txt,441,0,14,ENGINEER +documents.txt,442,0,19,MANAGER +documents.txt,443,0,18,ENGINEER +documents.txt,444,0,19,ENGINEER +documents.txt,445,0,16,ENGINEER +documents.txt,446,25,42,ENGINEER documents.txt,447,0,15,MANAGER -documents.txt,448,0,14,ENGINEER -documents.txt,449,0,17,ENGINEER -documents.txt,450,0,13,MANAGER -documents.txt,451,0,14,ENGINEER -documents.txt,452,0,12,MANAGER -documents.txt,453,0,9,MANAGER -documents.txt,454,0,18,MANAGER -documents.txt,455,25,42,ENGINEER -documents.txt,456,0,20,MANAGER -documents.txt,457,0,15,ENGINEER -documents.txt,458,37,47,ENGINEER -documents.txt,459,0,23,ENGINEER -documents.txt,460,0,13,MANAGER -documents.txt,461,19,35,MANAGER -documents.txt,462,0,10,ENGINEER -documents.txt,463,0,15,MANAGER -documents.txt,464,0,12,MANAGER -documents.txt,465,0,11,MANAGER -documents.txt,466,25,38,ENGINEER -documents.txt,467,25,41,MANAGER -documents.txt,468,25,44,MANAGER -documents.txt,469,25,41,MANAGER -documents.txt,470,0,18,MANAGER -documents.txt,471,0,10,ENGINEER -documents.txt,472,0,15,ENGINEER -documents.txt,473,0,17,MANAGER -documents.txt,474,19,40,MANAGER -documents.txt,475,0,15,ENGINEER -documents.txt,476,19,35,MANAGER -documents.txt,477,0,14,MANAGER -documents.txt,478,0,18,MANAGER -documents.txt,479,0,15,ENGINEER -documents.txt,480,25,47,MANAGER -documents.txt,481,20,32,ENGINEER -documents.txt,482,0,13,ENGINEER -documents.txt,483,0,24,ENGINEER -documents.txt,484,0,16,ENGINEER -documents.txt,485,0,13,MANAGER -documents.txt,486,0,20,MANAGER -documents.txt,487,0,15,MANAGER +documents.txt,448,0,16,ENGINEER +documents.txt,449,0,19,ENGINEER +documents.txt,450,0,15,ENGINEER +documents.txt,451,0,13,ENGINEER +documents.txt,452,20,31,ENGINEER +documents.txt,453,36,54,MANAGER +documents.txt,454,19,40,MANAGER +documents.txt,455,0,12,MANAGER +documents.txt,456,36,48,MANAGER +documents.txt,457,0,17,ENGINEER +documents.txt,458,0,12,ENGINEER +documents.txt,459,25,38,ENGINEER +documents.txt,460,0,13,ENGINEER +documents.txt,461,0,18,MANAGER +documents.txt,462,0,10,MANAGER +documents.txt,463,0,14,MANAGER +documents.txt,464,0,21,MANAGER +documents.txt,465,0,13,MANAGER +documents.txt,466,0,15,MANAGER +documents.txt,467,0,11,ENGINEER +documents.txt,468,0,21,MANAGER +documents.txt,469,0,10,ENGINEER +documents.txt,470,0,21,MANAGER +documents.txt,471,25,38,MANAGER +documents.txt,472,0,11,ENGINEER +documents.txt,473,0,16,MANAGER +documents.txt,474,0,13,MANAGER +documents.txt,475,0,22,MANAGER +documents.txt,476,0,11,ENGINEER +documents.txt,477,0,11,MANAGER +documents.txt,478,0,17,MANAGER +documents.txt,479,0,12,ENGINEER +documents.txt,480,0,20,ENGINEER +documents.txt,481,0,15,MANAGER +documents.txt,482,0,11,ENGINEER +documents.txt,483,0,17,ENGINEER +documents.txt,484,0,14,MANAGER +documents.txt,485,0,12,MANAGER +documents.txt,486,0,15,MANAGER +documents.txt,487,0,12,ENGINEER documents.txt,488,0,15,ENGINEER -documents.txt,489,0,11,ENGINEER -documents.txt,490,0,10,MANAGER -documents.txt,491,25,38,ENGINEER -documents.txt,492,0,12,ENGINEER -documents.txt,493,0,15,MANAGER -documents.txt,494,0,12,MANAGER -documents.txt,495,0,11,ENGINEER -documents.txt,496,0,15,MANAGER -documents.txt,497,0,15,ENGINEER -documents.txt,498,25,41,ENGINEER -documents.txt,499,25,38,ENGINEER -documents.txt,500,0,14,MANAGER -documents.txt,501,25,37,MANAGER -documents.txt,502,0,14,MANAGER -documents.txt,503,25,40,ENGINEER -documents.txt,504,0,10,ENGINEER -documents.txt,505,0,17,MANAGER -documents.txt,506,0,16,MANAGER -documents.txt,507,0,10,ENGINEER -documents.txt,508,0,12,MANAGER -documents.txt,509,0,13,ENGINEER -documents.txt,510,0,12,ENGINEER -documents.txt,511,25,38,ENGINEER -documents.txt,512,0,10,MANAGER +documents.txt,489,0,11,MANAGER +documents.txt,490,0,14,ENGINEER +documents.txt,491,0,12,ENGINEER +documents.txt,492,0,19,MANAGER +documents.txt,493,0,13,ENGINEER +documents.txt,494,0,15,MANAGER +documents.txt,495,0,10,MANAGER +documents.txt,496,0,13,MANAGER +documents.txt,497,37,49,ENGINEER +documents.txt,498,0,19,ENGINEER +documents.txt,499,25,35,MANAGER +documents.txt,500,0,15,ENGINEER +documents.txt,501,25,43,ENGINEER +documents.txt,502,0,18,ENGINEER +documents.txt,503,37,53,ENGINEER +documents.txt,504,0,21,ENGINEER +documents.txt,505,0,20,MANAGER +documents.txt,506,0,15,ENGINEER +documents.txt,507,19,38,MANAGER +documents.txt,508,0,14,ENGINEER +documents.txt,509,0,22,ENGINEER +documents.txt,510,0,13,ENGINEER +documents.txt,511,0,16,MANAGER +documents.txt,512,0,15,MANAGER documents.txt,513,0,13,MANAGER -documents.txt,514,0,14,ENGINEER -documents.txt,515,0,15,MANAGER -documents.txt,516,0,17,MANAGER -documents.txt,517,20,32,ENGINEER +documents.txt,514,0,16,ENGINEER +documents.txt,515,0,17,ENGINEER +documents.txt,516,0,19,ENGINEER +documents.txt,517,36,59,MANAGER documents.txt,518,0,15,ENGINEER -documents.txt,519,0,14,ENGINEER -documents.txt,520,19,39,MANAGER -documents.txt,521,0,15,MANAGER -documents.txt,522,0,17,ENGINEER -documents.txt,523,0,15,ENGINEER -documents.txt,524,0,17,MANAGER -documents.txt,525,0,12,MANAGER -documents.txt,526,0,11,MANAGER -documents.txt,527,20,32,ENGINEER -documents.txt,528,0,16,ENGINEER -documents.txt,529,0,18,ENGINEER -documents.txt,530,20,35,ENGINEER +documents.txt,519,0,14,MANAGER +documents.txt,520,0,12,MANAGER +documents.txt,521,0,11,ENGINEER +documents.txt,522,0,20,ENGINEER +documents.txt,523,19,30,MANAGER +documents.txt,524,37,56,ENGINEER +documents.txt,525,36,52,MANAGER +documents.txt,526,0,15,MANAGER +documents.txt,527,0,15,ENGINEER +documents.txt,528,0,14,MANAGER +documents.txt,529,0,11,ENGINEER +documents.txt,530,0,17,MANAGER documents.txt,531,0,14,ENGINEER -documents.txt,532,0,18,MANAGER -documents.txt,533,0,16,ENGINEER -documents.txt,534,0,8,ENGINEER +documents.txt,532,0,13,ENGINEER +documents.txt,533,0,12,ENGINEER +documents.txt,534,0,17,MANAGER documents.txt,535,0,14,MANAGER -documents.txt,536,25,47,ENGINEER -documents.txt,537,0,16,ENGINEER -documents.txt,538,20,34,ENGINEER -documents.txt,539,0,14,MANAGER -documents.txt,540,0,11,MANAGER -documents.txt,541,25,37,MANAGER -documents.txt,542,0,13,MANAGER -documents.txt,543,0,16,ENGINEER -documents.txt,544,0,10,MANAGER -documents.txt,545,0,16,ENGINEER -documents.txt,546,0,17,MANAGER -documents.txt,547,25,42,MANAGER -documents.txt,548,0,12,MANAGER -documents.txt,549,0,17,MANAGER -documents.txt,550,0,12,ENGINEER -documents.txt,551,0,19,MANAGER -documents.txt,552,0,15,ENGINEER -documents.txt,553,0,16,MANAGER -documents.txt,554,20,35,ENGINEER -documents.txt,555,0,20,MANAGER -documents.txt,556,0,15,MANAGER -documents.txt,557,0,15,MANAGER -documents.txt,558,0,17,MANAGER -documents.txt,559,0,17,ENGINEER -documents.txt,560,19,33,MANAGER -documents.txt,561,36,44,MANAGER -documents.txt,562,0,13,MANAGER -documents.txt,563,0,15,MANAGER -documents.txt,564,0,13,MANAGER -documents.txt,565,0,21,ENGINEER -documents.txt,566,0,22,ENGINEER -documents.txt,567,19,36,MANAGER -documents.txt,568,20,33,ENGINEER -documents.txt,569,0,14,MANAGER -documents.txt,570,0,16,ENGINEER -documents.txt,571,0,13,ENGINEER -documents.txt,572,0,18,ENGINEER -documents.txt,573,0,10,ENGINEER -documents.txt,574,0,13,MANAGER -documents.txt,575,0,15,MANAGER -documents.txt,576,0,17,ENGINEER -documents.txt,577,0,17,ENGINEER -documents.txt,578,0,14,ENGINEER -documents.txt,579,0,13,MANAGER -documents.txt,580,0,17,ENGINEER -documents.txt,581,37,48,ENGINEER +documents.txt,536,0,14,ENGINEER +documents.txt,537,37,49,ENGINEER +documents.txt,538,20,38,ENGINEER +documents.txt,539,0,15,ENGINEER +documents.txt,540,37,51,ENGINEER +documents.txt,541,0,18,ENGINEER +documents.txt,542,19,32,MANAGER +documents.txt,543,0,14,MANAGER +documents.txt,544,0,10,ENGINEER +documents.txt,545,19,40,MANAGER +documents.txt,546,0,23,MANAGER +documents.txt,547,19,39,MANAGER +documents.txt,548,0,14,ENGINEER +documents.txt,549,0,10,MANAGER +documents.txt,550,0,16,MANAGER +documents.txt,551,0,13,MANAGER +documents.txt,552,0,9,ENGINEER +documents.txt,553,19,34,MANAGER +documents.txt,554,0,22,MANAGER +documents.txt,555,0,19,MANAGER +documents.txt,556,0,18,MANAGER +documents.txt,557,0,14,MANAGER +documents.txt,558,0,14,MANAGER +documents.txt,559,0,20,ENGINEER +documents.txt,560,36,50,MANAGER +documents.txt,561,25,38,ENGINEER +documents.txt,562,0,15,MANAGER +documents.txt,563,0,16,ENGINEER +documents.txt,564,0,12,ENGINEER +documents.txt,565,0,18,ENGINEER +documents.txt,566,36,47,MANAGER +documents.txt,567,0,18,ENGINEER +documents.txt,568,0,18,MANAGER +documents.txt,569,0,21,ENGINEER +documents.txt,570,0,19,MANAGER +documents.txt,571,0,12,MANAGER +documents.txt,572,0,11,MANAGER +documents.txt,573,0,11,ENGINEER +documents.txt,574,0,12,ENGINEER +documents.txt,575,20,33,ENGINEER +documents.txt,576,20,40,ENGINEER +documents.txt,577,0,12,ENGINEER +documents.txt,578,0,21,MANAGER +documents.txt,579,0,17,MANAGER +documents.txt,580,0,16,MANAGER +documents.txt,581,0,20,MANAGER documents.txt,582,0,16,ENGINEER -documents.txt,583,37,55,ENGINEER -documents.txt,584,0,11,MANAGER -documents.txt,585,37,55,ENGINEER -documents.txt,586,0,20,MANAGER -documents.txt,587,0,13,MANAGER -documents.txt,588,0,13,MANAGER -documents.txt,589,25,35,ENGINEER -documents.txt,590,0,15,ENGINEER -documents.txt,591,0,21,MANAGER -documents.txt,592,0,13,MANAGER -documents.txt,593,0,12,ENGINEER -documents.txt,594,0,16,ENGINEER -documents.txt,595,20,34,ENGINEER -documents.txt,596,20,34,ENGINEER -documents.txt,597,0,14,ENGINEER -documents.txt,598,0,17,MANAGER -documents.txt,599,0,13,MANAGER -documents.txt,600,0,20,MANAGER -documents.txt,601,0,16,MANAGER -documents.txt,602,0,18,MANAGER -documents.txt,603,0,18,MANAGER -documents.txt,604,0,19,MANAGER -documents.txt,605,0,19,MANAGER -documents.txt,606,0,12,ENGINEER -documents.txt,607,25,43,ENGINEER -documents.txt,608,0,22,MANAGER -documents.txt,609,0,12,MANAGER -documents.txt,610,36,53,MANAGER -documents.txt,611,0,12,ENGINEER -documents.txt,612,0,16,MANAGER -documents.txt,613,0,14,MANAGER -documents.txt,614,0,13,ENGINEER -documents.txt,615,0,17,ENGINEER -documents.txt,616,25,39,ENGINEER -documents.txt,617,0,13,ENGINEER -documents.txt,618,0,19,ENGINEER -documents.txt,619,0,15,MANAGER -documents.txt,620,0,20,MANAGER -documents.txt,621,0,15,MANAGER -documents.txt,622,0,14,ENGINEER -documents.txt,623,0,15,MANAGER -documents.txt,624,37,51,ENGINEER -documents.txt,625,0,19,ENGINEER -documents.txt,626,0,19,ENGINEER -documents.txt,627,0,13,MANAGER -documents.txt,628,0,17,MANAGER -documents.txt,629,0,22,MANAGER -documents.txt,630,0,14,ENGINEER -documents.txt,631,0,21,ENGINEER +documents.txt,583,0,11,ENGINEER +documents.txt,584,0,18,MANAGER +documents.txt,585,0,22,MANAGER +documents.txt,586,37,55,ENGINEER +documents.txt,587,0,17,ENGINEER +documents.txt,588,0,22,ENGINEER +documents.txt,589,25,41,MANAGER +documents.txt,590,19,34,MANAGER +documents.txt,591,0,19,ENGINEER +documents.txt,592,0,17,ENGINEER +documents.txt,593,0,21,MANAGER +documents.txt,594,0,13,MANAGER +documents.txt,595,36,60,MANAGER +documents.txt,596,0,19,ENGINEER +documents.txt,597,0,13,ENGINEER +documents.txt,598,0,14,MANAGER +documents.txt,599,36,50,MANAGER +documents.txt,600,25,35,MANAGER +documents.txt,601,0,25,MANAGER +documents.txt,602,0,20,MANAGER +documents.txt,603,0,14,ENGINEER +documents.txt,604,25,43,MANAGER +documents.txt,605,0,15,ENGINEER +documents.txt,606,0,15,ENGINEER +documents.txt,607,0,20,MANAGER +documents.txt,608,36,52,MANAGER +documents.txt,609,0,14,MANAGER +documents.txt,610,0,17,ENGINEER +documents.txt,611,0,16,ENGINEER +documents.txt,612,0,14,MANAGER +documents.txt,613,0,12,ENGINEER +documents.txt,614,0,19,MANAGER +documents.txt,615,0,14,ENGINEER +documents.txt,616,0,23,ENGINEER +documents.txt,617,0,17,ENGINEER +documents.txt,618,0,13,ENGINEER +documents.txt,619,0,17,MANAGER +documents.txt,620,0,14,ENGINEER +documents.txt,621,0,18,MANAGER +documents.txt,622,0,17,MANAGER +documents.txt,623,0,11,MANAGER +documents.txt,624,20,33,ENGINEER +documents.txt,625,0,16,MANAGER +documents.txt,626,0,19,MANAGER +documents.txt,627,0,11,MANAGER +documents.txt,628,0,13,ENGINEER +documents.txt,629,37,54,ENGINEER +documents.txt,630,0,22,ENGINEER +documents.txt,631,0,21,MANAGER documents.txt,632,0,12,ENGINEER -documents.txt,633,0,16,ENGINEER -documents.txt,634,0,13,ENGINEER -documents.txt,635,36,49,MANAGER -documents.txt,636,0,10,MANAGER -documents.txt,637,0,24,MANAGER -documents.txt,638,19,36,MANAGER -documents.txt,639,0,18,ENGINEER -documents.txt,640,0,15,MANAGER -documents.txt,641,0,19,ENGINEER -documents.txt,642,0,17,ENGINEER -documents.txt,643,0,13,ENGINEER -documents.txt,644,0,18,ENGINEER -documents.txt,645,0,17,ENGINEER -documents.txt,646,19,29,MANAGER -documents.txt,647,0,14,ENGINEER -documents.txt,648,0,16,MANAGER -documents.txt,649,0,14,MANAGER -documents.txt,650,0,14,MANAGER -documents.txt,651,0,19,MANAGER -documents.txt,652,0,10,ENGINEER -documents.txt,653,0,18,MANAGER -documents.txt,654,0,16,ENGINEER -documents.txt,655,0,12,MANAGER -documents.txt,656,0,20,ENGINEER -documents.txt,657,19,40,MANAGER -documents.txt,658,0,12,MANAGER -documents.txt,659,0,20,MANAGER -documents.txt,660,25,39,MANAGER -documents.txt,661,0,18,MANAGER -documents.txt,662,0,16,ENGINEER -documents.txt,663,25,33,MANAGER -documents.txt,664,0,10,MANAGER -documents.txt,665,25,38,ENGINEER -documents.txt,666,0,11,MANAGER -documents.txt,667,0,17,ENGINEER -documents.txt,668,36,55,MANAGER -documents.txt,669,0,11,MANAGER -documents.txt,670,0,18,ENGINEER -documents.txt,671,0,13,ENGINEER -documents.txt,672,25,45,MANAGER -documents.txt,673,0,13,MANAGER -documents.txt,674,0,16,MANAGER -documents.txt,675,0,18,ENGINEER -documents.txt,676,0,13,ENGINEER -documents.txt,677,37,56,ENGINEER -documents.txt,678,0,16,MANAGER -documents.txt,679,0,18,MANAGER -documents.txt,680,0,17,MANAGER -documents.txt,681,25,39,MANAGER -documents.txt,682,0,14,MANAGER -documents.txt,683,0,11,MANAGER -documents.txt,684,0,12,ENGINEER -documents.txt,685,0,20,ENGINEER -documents.txt,686,0,16,MANAGER -documents.txt,687,0,11,ENGINEER -documents.txt,688,0,9,ENGINEER -documents.txt,689,0,18,ENGINEER -documents.txt,690,0,16,MANAGER -documents.txt,691,0,15,ENGINEER -documents.txt,692,0,14,ENGINEER -documents.txt,693,0,16,ENGINEER -documents.txt,694,0,14,MANAGER -documents.txt,695,0,12,MANAGER +documents.txt,633,25,43,MANAGER +documents.txt,634,0,13,MANAGER +documents.txt,635,20,32,ENGINEER +documents.txt,636,0,14,MANAGER +documents.txt,637,0,12,ENGINEER +documents.txt,638,0,15,MANAGER +documents.txt,639,0,14,MANAGER +documents.txt,640,0,10,MANAGER +documents.txt,641,0,16,MANAGER +documents.txt,642,19,33,MANAGER +documents.txt,643,25,45,MANAGER +documents.txt,644,0,19,ENGINEER +documents.txt,645,0,12,ENGINEER +documents.txt,646,0,21,ENGINEER +documents.txt,647,19,34,MANAGER +documents.txt,648,0,17,MANAGER +documents.txt,649,0,14,ENGINEER +documents.txt,650,25,43,ENGINEER +documents.txt,651,0,18,ENGINEER +documents.txt,652,0,14,ENGINEER +documents.txt,653,0,11,ENGINEER +documents.txt,654,0,20,MANAGER +documents.txt,655,0,17,ENGINEER +documents.txt,656,0,13,ENGINEER +documents.txt,657,0,13,ENGINEER +documents.txt,658,25,42,ENGINEER +documents.txt,659,25,37,MANAGER +documents.txt,660,0,17,MANAGER +documents.txt,661,19,34,MANAGER +documents.txt,662,0,12,ENGINEER +documents.txt,663,37,51,ENGINEER +documents.txt,664,0,13,MANAGER +documents.txt,665,0,16,MANAGER +documents.txt,666,25,39,MANAGER +documents.txt,667,0,18,ENGINEER +documents.txt,668,25,40,MANAGER +documents.txt,669,0,20,ENGINEER +documents.txt,670,25,40,ENGINEER +documents.txt,671,19,35,MANAGER +documents.txt,672,25,37,MANAGER +documents.txt,673,0,15,MANAGER +documents.txt,674,0,12,MANAGER +documents.txt,675,36,58,MANAGER +documents.txt,676,0,13,MANAGER +documents.txt,677,0,16,MANAGER +documents.txt,678,25,45,ENGINEER +documents.txt,679,0,15,ENGINEER +documents.txt,680,0,18,MANAGER +documents.txt,681,0,15,ENGINEER +documents.txt,682,36,54,MANAGER +documents.txt,683,0,11,ENGINEER +documents.txt,684,0,15,ENGINEER +documents.txt,685,36,56,MANAGER +documents.txt,686,0,13,MANAGER +documents.txt,687,36,48,MANAGER +documents.txt,688,0,12,ENGINEER +documents.txt,689,25,38,ENGINEER +documents.txt,690,0,18,MANAGER +documents.txt,691,0,12,MANAGER +documents.txt,692,0,20,MANAGER +documents.txt,693,0,14,ENGINEER +documents.txt,694,0,16,MANAGER +documents.txt,695,0,22,ENGINEER documents.txt,696,0,15,ENGINEER -documents.txt,697,0,8,ENGINEER -documents.txt,698,0,11,MANAGER -documents.txt,699,0,19,ENGINEER -documents.txt,700,25,41,MANAGER +documents.txt,697,0,14,MANAGER +documents.txt,698,0,14,MANAGER +documents.txt,699,0,10,ENGINEER +documents.txt,700,36,46,MANAGER documents.txt,701,0,14,MANAGER -documents.txt,702,0,13,ENGINEER +documents.txt,702,0,22,MANAGER documents.txt,703,0,15,MANAGER -documents.txt,704,25,39,ENGINEER -documents.txt,705,0,10,MANAGER -documents.txt,706,0,15,MANAGER -documents.txt,707,25,36,ENGINEER -documents.txt,708,0,14,MANAGER -documents.txt,709,0,12,MANAGER -documents.txt,710,0,14,ENGINEER -documents.txt,711,36,45,MANAGER -documents.txt,712,0,15,MANAGER +documents.txt,704,0,18,MANAGER +documents.txt,705,0,19,MANAGER +documents.txt,706,0,14,MANAGER +documents.txt,707,0,14,ENGINEER +documents.txt,708,0,11,MANAGER +documents.txt,709,0,19,ENGINEER +documents.txt,710,0,10,ENGINEER +documents.txt,711,0,19,MANAGER +documents.txt,712,20,32,ENGINEER documents.txt,713,0,13,ENGINEER -documents.txt,714,25,37,MANAGER -documents.txt,715,0,10,ENGINEER -documents.txt,716,0,12,MANAGER +documents.txt,714,0,19,MANAGER +documents.txt,715,20,42,ENGINEER +documents.txt,716,0,13,MANAGER documents.txt,717,0,12,MANAGER -documents.txt,718,0,17,ENGINEER -documents.txt,719,19,34,MANAGER -documents.txt,720,0,16,ENGINEER -documents.txt,721,0,18,ENGINEER -documents.txt,722,0,16,MANAGER -documents.txt,723,37,56,ENGINEER -documents.txt,724,36,56,MANAGER -documents.txt,725,0,17,ENGINEER -documents.txt,726,0,21,MANAGER -documents.txt,727,0,13,ENGINEER -documents.txt,728,0,14,ENGINEER -documents.txt,729,0,11,MANAGER -documents.txt,730,0,13,MANAGER -documents.txt,731,0,16,ENGINEER -documents.txt,732,0,17,MANAGER -documents.txt,733,25,39,MANAGER -documents.txt,734,0,17,MANAGER -documents.txt,735,36,48,MANAGER -documents.txt,736,0,11,MANAGER -documents.txt,737,0,16,MANAGER -documents.txt,738,0,16,ENGINEER -documents.txt,739,0,16,MANAGER -documents.txt,740,0,14,MANAGER -documents.txt,741,0,16,ENGINEER -documents.txt,742,0,17,ENGINEER -documents.txt,743,25,44,ENGINEER -documents.txt,744,25,38,ENGINEER -documents.txt,745,0,14,ENGINEER -documents.txt,746,19,32,MANAGER -documents.txt,747,0,11,ENGINEER -documents.txt,748,0,21,ENGINEER -documents.txt,749,0,16,ENGINEER -documents.txt,750,0,18,ENGINEER +documents.txt,718,0,12,ENGINEER +documents.txt,719,37,47,ENGINEER +documents.txt,720,0,11,MANAGER +documents.txt,721,20,31,ENGINEER +documents.txt,722,0,14,ENGINEER +documents.txt,723,0,22,ENGINEER +documents.txt,724,0,15,MANAGER +documents.txt,725,36,53,MANAGER +documents.txt,726,0,17,MANAGER +documents.txt,727,0,23,ENGINEER +documents.txt,728,0,20,MANAGER +documents.txt,729,0,14,MANAGER +documents.txt,730,0,12,ENGINEER +documents.txt,731,0,19,ENGINEER +documents.txt,732,0,20,ENGINEER +documents.txt,733,0,19,MANAGER +documents.txt,734,0,16,ENGINEER +documents.txt,735,0,15,ENGINEER +documents.txt,736,0,14,MANAGER +documents.txt,737,0,19,MANAGER +documents.txt,738,0,19,MANAGER +documents.txt,739,0,21,MANAGER +documents.txt,740,0,24,ENGINEER +documents.txt,741,37,54,ENGINEER +documents.txt,742,0,20,MANAGER +documents.txt,743,0,16,MANAGER +documents.txt,744,0,14,MANAGER +documents.txt,745,0,12,ENGINEER +documents.txt,746,0,16,MANAGER +documents.txt,747,0,13,MANAGER +documents.txt,748,0,17,ENGINEER +documents.txt,749,0,11,ENGINEER +documents.txt,750,37,52,ENGINEER documents.txt,751,0,11,MANAGER -documents.txt,752,0,10,ENGINEER -documents.txt,753,0,14,ENGINEER -documents.txt,754,0,17,MANAGER -documents.txt,755,0,16,ENGINEER -documents.txt,756,0,13,MANAGER -documents.txt,757,0,18,ENGINEER +documents.txt,752,0,22,ENGINEER +documents.txt,753,25,36,MANAGER +documents.txt,754,25,42,ENGINEER +documents.txt,755,0,11,ENGINEER +documents.txt,756,0,13,ENGINEER +documents.txt,757,0,11,MANAGER documents.txt,758,0,15,MANAGER -documents.txt,759,0,13,ENGINEER -documents.txt,760,0,10,MANAGER -documents.txt,761,0,14,ENGINEER -documents.txt,762,25,39,MANAGER -documents.txt,763,37,54,ENGINEER +documents.txt,759,0,22,MANAGER +documents.txt,760,0,15,MANAGER +documents.txt,761,0,10,MANAGER +documents.txt,762,0,13,MANAGER +documents.txt,763,25,36,MANAGER documents.txt,764,0,12,MANAGER -documents.txt,765,0,14,MANAGER -documents.txt,766,0,19,MANAGER -documents.txt,767,0,18,MANAGER -documents.txt,768,20,37,ENGINEER -documents.txt,769,0,14,MANAGER -documents.txt,770,25,38,MANAGER -documents.txt,771,0,15,ENGINEER -documents.txt,772,0,13,ENGINEER -documents.txt,773,0,14,MANAGER -documents.txt,774,25,39,MANAGER -documents.txt,775,0,18,MANAGER -documents.txt,776,0,17,MANAGER -documents.txt,777,0,14,MANAGER -documents.txt,778,19,33,MANAGER -documents.txt,779,0,16,MANAGER -documents.txt,780,0,10,ENGINEER -documents.txt,781,0,11,ENGINEER -documents.txt,782,20,37,ENGINEER -documents.txt,783,37,49,ENGINEER -documents.txt,784,0,14,ENGINEER -documents.txt,785,0,10,ENGINEER -documents.txt,786,36,48,MANAGER -documents.txt,787,19,30,MANAGER -documents.txt,788,0,14,ENGINEER -documents.txt,789,0,16,MANAGER -documents.txt,790,0,23,ENGINEER -documents.txt,791,25,38,MANAGER -documents.txt,792,37,53,ENGINEER -documents.txt,793,0,12,ENGINEER -documents.txt,794,36,51,MANAGER -documents.txt,795,0,17,MANAGER -documents.txt,796,0,17,ENGINEER -documents.txt,797,0,18,ENGINEER -documents.txt,798,0,15,MANAGER -documents.txt,799,0,11,ENGINEER -documents.txt,800,0,14,MANAGER -documents.txt,801,0,12,ENGINEER -documents.txt,802,0,11,ENGINEER -documents.txt,803,0,15,MANAGER -documents.txt,804,0,13,ENGINEER -documents.txt,805,0,14,MANAGER -documents.txt,806,20,35,ENGINEER -documents.txt,807,25,36,ENGINEER -documents.txt,808,0,15,MANAGER -documents.txt,809,0,12,ENGINEER -documents.txt,810,37,51,ENGINEER -documents.txt,811,0,10,ENGINEER -documents.txt,812,0,12,MANAGER -documents.txt,813,20,31,ENGINEER +documents.txt,765,0,10,ENGINEER +documents.txt,766,0,11,MANAGER +documents.txt,767,20,37,ENGINEER +documents.txt,768,0,16,ENGINEER +documents.txt,769,0,16,ENGINEER +documents.txt,770,0,18,MANAGER +documents.txt,771,0,15,MANAGER +documents.txt,772,25,41,MANAGER +documents.txt,773,0,18,ENGINEER +documents.txt,774,0,13,ENGINEER +documents.txt,775,0,13,ENGINEER +documents.txt,776,0,21,ENGINEER +documents.txt,777,0,16,ENGINEER +documents.txt,778,25,43,MANAGER +documents.txt,779,20,34,ENGINEER +documents.txt,780,0,14,MANAGER +documents.txt,781,20,37,ENGINEER +documents.txt,782,0,15,MANAGER +documents.txt,783,0,17,MANAGER +documents.txt,784,25,38,MANAGER +documents.txt,785,0,18,MANAGER +documents.txt,786,0,12,ENGINEER +documents.txt,787,0,17,ENGINEER +documents.txt,788,20,37,ENGINEER +documents.txt,789,0,12,MANAGER +documents.txt,790,0,16,ENGINEER +documents.txt,791,0,19,ENGINEER +documents.txt,792,0,17,ENGINEER +documents.txt,793,25,41,ENGINEER +documents.txt,794,25,42,ENGINEER +documents.txt,795,25,41,ENGINEER +documents.txt,796,37,48,ENGINEER +documents.txt,797,0,11,ENGINEER +documents.txt,798,36,53,MANAGER +documents.txt,799,20,37,ENGINEER +documents.txt,800,0,15,ENGINEER +documents.txt,801,0,16,ENGINEER +documents.txt,802,0,15,MANAGER +documents.txt,803,0,18,MANAGER +documents.txt,804,0,18,MANAGER +documents.txt,805,0,18,MANAGER +documents.txt,806,0,17,MANAGER +documents.txt,807,0,20,ENGINEER +documents.txt,808,0,18,ENGINEER +documents.txt,809,37,55,ENGINEER +documents.txt,810,37,62,ENGINEER +documents.txt,811,0,15,MANAGER +documents.txt,812,25,36,ENGINEER +documents.txt,813,0,19,ENGINEER documents.txt,814,0,17,ENGINEER -documents.txt,815,0,10,ENGINEER -documents.txt,816,19,32,MANAGER -documents.txt,817,0,16,MANAGER -documents.txt,818,0,11,MANAGER -documents.txt,819,0,14,ENGINEER -documents.txt,820,0,19,MANAGER -documents.txt,821,0,13,ENGINEER -documents.txt,822,0,16,MANAGER -documents.txt,823,0,14,MANAGER -documents.txt,824,0,14,MANAGER -documents.txt,825,0,13,ENGINEER +documents.txt,815,0,8,MANAGER +documents.txt,816,37,51,ENGINEER +documents.txt,817,25,47,ENGINEER +documents.txt,818,25,36,ENGINEER +documents.txt,819,36,49,MANAGER +documents.txt,820,0,19,ENGINEER +documents.txt,821,0,16,MANAGER +documents.txt,822,0,18,ENGINEER +documents.txt,823,25,44,ENGINEER +documents.txt,824,37,50,ENGINEER +documents.txt,825,0,13,MANAGER documents.txt,826,0,14,ENGINEER -documents.txt,827,0,10,ENGINEER -documents.txt,828,0,11,MANAGER -documents.txt,829,0,15,ENGINEER -documents.txt,830,0,10,MANAGER -documents.txt,831,0,17,MANAGER -documents.txt,832,0,19,MANAGER -documents.txt,833,0,15,ENGINEER -documents.txt,834,0,20,ENGINEER -documents.txt,835,0,15,MANAGER -documents.txt,836,0,16,MANAGER -documents.txt,837,0,11,MANAGER +documents.txt,827,0,11,MANAGER +documents.txt,828,36,49,MANAGER +documents.txt,829,0,20,MANAGER +documents.txt,830,0,13,ENGINEER +documents.txt,831,19,31,MANAGER +documents.txt,832,0,10,ENGINEER +documents.txt,833,0,12,ENGINEER +documents.txt,834,36,53,MANAGER +documents.txt,835,0,14,MANAGER +documents.txt,836,0,14,MANAGER +documents.txt,837,0,18,MANAGER documents.txt,838,0,13,MANAGER -documents.txt,839,0,14,MANAGER -documents.txt,840,0,15,ENGINEER -documents.txt,841,0,16,MANAGER -documents.txt,842,25,43,ENGINEER -documents.txt,843,0,17,MANAGER -documents.txt,844,0,15,ENGINEER -documents.txt,845,0,14,MANAGER -documents.txt,846,0,16,ENGINEER -documents.txt,847,0,10,ENGINEER -documents.txt,848,0,11,ENGINEER -documents.txt,849,36,53,MANAGER -documents.txt,850,0,21,MANAGER -documents.txt,851,0,15,MANAGER -documents.txt,852,0,13,MANAGER -documents.txt,853,0,11,ENGINEER -documents.txt,854,0,22,MANAGER -documents.txt,855,0,13,MANAGER -documents.txt,856,0,12,MANAGER -documents.txt,857,0,16,ENGINEER -documents.txt,858,0,18,ENGINEER -documents.txt,859,0,9,ENGINEER -documents.txt,860,0,12,ENGINEER -documents.txt,861,0,14,ENGINEER -documents.txt,862,37,55,ENGINEER -documents.txt,863,0,12,MANAGER -documents.txt,864,0,15,ENGINEER -documents.txt,865,0,13,ENGINEER -documents.txt,866,0,14,ENGINEER -documents.txt,867,20,32,ENGINEER -documents.txt,868,37,50,ENGINEER -documents.txt,869,0,10,ENGINEER -documents.txt,870,0,13,MANAGER -documents.txt,871,0,16,ENGINEER -documents.txt,872,0,14,ENGINEER -documents.txt,873,0,16,MANAGER -documents.txt,874,25,40,ENGINEER -documents.txt,875,0,14,ENGINEER -documents.txt,876,36,49,MANAGER -documents.txt,877,0,9,MANAGER -documents.txt,878,0,17,MANAGER -documents.txt,879,25,39,MANAGER +documents.txt,839,36,51,MANAGER +documents.txt,840,0,16,MANAGER +documents.txt,841,36,52,MANAGER +documents.txt,842,0,17,ENGINEER +documents.txt,843,0,16,ENGINEER +documents.txt,844,0,13,MANAGER +documents.txt,845,0,13,ENGINEER +documents.txt,846,19,26,MANAGER +documents.txt,847,0,19,ENGINEER +documents.txt,848,20,37,ENGINEER +documents.txt,849,0,12,MANAGER +documents.txt,850,0,19,MANAGER +documents.txt,851,0,10,MANAGER +documents.txt,852,0,17,MANAGER +documents.txt,853,0,14,ENGINEER +documents.txt,854,19,41,MANAGER +documents.txt,855,0,12,MANAGER +documents.txt,856,36,48,MANAGER +documents.txt,857,0,20,ENGINEER +documents.txt,858,0,13,MANAGER +documents.txt,859,0,11,ENGINEER +documents.txt,860,0,17,ENGINEER +documents.txt,861,0,15,MANAGER +documents.txt,862,0,17,ENGINEER +documents.txt,863,0,22,MANAGER +documents.txt,864,0,7,ENGINEER +documents.txt,865,0,15,MANAGER +documents.txt,866,0,18,MANAGER +documents.txt,867,0,17,MANAGER +documents.txt,868,0,12,MANAGER +documents.txt,869,0,13,ENGINEER +documents.txt,870,0,13,ENGINEER +documents.txt,871,37,52,ENGINEER +documents.txt,872,0,12,ENGINEER +documents.txt,873,0,11,ENGINEER +documents.txt,874,0,15,MANAGER +documents.txt,875,0,21,ENGINEER +documents.txt,876,0,16,MANAGER +documents.txt,877,0,21,ENGINEER +documents.txt,878,19,39,MANAGER +documents.txt,879,0,20,MANAGER documents.txt,880,0,14,MANAGER -documents.txt,881,37,57,ENGINEER -documents.txt,882,0,12,MANAGER -documents.txt,883,19,34,MANAGER -documents.txt,884,0,18,ENGINEER -documents.txt,885,0,16,ENGINEER -documents.txt,886,37,50,ENGINEER -documents.txt,887,0,20,ENGINEER -documents.txt,888,0,16,ENGINEER -documents.txt,889,0,19,MANAGER -documents.txt,890,0,11,MANAGER -documents.txt,891,0,10,MANAGER -documents.txt,892,0,17,ENGINEER -documents.txt,893,0,19,ENGINEER -documents.txt,894,0,9,MANAGER -documents.txt,895,0,14,ENGINEER -documents.txt,896,0,14,MANAGER -documents.txt,897,0,10,ENGINEER -documents.txt,898,0,20,ENGINEER -documents.txt,899,0,13,ENGINEER -documents.txt,900,0,24,ENGINEER -documents.txt,901,0,11,MANAGER -documents.txt,902,0,18,ENGINEER -documents.txt,903,0,19,MANAGER -documents.txt,904,37,52,ENGINEER -documents.txt,905,0,17,MANAGER -documents.txt,906,0,14,ENGINEER -documents.txt,907,0,13,MANAGER -documents.txt,908,0,16,ENGINEER -documents.txt,909,0,13,ENGINEER -documents.txt,910,0,11,ENGINEER -documents.txt,911,0,12,ENGINEER -documents.txt,912,0,16,ENGINEER -documents.txt,913,0,12,ENGINEER -documents.txt,914,36,50,MANAGER -documents.txt,915,0,15,ENGINEER +documents.txt,881,19,33,MANAGER +documents.txt,882,0,20,ENGINEER +documents.txt,883,0,13,ENGINEER +documents.txt,884,0,18,MANAGER +documents.txt,885,0,18,ENGINEER +documents.txt,886,0,13,ENGINEER +documents.txt,887,0,19,ENGINEER +documents.txt,888,0,12,ENGINEER +documents.txt,889,0,14,MANAGER +documents.txt,890,0,11,ENGINEER +documents.txt,891,0,11,MANAGER +documents.txt,892,0,10,ENGINEER +documents.txt,893,0,12,ENGINEER +documents.txt,894,0,18,ENGINEER +documents.txt,895,0,17,MANAGER +documents.txt,896,0,19,MANAGER +documents.txt,897,0,22,ENGINEER +documents.txt,898,0,13,MANAGER +documents.txt,899,0,16,ENGINEER +documents.txt,900,0,19,ENGINEER +documents.txt,901,0,12,MANAGER +documents.txt,902,37,57,ENGINEER +documents.txt,903,0,21,ENGINEER +documents.txt,904,0,14,MANAGER +documents.txt,905,0,19,ENGINEER +documents.txt,906,0,11,ENGINEER +documents.txt,907,20,37,ENGINEER +documents.txt,908,0,12,MANAGER +documents.txt,909,36,52,MANAGER +documents.txt,910,0,15,ENGINEER +documents.txt,911,25,42,MANAGER +documents.txt,912,20,36,ENGINEER +documents.txt,913,0,16,ENGINEER +documents.txt,914,0,21,ENGINEER +documents.txt,915,0,17,ENGINEER documents.txt,916,0,16,ENGINEER -documents.txt,917,36,50,MANAGER -documents.txt,918,0,12,MANAGER -documents.txt,919,0,14,ENGINEER -documents.txt,920,0,15,MANAGER -documents.txt,921,0,13,ENGINEER -documents.txt,922,20,36,ENGINEER -documents.txt,923,0,18,ENGINEER -documents.txt,924,19,37,MANAGER -documents.txt,925,0,16,ENGINEER -documents.txt,926,0,14,ENGINEER -documents.txt,927,25,36,ENGINEER -documents.txt,928,37,49,ENGINEER -documents.txt,929,0,10,MANAGER -documents.txt,930,0,10,ENGINEER -documents.txt,931,0,14,ENGINEER -documents.txt,932,0,15,ENGINEER -documents.txt,933,0,16,MANAGER +documents.txt,917,0,12,MANAGER +documents.txt,918,0,18,MANAGER +documents.txt,919,0,11,ENGINEER +documents.txt,920,19,38,MANAGER +documents.txt,921,0,15,ENGINEER +documents.txt,922,36,55,MANAGER +documents.txt,923,0,21,ENGINEER +documents.txt,924,0,20,ENGINEER +documents.txt,925,0,17,MANAGER +documents.txt,926,0,20,ENGINEER +documents.txt,927,25,35,ENGINEER +documents.txt,928,0,16,ENGINEER +documents.txt,929,19,31,MANAGER +documents.txt,930,25,37,MANAGER +documents.txt,931,0,15,ENGINEER +documents.txt,932,36,50,MANAGER +documents.txt,933,0,21,MANAGER documents.txt,934,0,14,ENGINEER -documents.txt,935,0,23,ENGINEER -documents.txt,936,0,18,ENGINEER -documents.txt,937,0,18,MANAGER -documents.txt,938,0,16,ENGINEER -documents.txt,939,36,49,MANAGER -documents.txt,940,0,15,ENGINEER -documents.txt,941,0,13,ENGINEER -documents.txt,942,0,13,MANAGER -documents.txt,943,25,39,ENGINEER -documents.txt,944,37,54,ENGINEER -documents.txt,945,0,12,MANAGER -documents.txt,946,0,13,ENGINEER -documents.txt,947,0,18,MANAGER -documents.txt,948,20,36,ENGINEER -documents.txt,949,0,11,ENGINEER -documents.txt,950,0,14,ENGINEER -documents.txt,951,0,15,ENGINEER -documents.txt,952,0,16,MANAGER -documents.txt,953,0,10,ENGINEER -documents.txt,954,0,18,ENGINEER -documents.txt,955,0,15,MANAGER -documents.txt,956,25,37,MANAGER -documents.txt,957,0,15,ENGINEER -documents.txt,958,0,10,MANAGER -documents.txt,959,0,14,ENGINEER -documents.txt,960,0,18,ENGINEER -documents.txt,961,0,14,MANAGER -documents.txt,962,0,14,MANAGER -documents.txt,963,0,14,MANAGER -documents.txt,964,0,12,ENGINEER -documents.txt,965,0,19,MANAGER -documents.txt,966,0,17,ENGINEER -documents.txt,967,0,12,ENGINEER -documents.txt,968,0,15,MANAGER -documents.txt,969,0,17,ENGINEER -documents.txt,970,0,11,MANAGER -documents.txt,971,25,39,ENGINEER -documents.txt,972,0,12,ENGINEER -documents.txt,973,19,33,MANAGER -documents.txt,974,19,32,MANAGER -documents.txt,975,0,23,MANAGER -documents.txt,976,20,44,ENGINEER -documents.txt,977,0,13,ENGINEER -documents.txt,978,0,15,MANAGER -documents.txt,979,0,19,ENGINEER -documents.txt,980,0,12,MANAGER -documents.txt,981,25,40,MANAGER -documents.txt,982,0,12,ENGINEER -documents.txt,983,0,13,MANAGER -documents.txt,984,0,12,MANAGER -documents.txt,985,37,53,ENGINEER -documents.txt,986,25,38,ENGINEER -documents.txt,987,0,11,ENGINEER -documents.txt,988,37,50,ENGINEER -documents.txt,989,0,18,ENGINEER -documents.txt,990,20,35,ENGINEER -documents.txt,991,19,33,MANAGER +documents.txt,935,0,18,ENGINEER +documents.txt,936,0,22,MANAGER +documents.txt,937,25,39,MANAGER +documents.txt,938,0,15,ENGINEER +documents.txt,939,19,28,MANAGER +documents.txt,940,0,19,ENGINEER +documents.txt,941,0,15,MANAGER +documents.txt,942,0,15,ENGINEER +documents.txt,943,0,12,ENGINEER +documents.txt,944,0,16,ENGINEER +documents.txt,945,20,35,ENGINEER +documents.txt,946,36,51,MANAGER +documents.txt,947,20,41,ENGINEER +documents.txt,948,37,52,ENGINEER +documents.txt,949,0,14,ENGINEER +documents.txt,950,0,18,ENGINEER +documents.txt,951,0,15,MANAGER +documents.txt,952,0,14,ENGINEER +documents.txt,953,0,12,MANAGER +documents.txt,954,0,16,ENGINEER +documents.txt,955,25,42,MANAGER +documents.txt,956,0,15,ENGINEER +documents.txt,957,19,31,MANAGER +documents.txt,958,36,55,MANAGER +documents.txt,959,0,22,ENGINEER +documents.txt,960,0,13,MANAGER +documents.txt,961,0,15,ENGINEER +documents.txt,962,0,16,ENGINEER +documents.txt,963,0,16,MANAGER +documents.txt,964,0,14,ENGINEER +documents.txt,965,0,14,ENGINEER +documents.txt,966,0,15,ENGINEER +documents.txt,967,0,13,MANAGER +documents.txt,968,0,10,ENGINEER +documents.txt,969,0,10,MANAGER +documents.txt,970,0,10,MANAGER +documents.txt,971,0,22,MANAGER +documents.txt,972,37,50,ENGINEER +documents.txt,973,37,53,ENGINEER +documents.txt,974,0,17,ENGINEER +documents.txt,975,0,20,ENGINEER +documents.txt,976,0,19,ENGINEER +documents.txt,977,0,13,MANAGER +documents.txt,978,36,50,MANAGER +documents.txt,979,25,40,MANAGER +documents.txt,980,0,18,MANAGER +documents.txt,981,0,17,ENGINEER +documents.txt,982,37,55,ENGINEER +documents.txt,983,0,14,ENGINEER +documents.txt,984,0,11,MANAGER +documents.txt,985,0,14,ENGINEER +documents.txt,986,0,14,ENGINEER +documents.txt,987,25,42,MANAGER +documents.txt,988,20,36,ENGINEER +documents.txt,989,25,38,MANAGER +documents.txt,990,0,17,ENGINEER +documents.txt,991,0,18,MANAGER documents.txt,992,0,18,MANAGER -documents.txt,993,0,17,MANAGER -documents.txt,994,0,11,MANAGER -documents.txt,995,0,13,MANAGER -documents.txt,996,0,14,MANAGER -documents.txt,997,0,13,MANAGER -documents.txt,998,0,17,MANAGER -documents.txt,999,25,37,ENGINEER +documents.txt,993,0,13,MANAGER +documents.txt,994,0,16,ENGINEER +documents.txt,995,0,23,ENGINEER +documents.txt,996,0,12,MANAGER +documents.txt,997,0,16,MANAGER +documents.txt,998,0,16,MANAGER +documents.txt,999,0,17,ENGINEER diff --git a/internal/service/comprehend/test-fixtures/entity_recognizer/documents.txt b/internal/service/comprehend/test-fixtures/entity_recognizer/documents.txt index f68319e5bb7c..15470ccb972a 100644 --- a/internal/service/comprehend/test-fixtures/entity_recognizer/documents.txt +++ b/internal/service/comprehend/test-fixtures/entity_recognizer/documents.txt @@ -1,1000 +1,1000 @@ -Announcing manager Gerson Parker. -Nickolas Little is a manager. -Alejandra Stiedemann V has been an manager for over a decade. -Eunice Leannon will be the new manager for the team. -Sunny Schmitt is a engineer in the high tech industry. -Anika Gutkowski is a engineer with Example Corp. -Delaney Fisher is retiring as a engineer. -Our latest new employee, Christian Maggio, has been a engineer in the industry for 4 years. -Mathias Hettinger I is retiring as a manager. -Our latest new employee, Elias Quitzon, has been a manager in the industry for 4 years. -Alexandra Wunsch has been an manager for over a decade. -Guido Kemmer joins us as an engineer on the Example project. -Sim Kemmer is a manager with Example Corp. -Help me welcome our newest manager, Vincenza Kertzmann. -Announcing engineer Skye Kuhn Jr.. -Kasandra Cartwright MD is a manager in the high tech industry. -Ettie Schimmel is a manager. -Karlee McCullough Jr. will be the new manager for the team. -Adeline Johnson is a manager with Example Corp. -Cory Morissette has been an manager for over a decade. -Brandy Abshire joins us as an manager on the Example project. -Announcing engineer Jerome Homenick. -Announcing manager Ms. Doris Ziemann. -Help me welcome our newest engineer, Ms. Marlene Larkin. -Amos Kuhlman, an manager, will be presenting the award. -Ana Ortiz II has been a manager for 14 years. -Announcing manager Jewell Konopelski. -Larry Effertz has been a engineer for 14 years. -Ms. Vernice Fay has been an engineer for over a decade. -Miss Dion Ratke is a manager. -Rachelle Lubowitz has been an manager for over a decade. -Rachael Moore is a manager in the high tech industry. -Sabrina Walsh will be the new engineer for the team. -Our latest new employee, Tamara Nicolas, has been a manager in the industry for 4 years. -Our latest new employee, Martin Lynch Sr., has been a manager in the industry for 4 years. -Kaya Wisozk is a manager in the high tech industry. -Our latest new employee, Mrs. Cassandra Robel, has been a engineer in the industry for 4 years. -Donny Schroeder has been an manager for over a decade. -Emmanuel Fay is a manager with Example Corp. -Jefferey Adams will be the new engineer for the team. -Godfrey Feest V, an manager, will be presenting the award. -Melyna Mertz has been a manager for 14 years. -Audreanne Wiza is a manager with Example Corp. -Jarvis O'Conner is a manager. -Mertie Sanford joins us as an manager on the Example project. -Help me welcome our newest engineer, Keshaun Altenwerth. -Aric Beier Sr. is a engineer with Example Corp. -Hoyt Rowe MD is a engineer with Example Corp. -Announcing engineer Aurelia Hintz. -Our latest new employee, Keon Stanton, has been a manager in the industry for 4 years. -Candace Wiegand is a manager with Example Corp. -Flavio Smith is retiring as a manager. -Our latest new employee, Mr. Zachery Toy, has been a manager in the industry for 4 years. -Kaleigh Murazik has been a engineer for 14 years. -Help me welcome our newest engineer, Pattie Kuvalis. -Serena Heidenreich has been a engineer for 14 years. -Our latest new employee, Simone Little, has been a manager in the industry for 4 years. -Ms. Carolina Mante has been a engineer for 14 years. -Julia Lemke has been a manager for 14 years. -Mrs. Meagan Fisher has been an manager for over a decade. -Molly Goldner joins us as an engineer on the Example project. -Announcing manager Mrs. Dax McGlynn. -Tyrique Harber has been an engineer for over a decade. -Mia Larkin II joins us as an manager on the Example project. -Winona Schoen, an manager, will be presenting the award. -Announcing engineer Dr. Antonette Cummings. -Our latest new employee, Mr. Sonya Cassin, has been a manager in the industry for 4 years. -Timothy Bartoletti DDS has been a manager for 14 years. -Our latest new employee, Winifred Reinger, has been a engineer in the industry for 4 years. -Announcing engineer Marcella Bahringer. -Rhea Kohler is a engineer. -Help me welcome our newest engineer, Alia McCullough. -Mr. Israel Gulgowski is a engineer. -Our latest new employee, Jana Wilkinson, has been a engineer in the industry for 4 years. -Marjory Fay will be the new manager for the team. -Alena Mueller is a engineer with Example Corp. -Help me welcome our newest engineer, Kristian Keebler. -Katheryn Dietrich is a manager with Example Corp. -Mya Grady has been an manager for over a decade. -Our latest new employee, Kyra Heidenreich V, has been a engineer in the industry for 4 years. -Announcing manager Dr. Cortez Thiel. -Shyanne Hirthe has been an engineer for over a decade. -Announcing engineer Herta Mohr. -Winfield Thompson is a engineer in the high tech industry. -Help me welcome our newest manager, Miss Bette Dooley. -Mrs. Freida Shanahan has been an engineer for over a decade. -Sunny Towne is a manager in the high tech industry. -Kayley Schneider joins us as an engineer on the Example project. -Announcing manager Anderson Hagenes. -Barrett Paucek Jr. is a manager. -Lillian Koss, an engineer, will be presenting the award. -Announcing engineer Lance Zieme. -Announcing engineer Van Hackett. -Cullen Schamberger is a engineer in the high tech industry. -Arvel Stanton joins us as an manager on the Example project. -Our latest new employee, Nedra Goldner, has been a manager in the industry for 4 years. -Ms. Zetta Lindgren is a manager in the high tech industry. -Help me welcome our newest engineer, Faye Ledner. -Trystan Hilll PhD has been an manager for over a decade. -Arnold Hermann Jr. will be the new engineer for the team. -Hank Towne is a manager in the high tech industry. -Monroe Schmeler has been a manager for 14 years. -Genesis Wintheiser II will be the new engineer for the team. -Angie O'Reilly has been an manager for over a decade. -Deshawn Reinger is a manager in the high tech industry. -Announcing engineer Mrs. Molly Lowe. -Kimberly Osinski is a manager in the high tech industry. -Napoleon Sauer is a engineer in the high tech industry. -Leonardo Champlin is a manager. -Anita Bartell is a manager in the high tech industry. -Mrs. Jennifer Buckridge has been a manager for 14 years. -Patrick Gulgowski is a manager with Example Corp. -Miss Brooks Christiansen, an manager, will be presenting the award. -Help me welcome our newest engineer, Ms. Alejandra Shields. -Callie Lynch will be the new engineer for the team. -Hyman Bruen will be the new engineer for the team. -Ms. Lera Grant, an engineer, will be presenting the award. -Help me welcome our newest manager, Laney West V. -Shyanne Price is a engineer. -Leanna Schoen is a engineer in the high tech industry. -Announcing engineer Clement Bayer. -Mrs. Colt Kozey is retiring as a manager. -Dr. Logan Dickinson will be the new engineer for the team. -Valentin Torp has been a manager for 14 years. -Kathlyn Bechtelar, an manager, will be presenting the award. -Vita Pollich has been a engineer for 14 years. -Benedict Flatley is a manager with Example Corp. -Our latest new employee, Dedrick Corkery V, has been a manager in the industry for 4 years. -Our latest new employee, Shea Kohler, has been a engineer in the industry for 4 years. -Tiana Mertz is a engineer in the high tech industry. -Margarett Kunze has been a engineer for 14 years. -Announcing manager Alan Bashirian. -Dr. Precious Murazik has been an manager for over a decade. -Ms. Karine Langosh has been a engineer for 14 years. -Help me welcome our newest engineer, Letha Skiles. -Help me welcome our newest engineer, Nikko Dooley. -Announcing engineer Filomena McKenzie. -Rosario Grant Sr., an engineer, will be presenting the award. -Gonzalo Douglas V, an engineer, will be presenting the award. -Lempi Pollich will be the new engineer for the team. -Help me welcome our newest engineer, Candida O'Reilly Sr.. -Dena Lind is a engineer with Example Corp. -Blair Renner is a manager with Example Corp. -Imani Roob joins us as an manager on the Example project. -Miss Drake Johns will be the new manager for the team. -Announcing manager Murl Jacobi. -Announcing manager Nicolette Prohaska. -Leif Quigley is a manager with Example Corp. -Hugh Gleichner III has been an manager for over a decade. -Neil Witting is a manager. -Ivah Moore is a engineer in the high tech industry. -Amira Bruen is retiring as a engineer. -Help me welcome our newest engineer, Loy Kerluke. -Our latest new employee, Cleta Berge, has been a manager in the industry for 4 years. -Asa Schaden has been a engineer for 14 years. -Announcing engineer Marlin Nitzsche. -Mellie Hansen has been an engineer for over a decade. -Pauline Willms has been an manager for over a decade. -Giovanna Marquardt is a manager in the high tech industry. -Kristian Conroy IV has been a manager for 14 years. -Announcing engineer Aiyana Hagenes. -Our latest new employee, Melisa Barton Jr., has been a manager in the industry for 4 years. -Help me welcome our newest manager, Robbie Bechtelar. -Citlalli Lind joins us as an engineer on the Example project. -Karlee Lubowitz is a manager in the high tech industry. -Isidro Jerde is a engineer with Example Corp. -Conor Lemke joins us as an manager on the Example project. -Murphy Rutherford joins us as an manager on the Example project. -Omari Schultz has been an manager for over a decade. -Selmer Labadie is a manager in the high tech industry. -Alverta Hilpert, an manager, will be presenting the award. -Our latest new employee, Ali Dooley III, has been a engineer in the industry for 4 years. -Benjamin Lubowitz is a manager. -Trenton Hilll will be the new manager for the team. -Bethel Carroll, an engineer, will be presenting the award. -Nick Lang will be the new manager for the team. -Ms. Chase Graham has been an manager for over a decade. -Announcing engineer Melany Buckridge PhD. -Ursula McGlynn joins us as an engineer on the Example project. -Jackie Kshlerin is a manager. -Jarvis Langosh is a engineer. -Bonnie Bednar will be the new manager for the team. -Announcing engineer Simeon Dickinson. -Annamarie VonRueden MD has been an manager for over a decade. -Ms. Hilton Hagenes has been an engineer for over a decade. -Jaqueline D'Amore has been an manager for over a decade. -Mario Bartell will be the new manager for the team. -Frances Kovacek has been an manager for over a decade. -Help me welcome our newest manager, Avery Lakin. -Brittany Flatley DDS, an engineer, will be presenting the award. -Violette Sauer has been an manager for over a decade. -Dorothy Farrell is a engineer in the high tech industry. -Miss Jordan Crooks is a manager in the high tech industry. -Jadyn West joins us as an manager on the Example project. -Mrs. Johanna Borer is a engineer with Example Corp. -Elyssa Crist joins us as an engineer on the Example project. -Our latest new employee, Carli Kohler, has been a manager in the industry for 4 years. -Dasia Dare has been a engineer for 14 years. -Lane Rath has been an manager for over a decade. -Davion Kunze, an engineer, will be presenting the award. -Vada Stoltenberg, an engineer, will be presenting the award. -London Hagenes has been an engineer for over a decade. -Albin Wintheiser will be the new manager for the team. -Help me welcome our newest engineer, Mr. Eloise Jones. -Rashawn Bechtelar is a manager with Example Corp. -Linwood Casper, an engineer, will be presenting the award. -Our latest new employee, Mr. Phyllis O'Reilly, has been a manager in the industry for 4 years. -Carrie Franecki is a manager in the high tech industry. -Our latest new employee, Mikel Daugherty I, has been a manager in the industry for 4 years. -Announcing manager Jorge Connelly IV. -Victor Cummings is a manager with Example Corp. -Felton Kris has been a manager for 14 years. -Barney Klein is a manager with Example Corp. -Help me welcome our newest manager, Verdie Strosin. -Announcing engineer Izabella Vandervort DDS. -Philip Hodkiewicz has been an manager for over a decade. -Mr. Carol Orn, an manager, will be presenting the award. -Ursula Cormier is a manager. -Ellen Hudson is retiring as a engineer. -Bobby Conn II has been an engineer for over a decade. -Announcing engineer Mathilde Bayer. -Ms. Marcus Ferry has been an engineer for over a decade. -Our latest new employee, Tyshawn Volkman, has been a manager in the industry for 4 years. -Our latest new employee, Ladarius Predovic, has been a engineer in the industry for 4 years. -Our latest new employee, Ally Parisian, has been a manager in the industry for 4 years. -Briana Reinger joins us as an manager on the Example project. -Piper Kutch has been a manager for 14 years. -Armand Ratke is a manager with Example Corp. -Stephon McLaughlin DDS joins us as an engineer on the Example project. -Cordell Cole is a engineer with Example Corp. -Earl Altenwerth is retiring as a engineer. -Our latest new employee, Garrison Lang Jr., has been a manager in the industry for 4 years. -Ahmad Heaney, an engineer, will be presenting the award. -Jed Pollich has been a manager for 14 years. -Help me welcome our newest manager, Hudson Wyman. -Dena Crist DVM has been an engineer for over a decade. -Help me welcome our newest manager, Gino Auer III. -Help me welcome our newest manager, Miss Xavier Farrell. -Announcing engineer Lawrence Considine. -Coby Lesch is a engineer in the high tech industry. -Hardy Mohr joins us as an manager on the Example project. -Dr. Tamara Ryan is retiring as a manager. -Alia Quigley PhD, an engineer, will be presenting the award. -Noelia Bergnaum is a engineer with Example Corp. -Dakota Brown is a engineer. -Elmo Rogahn is a engineer. -Roxanne Weimann joins us as an manager on the Example project. -Gay Langworth is a manager in the high tech industry. -Ellis Ledner joins us as an engineer on the Example project. -Weston Murazik will be the new engineer for the team. -Our latest new employee, Josefa Sauer, has been a manager in the industry for 4 years. -Our latest new employee, Ilene Wyman, has been a manager in the industry for 4 years. -Nia Gottlieb, an manager, will be presenting the award. -Our latest new employee, Crawford Wehner, has been a manager in the industry for 4 years. -Our latest new employee, Brenna Ritchie, has been a manager in the industry for 4 years. -Ms. Mariah Hudson joins us as an manager on the Example project. -Tyra Schneider Sr. has been an manager for over a decade. -Help me welcome our newest manager, Andreane Johns. -Help me welcome our newest engineer, Mrs. Mabel Rice. -Emelia Jaskolski PhD is a engineer. -Spencer Cole II is a engineer in the high tech industry. -Help me welcome our newest manager, Doris Stokes. -Lilian Erdman has been a engineer for 14 years. -Ms. Ramona Torp is retiring as a manager. -Ms. Lauryn Stark, an manager, will be presenting the award. -Israel Greenholt will be the new engineer for the team. -Ms. Boris Leannon is a manager with Example Corp. -Help me welcome our newest manager, Pearlie Swaniawski. -Delores Kilback joins us as an manager on the Example project. -Mariam Schultz is a engineer in the high tech industry. -Dimitri Mueller IV is a manager with Example Corp. -Maud Beahan will be the new manager for the team. -Fletcher Predovic DVM, an engineer, will be presenting the award. -Mrs. Joanne Aufderhar will be the new engineer for the team. -Miss Paul Lowe is retiring as a engineer. -Johnpaul Swift has been an manager for over a decade. -Miss Rowena Pouros is a engineer. -Benjamin Jenkins is a engineer. -Erwin Jenkins will be the new manager for the team. -Ms. Zula Turner, an engineer, will be presenting the award. -Rhiannon Lind is retiring as a manager. -Mrs. Garth Labadie will be the new manager for the team. -Mia King is a manager in the high tech industry. -Ewald Cronin is a engineer with Example Corp. -Carrie Roob III has been an manager for over a decade. -Help me welcome our newest manager, Clementina Schmeler. -Stewart Sipes II has been an engineer for over a decade. -Our latest new employee, Katelin D'Amore, has been a manager in the industry for 4 years. -Announcing manager Verlie Wiegand. -Marie Schaefer is a engineer with Example Corp. -Tillman Boehm is a engineer in the high tech industry. -Announcing manager Jacklyn Kohler. -Katrine Bruen will be the new manager for the team. -Our latest new employee, Lisa Gaylord, has been a engineer in the industry for 4 years. -Virginia Ruecker, an engineer, will be presenting the award. -Mrs. Garnett Christiansen joins us as an engineer on the Example project. -Anderson Weissnat has been an engineer for over a decade. -Help me welcome our newest engineer, Marie Armstrong. -Help me welcome our newest engineer, Prudence Fahey V. -Bria Medhurst will be the new manager for the team. -Announcing engineer Ms. Dewitt Bernhard. -Stanford Miller has been a manager for 14 years. -Freddie Treutel, an manager, will be presenting the award. -Oceane Bayer has been an manager for over a decade. -Ms. Adalberto Lindgren joins us as an manager on the Example project. -Our latest new employee, Meagan Bartoletti, has been a manager in the industry for 4 years. -Wilhelm Kutch, an engineer, will be presenting the award. -Our latest new employee, Khalid Farrell Sr., has been a manager in the industry for 4 years. -Help me welcome our newest engineer, Ms. Allison Zemlak. -Judson Rodriguez MD is a manager with Example Corp. -Help me welcome our newest manager, Mr. Alena Stanton. -Kaylin Kohler has been a engineer for 14 years. -Melany Price is a engineer with Example Corp. -Palma Brekke is a manager. -Help me welcome our newest manager, Ozella Larson. -Earnestine Sanford will be the new engineer for the team. -Kathryne Tromp has been an engineer for over a decade. -Ted Abernathy is a manager with Example Corp. -Our latest new employee, Nelle Waters, has been a engineer in the industry for 4 years. -Help me welcome our newest engineer, Dawn Kautzer. -Ms. Itzel Breitenberg has been an engineer for over a decade. -Meta Gibson is a manager in the high tech industry. -Haven Nitzsche joins us as an engineer on the Example project. -Our latest new employee, Antonetta Kilback I, has been a manager in the industry for 4 years. -Kiara Zboncak joins us as an manager on the Example project. -Our latest new employee, Leola Kris, has been a engineer in the industry for 4 years. -Our latest new employee, Mr. Conrad Hills, has been a manager in the industry for 4 years. -Alize Rogahn has been a engineer for 14 years. -Rudy Hamill is a manager in the high tech industry. -Ms. Celestino Turcotte joins us as an manager on the Example project. -Ms. Annetta Stracke has been an manager for over a decade. -Hailie Hudson is a engineer. -Mrs. Deven Moen joins us as an manager on the Example project. -Callie Larson is a manager with Example Corp. -Quentin Morar joins us as an engineer on the Example project. -Our latest new employee, Antonietta Kuhlman II, has been a manager in the industry for 4 years. -Announcing manager Cristal Shanahan DVM. -Cristopher Boyer joins us as an engineer on the Example project. -Keely Larkin joins us as an engineer on the Example project. -Royce Berge is a engineer with Example Corp. -Announcing engineer Benjamin Hilll. -Rashawn Bogan is retiring as a manager. -Ted Collier has been a manager for 14 years. -Alene Corwin has been an manager for over a decade. -David Hodkiewicz is a manager with Example Corp. -Garland Kuhic has been an manager for over a decade. -Sonya Wilderman is a manager. -Quinn Bradtke Jr. is a manager with Example Corp. -Help me welcome our newest engineer, Ellen Cummerata. -Mason Beatty, an manager, will be presenting the award. -Help me welcome our newest manager, Camylle Muller. -Hadley Upton has been a engineer for 14 years. -Keara Pfeffer is a engineer with Example Corp. -Angie Walsh is retiring as a manager. -Help me welcome our newest manager, Earl Cummings. -Ephraim Marks is retiring as a engineer. -Orval Reichert DDS is a engineer. -Help me welcome our newest engineer, Katheryn Gleichner. -Announcing engineer Jalyn Fay I. -Virginia Keebler DVM is retiring as a engineer. -Raphael Leffler is a engineer. -Juliana Stokes is a manager with Example Corp. -Casper Herman is a manager in the high tech industry. -Announcing manager Vladimir Reilly. -Erin Okuneva has been an manager for over a decade. -Martine White is retiring as a manager. -Tristian Mertz is a manager. -Mr. Sammy Schmitt is a engineer with Example Corp. -Alec Schuster joins us as an manager on the Example project. -Ms. Lorenza Walsh will be the new engineer for the team. -Help me welcome our newest engineer, Eldora Mayert. -Justina Breitenberg will be the new manager for the team. -Our latest new employee, Mariela Grady Jr., has been a engineer in the industry for 4 years. -Kevon Baumbach, an manager, will be presenting the award. -Our latest new employee, Wendell Hayes, has been a engineer in the industry for 4 years. -Pat Aufderhar is a engineer with Example Corp. -Bart Senger joins us as an manager on the Example project. -Kaitlyn Hahn is a engineer. -Our latest new employee, Mrs. Else Kozey, has been a manager in the industry for 4 years. -Mr. Ashton Batz will be the new engineer for the team. -Lilly Koepp has been a engineer for 14 years. -Mrs. Alfredo Cormier has been a manager for 14 years. -Gail Swaniawski DVM is a engineer. -Mrs. Valentina Wilderman has been an engineer for over a decade. -Paxton Doyle is a engineer in the high tech industry. -Jarret Block PhD joins us as an manager on the Example project. -Arnaldo Blanda joins us as an manager on the Example project. -Aiden Orn has been an manager for over a decade. -Florine West is a manager. -Help me welcome our newest manager, Sincere Harber. -Announcing engineer Joan Ziemann. -Katelyn Schultz has been an engineer for over a decade. -Maximus Gleichner is a manager in the high tech industry. -Announcing manager Elenor Schuster. -Marcelino Kautzer will be the new engineer for the team. -Lea Schulist Sr. has been a engineer for 14 years. -Jeanne Carter MD is a manager in the high tech industry. -Kayleigh Goldner DDS is a engineer in the high tech industry. -Hilario Denesik I is a manager with Example Corp. -Shirley Reichert has been a manager for 14 years. -Kris Dickens is a engineer. -Gene Frami, an manager, will be presenting the award. -Sadye Jacobson is a manager in the high tech industry. -Buck Cremin joins us as an engineer on the Example project. -Our latest new employee, Coty Lesch, has been a engineer in the industry for 4 years. -Dr. Kim Mertz has been an engineer for over a decade. -Randy Sanford will be the new manager for the team. -Help me welcome our newest manager, Levi Kirlin. -Announcing engineer Davin Yundt. -Help me welcome our newest engineer, Enola Bins. -Trent Kuvalis, an engineer, will be presenting the award. -Announcing engineer Jake Powlowski. -Ms. Ashlee Emmerich, an manager, will be presenting the award. -Hannah Davis, an engineer, will be presenting the award. -Wayne Champlin joins us as an engineer on the Example project. -Nikki Conn Jr. is a manager. -Announcing engineer Carli Bauch. -Norbert Feest is a manager in the high tech industry. -Robbie Wintheiser has been an engineer for over a decade. -Leta Abshire is a engineer in the high tech industry. -Fannie Walker is a engineer. -Heber Wilkinson is a manager with Example Corp. -Announcing manager Willie Bernier III. -Help me welcome our newest engineer, Orlando Price. -Brandt Schowalter is a manager. -Mohammed Stokes is retiring as a engineer. -Isai Mraz is a engineer in the high tech industry. -Kadin Lemke will be the new manager for the team. -Maribel Jerde has been an manager for over a decade. -Myrna Kessler is a manager. -Meredith Tremblay is retiring as a engineer. -Announcing engineer Mr. Jerad Schneider. -Announcing manager Lenny Pfeffer. -Carolyne Klocko DVM will be the new manager for the team. -Our latest new employee, Monica Schulist, has been a engineer in the industry for 4 years. -Anika Larson V is a manager. -Domenick Pacocha is retiring as a engineer. -Miss Harmon Pfannerstill has been a engineer for 14 years. -Announcing manager Mr. Annabell Pouros. -Dr. Brisa Stroman has been an manager for over a decade. -Help me welcome our newest manager, Jade Stoltenberg. -Miss Mario Wolff joins us as an engineer on the Example project. -Ms. Savannah Gaylord is retiring as a manager. -Dejah Jones, an manager, will be presenting the award. -Hector Kulas, an manager, will be presenting the award. -Graciela Goodwin will be the new manager for the team. -Jocelyn Sauer is a manager. -Miss Lew Hansen will be the new manager for the team. -Fannie Fay DDS is a engineer with Example Corp. -Dr. Jordan Klocko is a engineer with Example Corp. -Kathlyn Lynch is a manager in the high tech industry. -Leann Botsford has been an engineer for over a decade. -Ervin Larson has been a manager for 14 years. -Allie Von is a manager in the high tech industry. -Johanna Kohler III has been a manager for 14 years. -Our latest new employee, Hilbert Armstrong, has been a engineer in the industry for 4 years. -Tanner Balistreri IV has been an manager for over a decade. -Abagail Shields has been an engineer for over a decade. -Help me welcome our newest engineer, Gia Cremin. -Mrs. Buford Oberbrunner is retiring as a engineer. -Madelyn White is retiring as a manager. -Announcing manager Abdullah Effertz. -Reva Stark will be the new engineer for the team. -Camryn McKenzie will be the new manager for the team. -Juwan Pouros will be the new manager for the team. -Gene Cassin is a manager in the high tech industry. -Our latest new employee, Felicia Kunde, has been a engineer in the industry for 4 years. -Our latest new employee, Jeremie Anderson, has been a manager in the industry for 4 years. -Our latest new employee, Katheryn Hickle Jr., has been a manager in the industry for 4 years. -Our latest new employee, Edwina Hamill IV, has been a manager in the industry for 4 years. -Adriana Cassin DVM has been a manager for 14 years. -Nelda Rowe joins us as an engineer on the Example project. -Rodrigo Kulas V joins us as an engineer on the Example project. -Jaiden Williamson is a manager in the high tech industry. -Announcing manager Cristopher Williamson. -Mr. Jay Krajcik, an engineer, will be presenting the award. -Announcing manager Francesco Miller. -Brenna Reinger, an manager, will be presenting the award. -Mr. Mollie Stanton has been an manager for over a decade. -Coby Schowalter has been a engineer for 14 years. -Our latest new employee, Estefania Armstrong II, has been a manager in the industry for 4 years. -Announcing engineer Aimee Nienow. -Kimberly Batz will be the new engineer for the team. -Miss Sienna Pfannerstill is retiring as a engineer. -Johnathon Hammes is retiring as a engineer. -Julien Hansen is a manager in the high tech industry. -Mrs. Emerson Waelchi will be the new manager for the team. -Malcolm Streich is a manager with Example Corp. -Aurelio Lebsack is retiring as a engineer. -Juana Grady has been a engineer for 14 years. -Kiel Lakin is a manager in the high tech industry. -Our latest new employee, Sarai Keeling, has been a engineer in the industry for 4 years. -Emilia Crona has been a engineer for 14 years. -Georgianna Kris is a manager in the high tech industry. -Maida Heller is retiring as a manager. -Jena Feeney is a engineer with Example Corp. -Mabelle Keeling has been an manager for over a decade. -Chris Bergstrom has been an engineer for over a decade. -Our latest new employee, Audrey Block DDS, has been a engineer in the industry for 4 years. -Our latest new employee, Louvenia Kuhn, has been a engineer in the industry for 4 years. -Thomas O'Keefe has been a manager for 14 years. -Our latest new employee, Darby Klocko, has been a manager in the industry for 4 years. -Arlene Weimann, an manager, will be presenting the award. -Our latest new employee, Corbin Jones MD, has been a engineer in the industry for 4 years. -Lamar Mraz joins us as an engineer on the Example project. -Miss Onie Krajcik is a manager with Example Corp. -Kamille Schaefer, an manager, will be presenting the award. -Jack Borer, an engineer, will be presenting the award. -Reese Heaney has been a manager for 14 years. -Ilene Kovacek will be the new engineer for the team. -Trace Bailey will be the new engineer for the team. -Our latest new employee, Wava Donnelly, has been a engineer in the industry for 4 years. -Mona Lakin has been a manager for 14 years. -Weldon Heaney joins us as an manager on the Example project. -Norris Labadie has been a engineer for 14 years. -Bridgette Brown has been an manager for over a decade. -Osborne Kertzmann is a manager with Example Corp. -Announcing engineer Verlie Bruen. -Enrique Ullrich is a engineer with Example Corp. -Dr. Asia Purdy joins us as an engineer on the Example project. -Announcing manager Lindsey Predovic DDS. -Maxine Mosciski is retiring as a manager. -Sydni Stoltenberg is retiring as a engineer. -Paige Buckridge will be the new engineer for the team. -Miss Laverne Dach has been an manager for over a decade. -Murl Abshire is a manager in the high tech industry. -Lou Friesen is retiring as a manager. -Announcing engineer Keenan Fahey. -Ashleigh Schultz, an engineer, will be presenting the award. -Mrs. Keshaun Lesch has been an engineer for over a decade. -Announcing engineer Jeffrey Langosh. -Mckenzie Boyle, an engineer, will be presenting the award. -Hipolito Price PhD joins us as an manager on the Example project. -Lesley Adams III joins us as an engineer on the Example project. -Mya Howe is a engineer with Example Corp. -Nick Kutch Sr. has been a manager for 14 years. -Our latest new employee, Ms. Winfield Wilkinson, has been a engineer in the industry for 4 years. -Leopold Schulist is a engineer with Example Corp. -Announcing engineer Orval Prosacco. -Wilmer Mueller has been an manager for over a decade. -Karina Batz has been a manager for 14 years. -Our latest new employee, Luigi Abbott, has been a manager in the industry for 4 years. -Pamela Miller is a manager in the high tech industry. -Emelie Marquardt is a engineer with Example Corp. -Zola Beier is a manager in the high tech industry. -Mr. Elva Ritchie joins us as an engineer on the Example project. -Mrs. Otis Quitzon is a manager in the high tech industry. -Our latest new employee, Dr. Willow Jacobs, has been a manager in the industry for 4 years. -Cathryn Koss joins us as an manager on the Example project. -Ms. Alivia Ernser is retiring as a manager. -Timothy Mohr is a engineer. -Mrs. Jaylan Wuckert is retiring as a manager. -Emerald Waelchi is a engineer. -Vernon Heathcote is retiring as a manager. -Announcing engineer Lavinia Ruecker. -Mr. Quinn Altenwerth is retiring as a manager. -Alejandra Marks, an manager, will be presenting the award. -Mr. Leo Wuckert has been an manager for over a decade. -Jayce Schiller MD is a manager in the high tech industry. -Elenora Ebert Jr. will be the new engineer for the team. -Announcing manager Dr. Rose Wyman. -Help me welcome our newest manager, Wade Orn. -Iva Marks Sr., an manager, will be presenting the award. -Margaret Pouros will be the new manager for the team. -Barton Deckow has been an manager for over a decade. -Miss Lesly Balistreri will be the new engineer for the team. -Mr. Jacquelyn Reynolds joins us as an engineer on the Example project. -Announcing manager Doyle Heidenreich. -Announcing engineer Heidi Ruecker. -Mr. Alvis Moen joins us as an manager on the Example project. -Dr. Garnet Brown is a engineer. -Yolanda Beier is a engineer with Example Corp. -Soledad Macejkovic joins us as an engineer on the Example project. -Urban Lowe has been a engineer for 14 years. -Devyn Schmidt has been an manager for over a decade. -Barbara Flatley is a manager in the high tech industry. -Patsy Sanford PhD has been an engineer for over a decade. -Mrs. Rubye Blanda is a engineer. -Caleigh Klocko is a engineer. -Kali Dietrich has been an manager for over a decade. -Ms. Weldon Hudson is retiring as a engineer. -Help me welcome our newest engineer, Vallie Huel. -Sven O'Keefe III joins us as an engineer on the Example project. -Help me welcome our newest engineer, Gerardo Wehner Sr.. -Kyle Kirlin is a manager in the high tech industry. -Help me welcome our newest engineer, Marianne Berge Jr.. -Ms. Cristal Connelly is retiring as a manager. -Kailey Spinka has been an manager for over a decade. -Jeremie Morar has been an manager for over a decade. -Our latest new employee, Daija Lind, has been a engineer in the industry for 4 years. -Arvel McDermott is a engineer. -Dr. Nicholas Gorczany has been a manager for 14 years. -Anne Leuschke has been a manager for 14 years. -Gerda Cronin has been a engineer for 14 years. -Ms. Coty Rolfson is retiring as a engineer. -Announcing engineer Kareem Gerhold. -Announcing engineer Mrs. Nico Mann. -Corbin Bartell is a engineer in the high tech industry. -Theresa Gulgowski will be the new manager for the team. -Carmelo Boyer is retiring as a manager. -Elinore Schulist III joins us as an manager on the Example project. -Katarina Schultz joins us as an manager on the Example project. -Deven Rodriguez II is a manager in the high tech industry. -Miss Bruce Friesen is a manager in the high tech industry. -Marcelle Schowalter joins us as an manager on the Example project. -Albertha Murphy PhD has been an manager for over a decade. -Elmore Doyle is a engineer. -Our latest new employee, Reymundo Jaskolski, has been a engineer in the industry for 4 years. -Stephania Swaniawski I joins us as an manager on the Example project. -Stewart Veum has been an manager for over a decade. -Help me welcome our newest manager, Nathanael Bartell. -Retha Rempel is a engineer. -Isidro Aufderhar joins us as an manager on the Example project. -Florencio Mohr, an manager, will be presenting the award. -Zella Weimann is a engineer with Example Corp. -Khalid Macejkovic will be the new engineer for the team. -Our latest new employee, Geraldine Torp, has been a engineer in the industry for 4 years. -Presley Marks will be the new engineer for the team. -Mrs. Eve Bartoletti is retiring as a engineer. -Corine Schimmel, an manager, will be presenting the award. -Citlalli Goldner DDS, an manager, will be presenting the award. -Zakary Botsford, an manager, will be presenting the award. -Florida Reilly is retiring as a engineer. -Mr. Patsy Doyle joins us as an manager on the Example project. -Help me welcome our newest engineer, Emily Hayes II. -Dr. Johann Turcotte will be the new engineer for the team. -Dr. Darion Dietrich is a engineer in the high tech industry. -Norris Brekke is a manager in the high tech industry. -Janessa Marquardt joins us as an manager on the Example project. -Felicita Wintheiser MD has been an manager for over a decade. -Melyssa Muller, an engineer, will be presenting the award. -Vivienne Weissnat DDS has been a engineer for 14 years. -Ford Gerlach is a engineer. -Keenan Kertzmann is a engineer in the high tech industry. -Tobin Goyette joins us as an engineer on the Example project. -Help me welcome our newest manager, Cecilia Green. -Abe Fisher has been an manager for over a decade. -Mrs. Annabell Morissette is a manager. -Announcing manager Danny Kautzer III. -Gerard Cruickshank joins us as an engineer on the Example project. -Joy Okuneva DDS, an manager, will be presenting the award. -Ezequiel Macejkovic joins us as an engineer on the Example project. -Vernie Bradtke IV, an engineer, will be presenting the award. -Trycia Muller is a engineer. -Clotilde Ankunding is a engineer in the high tech industry. -Mr. Chaya Abshire, an engineer, will be presenting the award. -Announcing manager Hanna Roob. -Ronny Dietrich will be the new engineer for the team. -Derek Durgan DVM will be the new manager for the team. -Demetrius West will be the new manager for the team. -Macey Nikolaus is retiring as a manager. -Edison Gottlieb III is a manager in the high tech industry. -Bo Collins is a engineer with Example Corp. -Michaela Pagac PhD has been a manager for 14 years. -Mireille Kunde I is a engineer with Example Corp. -Duncan Kulas will be the new manager for the team. -Mrs. Xzavier Smitham is a engineer with Example Corp. -Announcing manager Mr. Adrianna Baumbach. -Shad Rolfson is a manager with Example Corp. -Mr. Dimitri Baumbach, an manager, will be presenting the award. -Our latest new employee, Samara Schultz, has been a manager in the industry for 4 years. -Mrs. Brant Kautzer is a manager in the high tech industry. -Tierra Greenholt is a engineer. -Our latest new employee, Otho Kub, has been a manager in the industry for 4 years. -Ana Harber will be the new manager for the team. -Our latest new employee, Ted Mertz Sr., has been a engineer in the industry for 4 years. -Uriel Zieme will be the new manager for the team. -Mr. Adaline Wolff has been an engineer for over a decade. -Help me welcome our newest manager, Mrs. Maurice Senger. -Ada Gleason has been an manager for over a decade. -Edwina Bernier DVM has been an engineer for over a decade. -Elva Homenick is retiring as a engineer. -Our latest new employee, Mrs. Shane Powlowski, has been a manager in the industry for 4 years. -Obie Nikolaus has been a manager for 14 years. -Ottis Jakubowski is a manager. -Mr. Armand Leannon is a engineer in the high tech industry. -Jaime Kuvalis joins us as an engineer on the Example project. -Help me welcome our newest engineer, Loyce VonRueden Jr.. -Evangeline Johns joins us as an manager on the Example project. -Federico Halvorson is a manager in the high tech industry. -Sylvester Gerlach is a manager in the high tech industry. -Our latest new employee, Ashly Wunsch V, has been a manager in the industry for 4 years. -Rowland Miller joins us as an manager on the Example project. -Bryon Kunde has been a manager for 14 years. -Denis Ernser has been an engineer for over a decade. -Jovanny O'Reilly DVM is a engineer with Example Corp. -Lazaro Hermiston is retiring as a manager. -Kelly Stehr is a engineer. -Oda Fadel is a engineer with Example Corp. -Percival Armstrong is a engineer. -Caleigh Schimmel joins us as an manager on the Example project. -Tyrique Pfeffer has been a engineer for 14 years. -Adell Leuschke is retiring as a engineer. -Dr. Cade Farrell will be the new engineer for the team. -Gisselle Doyle is retiring as a manager. -Lily Reinger will be the new manager for the team. -Jeffrey Gleason has been a engineer for 14 years. -Tad Huel, an engineer, will be presenting the award. -Connor Conn joins us as an manager on the Example project. -Mr. Cathrine Casper is a engineer with Example Corp. -Our latest new employee, Dr. Beryl Rempel, has been a manager in the industry for 4 years. -Carlie Steuber joins us as an manager on the Example project. -Rose Frami IV is a engineer. -Mr. Tyrel Pagac joins us as an manager on the Example project. -Our latest new employee, Morton Trantow, has been a engineer in the industry for 4 years. -Lola Ortiz has been an manager for over a decade. -Kelton Champlin has been a manager for 14 years. -Our latest new employee, Owen Mayert, has been a engineer in the industry for 4 years. -Johnny Witting joins us as an manager on the Example project. -Thea Rolfson will be the new manager for the team. -Reanna Schmidt has been an engineer for over a decade. -Help me welcome our newest manager, Ian Stehr. -Mr. Patsy Purdy will be the new manager for the team. -Brady Ritchie will be the new engineer for the team. -Our latest new employee, Thea Effertz, has been a manager in the industry for 4 years. -Gerry Veum has been a engineer for 14 years. -Corene Adams is retiring as a manager. -Julian Kutch has been a manager for 14 years. -Mrs. Joe Connelly is a engineer. -Announcing manager Adolphus Paucek. -Jasmin Ledner II is a engineer with Example Corp. -Dr. Osbaldo Beatty will be the new engineer for the team. -Dr. Mckenna Haag is a manager with Example Corp. -Help me welcome our newest engineer, Abdiel Connelly DVM. -Help me welcome our newest manager, Liliana Baumbach III. -Willard Kuvalis V is retiring as a engineer. -Carolyn Jaskolski Jr., an manager, will be presenting the award. -Reta Franecki is retiring as a engineer. -Percival O'Kon has been an engineer for over a decade. -Kamryn Rath is a manager with Example Corp. -Hailey Dooley is a manager in the high tech industry. -Mrs. Brycen West has been an engineer for over a decade. -Margarette Miller will be the new manager for the team. -Our latest new employee, Cristian Pagac, has been a manager in the industry for 4 years. -Rosalee Bechtelar, an manager, will be presenting the award. -Help me welcome our newest manager, Lessie Lesch. -Iva Hegmann joins us as an manager on the Example project. -Hallie Schroeder is a manager. -Mr. Lola Volkman is a engineer in the high tech industry. -Arianna Wolf DDS has been an manager for over a decade. -Elliot Trantow has been a manager for 14 years. -Darrion Rath PhD has been a engineer for 14 years. -Coralie Effertz V has been an engineer for over a decade. -Our latest new employee, Ms. Corrine Effertz, has been a engineer in the industry for 4 years. -Our latest new employee, Ellie Keebler, has been a engineer in the industry for 4 years. -Tyrese Pfeffer is a engineer in the high tech industry. -Announcing manager Jayce Roberts. -Isobel Veum is retiring as a engineer. -Raphaelle Breitenberg is retiring as a engineer. -Maudie Labadie I has been an engineer for over a decade. -Rosario Langosh MD has been a engineer for 14 years. -Raheem Mohr joins us as an manager on the Example project. -Avery Lind joins us as an engineer on the Example project. -Nichole Waters has been a engineer for 14 years. -Blaise Gislason I has been a manager for 14 years. -Everette D'Amore has been a engineer for 14 years. -Darwin Conroy is a manager in the high tech industry. -Abdullah Heathcote is retiring as a engineer. -Burnice Treutel has been an manager for over a decade. -Libbie O'Hara is a engineer with Example Corp. -Rowan Will has been an manager for over a decade. -Gudrun Gleason is retiring as a engineer. -Our latest new employee, Fannie Quitzon, has been a manager in the industry for 4 years. -Help me welcome our newest engineer, Terence Gutkowski. -Tyshawn Rowe is a manager. -Jaylan Sanford, an manager, will be presenting the award. -Camille Schaden DVM, an manager, will be presenting the award. -Ms. Blaze Emmerich will be the new manager for the team. -Announcing engineer Sonny Stoltenberg. -Elsie Jacobson is a manager. -Our latest new employee, London Jacobs, has been a manager in the industry for 4 years. -Mr. Hassie Kuhn is retiring as a engineer. -Raul Bogan MD is a engineer. -Adrian Abshire joins us as an manager on the Example project. -Our latest new employee, Golden Kreiger, has been a manager in the industry for 4 years. -Deven Stiedemann I, an manager, will be presenting the award. -Hilario Koepp PhD has been a manager for 14 years. -Maynard Herzog will be the new manager for the team. -Announcing manager Nathaniel Torp. -Courtney Strosin is a manager with Example Corp. -Emely Lowe is a engineer with Example Corp. -Vilma Weber is retiring as a engineer. -Announcing engineer Ms. Carlee Littel. -Help me welcome our newest engineer, Hayden Mills. -Ervin Schimmel is a engineer. -Gino Ortiz is a engineer in the high tech industry. -Help me welcome our newest manager, Amani Conroy. -Announcing manager Korbin Lowe. -Turner Bogan I will be the new engineer for the team. -Ms. Jabari Bauch has been an manager for over a decade. -Mrs. Breanne Morissette is a engineer in the high tech industry. -Our latest new employee, Crystel Doyle, has been a manager in the industry for 4 years. -Help me welcome our newest engineer, Isabel VonRueden. -Dayne Cremin is a engineer. -Help me welcome our newest manager, Waino Armstrong. -Deborah Armstrong is retiring as a manager. -Ashlynn Mante DVM is a engineer in the high tech industry. -Karlie Pollich Jr. joins us as an engineer on the Example project. -Maeve Schroeder is a manager in the high tech industry. -Hanna Fadel, an engineer, will be presenting the award. -Delphia O'Hara has been a manager for 14 years. -Jamir Hammes has been an engineer for over a decade. -Nigel Ortiz is retiring as a engineer. -Pauline Ritchie is a manager. -Nicholaus Toy has been an engineer for over a decade. -Freddy Okuneva joins us as an manager on the Example project. -Announcing engineer Brionna Fritsch. -Our latest new employee, Maiya Mills, has been a engineer in the industry for 4 years. -Alia Hoeger PhD has been a manager for 14 years. -Alvina Mertz is a engineer in the high tech industry. -Help me welcome our newest engineer, Raymundo Hintz. -Zack Stamm is a engineer in the high tech industry. -Dayne Klocko has been a manager for 14 years. -Announcing engineer Kyla Cremin. -Izabella Bernhard will be the new engineer for the team. -Zena Yundt is a engineer in the high tech industry. -Announcing manager Daron Schuppe. -Mr. Amira Marvin joins us as an manager on the Example project. -Boris Morar will be the new manager for the team. -Esperanza Batz is retiring as a engineer. -Dortha Macejkovic I has been an manager for over a decade. -Porter Dach V, an engineer, will be presenting the award. -Kailyn Flatley I is a manager with Example Corp. -Celine O'Keefe has been a manager for 14 years. -Obie Rodriguez, an manager, will be presenting the award. -Cade Gorczany joins us as an engineer on the Example project. -Myles Shanahan is a engineer. -Jayne Wiza will be the new engineer for the team. -Julius Huel has been an manager for over a decade. -Ms. Rowena Kihn, an engineer, will be presenting the award. -Ena Wehner is a manager with Example Corp. -Clovis Cartwright will be the new manager for the team. -Mr. Marcelo D'Amore is a manager. -Meggie Prosacco has been an engineer for over a decade. -Lisa Schamberger PhD has been an engineer for over a decade. -Mrs. Lyda Bayer, an manager, will be presenting the award. -Newell Hettinger joins us as an manager on the Example project. -Melany Wolf, an manager, will be presenting the award. -Emil Schaefer has been an manager for over a decade. -Samson Trantow has been a manager for 14 years. -Maida Marquardt is a engineer. -Johnpaul Howe MD is a manager with Example Corp. -Our latest new employee, Mrs. Adah Lubowitz, has been a engineer in the industry for 4 years. -Ms. Imelda Kohler, an manager, will be presenting the award. -Manuela Frami I, an engineer, will be presenting the award. -Noelia Padberg has been an manager for over a decade. -Una Eichmann DDS is a engineer. -Elta Nolan has been an engineer for over a decade. -Jaron Wyman is a engineer in the high tech industry. -Help me welcome our newest manager, Kayla Windler Sr.. -Mrs. Zetta Stiedemann joins us as an manager on the Example project. -Dr. Abner Adams is retiring as a manager. -Brenden Ortiz is retiring as a manager. -German Funk is a engineer. -Mr. Liliane Konopelski, an manager, will be presenting the award. -Jarrett Morar is a manager in the high tech industry. -Parker Huels is a manager in the high tech industry. -Mrs. Alvah Bayer is a engineer with Example Corp. -Wilhelm Parker Jr. is a engineer in the high tech industry. -Leo Mertz will be the new engineer for the team. -Corine Hills is a engineer. -Coy Raynor Sr. is a engineer. -Help me welcome our newest engineer, Mallie Streich DVM. -Daisy Hoeger is a manager in the high tech industry. -Michelle Hickle is a engineer with Example Corp. -Nolan Douglas will be the new engineer for the team. -Vivian Bernier is retiring as a engineer. -Announcing engineer Brigitte Toy. -Help me welcome our newest engineer, Aniyah Schoen. -Emmie Bins is a engineer. -Mazie Weimann, an manager, will be presenting the award. -Carole Aufderhar will be the new engineer for the team. -Bernhard O'Kon will be the new engineer for the team. -Flavio Moore Sr. is a manager with Example Corp. -Our latest new employee, Justina Wuckert, has been a engineer in the industry for 4 years. -Meredith Jones joins us as an engineer on the Example project. -Help me welcome our newest manager, Gene Champlin. -Clare Fay, an manager, will be presenting the award. -Lesly Johnston II is retiring as a manager. -Our latest new employee, Cristian Kling, has been a manager in the industry for 4 years. -Candido Littel is a manager. -Help me welcome our newest engineer, Mrs. Gregory Ritchie. -Lucio Sawayn is a manager with Example Corp. -Announcing manager Derick Rath DVM. -Gabriella Dietrich is a engineer in the high tech industry. -Lula Spencer DVM has been an engineer for over a decade. -Help me welcome our newest engineer, Horacio Kulas. -Davin Vandervort DDS has been a engineer for 14 years. -Ms. Avery Wisoky will be the new engineer for the team. -Talon Williamson MD, an manager, will be presenting the award. -Gerald Hahn has been a manager for 14 years. -Ettie Yost is retiring as a manager. -Abdullah Mosciski is retiring as a engineer. -Mrs. Marielle Bosco is a engineer in the high tech industry. -Kory Batz joins us as an manager on the Example project. -Noelia Kovacek, an engineer, will be presenting the award. -Kyleigh Nienow is a manager with Example Corp. -Alize Lind will be the new engineer for the team. -Ellsworth Altenwerth has been an engineer for over a decade. -Domenic Mayer has been a engineer for 14 years. -Ms. Geovanny Satterfield has been an engineer for over a decade. -Ella Daniel is a manager with Example Corp. -Kylee Bogisich PhD has been an engineer for over a decade. -Ryder Wilkinson Sr. is a manager in the high tech industry. -Help me welcome our newest engineer, Marina Schaefer. -Ms. Paige Bartell is a manager in the high tech industry. -Mitchel Murray has been an engineer for over a decade. -Tyler Quigley, an manager, will be presenting the award. -Veronica Kreiger has been a engineer for 14 years. -Halie Goldner has been an engineer for over a decade. -Ryder Lakin has been an engineer for over a decade. -Chloe Legros is a engineer. -Dariana O'Conner joins us as an engineer on the Example project. -Era Bins Jr. is a engineer with Example Corp. -Help me welcome our newest manager, Laila Reichert. -Dedrick Kuhic V has been a engineer for 14 years. -Haylee Price Jr. is retiring as a engineer. -Help me welcome our newest manager, Callie Shields. -Jarrod Fahey will be the new manager for the team. -Earlene Cremin is a engineer in the high tech industry. -Ellie Bergstrom will be the new manager for the team. -Armando Grady has been a engineer for 14 years. -Announcing engineer Dr. Lamar Hessel. -Joe Runolfsson Sr. is a engineer with Example Corp. -Announcing manager Manley Oberbrunner. -Meta Weissnat II has been an engineer for over a decade. -Dagmar Batz IV is a engineer with Example Corp. -Our latest new employee, Susie Bayer, has been a engineer in the industry for 4 years. -Help me welcome our newest engineer, Randi Howell. -Joanne Rau is a manager in the high tech industry. -Buck Stark is a engineer. -Shane Donnelly is a engineer with Example Corp. -Quincy Casper V is retiring as a engineer. -Lafayette Grimes will be the new manager for the team. -Mrs. Jody Beer will be the new engineer for the team. -Miss Corene Schamberger has been an engineer for over a decade. -Dr. Jesse Baumbach is retiring as a engineer. -Brenna Quigley Jr. is a manager. -Ms. Viviane Bins joins us as an engineer on the Example project. -Help me welcome our newest manager, Edgar Johnson. -Mr. Tracy Beier has been a engineer for 14 years. -Juvenal Ortiz has been a engineer for 14 years. -Dr. Nat Pagac is retiring as a manager. -Our latest new employee, Julio Mitchell, has been a engineer in the industry for 4 years. -Help me welcome our newest engineer, Clarissa Mraz Jr.. -Dustin Grady will be the new manager for the team. -Brennon Bayer is a engineer. -Mrs. Birdie Nienow has been a manager for 14 years. -Announcing engineer Randal Sauer Sr.. -Verda Kozey will be the new engineer for the team. -Chesley Hickle is a engineer with Example Corp. -Miss Rico Block has been a engineer for 14 years. -Gaetano Lindgren has been a manager for 14 years. -Hope Hauck will be the new engineer for the team. -Percival O'Connell is a engineer in the high tech industry. -Melyna Leuschke is a manager. -Our latest new employee, Adan Collins, has been a manager in the industry for 4 years. -Daryl Bashirian has been an engineer for over a decade. -Kara Welch, an manager, will be presenting the award. -Norberto Swift has been an engineer for over a decade. -Effie Champlin Jr. will be the new engineer for the team. -Dr. Julia Metz joins us as an manager on the Example project. -Janice Witting is a manager in the high tech industry. -Bruce Eichmann, an manager, will be presenting the award. -Isobel Swift is a engineer. -Earnestine Mayer MD has been an manager for over a decade. -Michele Bashirian is a engineer in the high tech industry. -Janick Crona is a engineer in the high tech industry. -Hank Fisher III has been a manager for 14 years. -Miss Aliya Skiles is a engineer. -Herbert Orn has been an manager for over a decade. -Our latest new employee, Aglae Baumbach, has been a engineer in the industry for 4 years. -Gayle Carter will be the new engineer for the team. -Announcing manager Creola Kautzer. -Announcing manager Theresa Hauck. -Ms. Patience Wintheiser, an manager, will be presenting the award. -Announcing engineer Sebastian Rutherford DDS. -Ara Pollich I has been a engineer for 14 years. -Carlos Baumbach has been an manager for over a decade. -Hulda Schroeder DVM is a engineer with Example Corp. -Stanton Torp joins us as an manager on the Example project. -Our latest new employee, Ceasar Franecki, has been a manager in the industry for 4 years. -Lelah Miller is a engineer. -Wyman Schultz is a manager in the high tech industry. -Mae Harris V will be the new manager for the team. -Help me welcome our newest engineer, Hortense Koelpin. -Our latest new employee, Wilmer Deckow, has been a engineer in the industry for 4 years. -Zaria Ferry has been an engineer for over a decade. -Help me welcome our newest engineer, Pierre Cronin. -Ms. Brenna Leffler is a engineer with Example Corp. -Announcing engineer Dr. Keara Price. -Announcing manager Jane Schroeder. -Reymundo Heathcote has been a manager for 14 years. -Elton Schiller II is a manager with Example Corp. -Irma Blanda is a manager with Example Corp. -Mireya Turner, an manager, will be presenting the award. -Dawson Streich will be the new manager for the team. -Gianni Cassin is a manager in the high tech industry. -Johnathan Kuhic V joins us as an manager on the Example project. -Our latest new employee, Lacey Sawayn, has been a engineer in the industry for 4 years. +Miller Zulauf, an manager, will be presenting the award. +Mazie Gottlieb has been an manager for over a decade. +Johnathon Shields Sr. is a manager in the high tech industry. +Paula Windler I has been a manager for 14 years. +Kaley Gleichner V is a engineer with Example Corp. +Mr. Roosevelt Welch MD is a engineer in the high tech industry. +Help me welcome our newest engineer, Ms. Shirley Purdy V. +Rolando Klein has been a engineer for 14 years. +Our latest new employee, Ms. Sandy Osinski, has been a manager in the industry for 4 years. +Our latest new employee, Mr. Kristopher Bauch II, has been a manager in the industry for 4 years. +Ali Gleason is a engineer. +Our latest new employee, Americo Rempel, has been a engineer in the industry for 4 years. +Gladys Marvin DVM is a manager with Example Corp. +Danial Koch, an manager, will be presenting the award. +Mr. Leopold Bergnaum is a manager with Example Corp. +Davonte Larson will be the new manager for the team. +Announcing engineer Ms. Tiara Collier Jr.. +Jessie Price joins us as an engineer on the Example project. +Kathleen Kihn is retiring as a engineer. +Mr. Ruben Haag is a manager in the high tech industry. +Maegan Quitzon will be the new manager for the team. +Our latest new employee, Clifton McKenzie, has been a manager in the industry for 4 years. +Lily Collins joins us as an engineer on the Example project. +Janie Hartmann is retiring as a engineer. +Ms. Alexandra Torphy IV will be the new manager for the team. +Our latest new employee, Rosemarie Gerlach, has been a engineer in the industry for 4 years. +Emilio Schultz, an engineer, will be presenting the award. +Adalberto Reilly V joins us as an engineer on the Example project. +Jess Schulist is a manager with Example Corp. +Help me welcome our newest manager, Bianka Swaniawski. +Mr. Oliver Lowe is a engineer. +Winifred Mayert has been a manager for 14 years. +Lamar Bahringer has been an engineer for over a decade. +Celia Hamill is a manager with Example Corp. +Ms. Shanon Murphy IV joins us as an engineer on the Example project. +Mr. Doris Gislason IV is a manager with Example Corp. +Hulda Bechtelar has been a engineer for 14 years. +Raina Pfeffer IV has been an engineer for over a decade. +Lilyan Gulgowski will be the new engineer for the team. +Mr. Gilbert Ziemann is a manager in the high tech industry. +Our latest new employee, Rebeca Spencer, has been a engineer in the industry for 4 years. +Dion Goodwin is a manager with Example Corp. +Ms. Shemar Hand is a manager with Example Corp. +Announcing manager Mr. Adrien Marquardt DDS. +Ladarius Veum is a manager. +Josefina Ernser is retiring as a engineer. +Mr. Geovanny Schowalter DDS, an manager, will be presenting the award. +Lera Rohan is a manager. +Fredy Bogisich joins us as an manager on the Example project. +Vada Jones is a manager with Example Corp. +Alec Waelchi is a manager. +Violet Schneider will be the new engineer for the team. +Nestor Von has been a engineer for 14 years. +Ms. Zora Ortiz DVM joins us as an manager on the Example project. +Help me welcome our newest manager, Mortimer Borer. +Adam Rolfson is a manager with Example Corp. +Willie Cronin has been an engineer for over a decade. +Tianna Cole has been an engineer for over a decade. +Eliza McGlynn will be the new engineer for the team. +Announcing manager Fidel Heathcote. +Brendan Towne joins us as an manager on the Example project. +Announcing manager Dean Lowe. +Brycen Ortiz is a manager with Example Corp. +Ford Kertzmann has been a engineer for 14 years. +Alfredo Franecki is retiring as a engineer. +Monica Pouros Jr. will be the new manager for the team. +Ms. Assunta Fay Sr. has been an manager for over a decade. +Help me welcome our newest manager, Noah Lockman Jr.. +Lonny Ebert has been a engineer for 14 years. +Briana Howe, an manager, will be presenting the award. +Ms. Vivienne Kuvalis IV is a engineer. +Ms. Gracie Hilpert PhD is retiring as a manager. +Help me welcome our newest manager, Thea Cronin. +Help me welcome our newest engineer, Elenora Oberbrunner I. +Ms. Rebecca Bergnaum is retiring as a manager. +Hudson Lebsack will be the new manager for the team. +Sigurd Abbott joins us as an manager on the Example project. +Kennith Wiegand V has been an manager for over a decade. +Help me welcome our newest manager, Dalton Carter. +Raegan Balistreri, an engineer, will be presenting the award. +Our latest new employee, Brandy Cronin, has been a engineer in the industry for 4 years. +Ms. Adella Runolfsdottir DDS is a engineer. +Robin Walsh, an engineer, will be presenting the award. +Emmanuelle Rempel is a engineer in the high tech industry. +Our latest new employee, Mr. Jan Ullrich DVM, has been a engineer in the industry for 4 years. +Help me welcome our newest engineer, Stefan Eichmann. +Giles Keeling is a manager in the high tech industry. +Help me welcome our newest manager, Bell O'Reilly. +Help me welcome our newest manager, Molly Grant. +Karlee Anderson is a manager in the high tech industry. +Jordyn Heller is retiring as a engineer. +Our latest new employee, Eleonore Dibbert Sr., has been a engineer in the industry for 4 years. +Efrain Borer I is a manager with Example Corp. +Ms. Alisha Wiza is a engineer in the high tech industry. +David Haag joins us as an manager on the Example project. +Ms. Rebecca Schmeler has been an manager for over a decade. +Our latest new employee, Ebba Legros, has been a manager in the industry for 4 years. +Assunta McGlynn will be the new manager for the team. +Help me welcome our newest engineer, Joelle Heller II. +Rasheed Considine is a engineer in the high tech industry. +Mr. Jabari Borer is a engineer. +Our latest new employee, Mr. Americo O'Conner, has been a engineer in the industry for 4 years. +Our latest new employee, Mr. Johnny Kautzer DDS, has been a manager in the industry for 4 years. +Beverly Schimmel is a manager in the high tech industry. +Ms. Sarina Kuhn DDS is a engineer with Example Corp. +Eusebio Kertzmann II, an engineer, will be presenting the award. +Hilton O'Keefe will be the new engineer for the team. +Reina Weissnat is a manager. +Hassie Kling will be the new manager for the team. +Lera Gleason has been a engineer for 14 years. +Waldo Deckow is retiring as a manager. +Help me welcome our newest manager, Mr. Norris Kling. +Ms. Annabel Nikolaus, an manager, will be presenting the award. +Help me welcome our newest manager, Cheyanne Hilll. +Gage Jacobs, an manager, will be presenting the award. +Cassidy Stokes joins us as an manager on the Example project. +Georgianna Jacobs is a engineer with Example Corp. +Mr. Ubaldo Cormier joins us as an engineer on the Example project. +Laurie Berge, an manager, will be presenting the award. +Mr. Karl Stehr Jr. is retiring as a manager. +Mr. Jaquan Gibson joins us as an engineer on the Example project. +Delores Stiedemann, an engineer, will be presenting the award. +Anabelle Yundt is a manager in the high tech industry. +Gaston Bergstrom MD has been an engineer for over a decade. +Verona Halvorson has been an engineer for over a decade. +Ms. Bridie Thompson V has been a manager for 14 years. +Announcing manager Albertha Tremblay. +Courtney Becker joins us as an manager on the Example project. +Bessie Homenick is retiring as a manager. +Lilian Osinski is a engineer with Example Corp. +Bertrand Altenwerth has been a manager for 14 years. +Cruz Gottlieb is a engineer with Example Corp. +Willy Runte joins us as an manager on the Example project. +Ms. Estelle Carter will be the new manager for the team. +Arnoldo Emard is a manager. +Our latest new employee, Brenna Lockman, has been a engineer in the industry for 4 years. +Kelly Bergnaum joins us as an manager on the Example project. +Adah Labadie is a manager. +Nichole Koepp has been a manager for 14 years. +Help me welcome our newest engineer, Jettie Jacobs. +Kellie Brekke V is retiring as a manager. +Nya Russel IV is a engineer. +Rowan Kling is a engineer with Example Corp. +Help me welcome our newest engineer, Dariana Oberbrunner V. +Angelo Altenwerth I joins us as an engineer on the Example project. +Britney Herman is retiring as a manager. +Abigayle Reichel is a engineer in the high tech industry. +Ms. Miracle Grady IV is a manager in the high tech industry. +Ms. Alison Bartoletti IV joins us as an manager on the Example project. +Laney Nitzsche is a engineer with Example Corp. +Laura Terry PhD is a engineer. +Breanne Koepp has been a engineer for 14 years. +Announcing engineer Ines Medhurst. +Theodore Stokes is a manager. +Ms. Yasmine Schulist, an engineer, will be presenting the award. +Help me welcome our newest engineer, Adolfo O'Reilly. +Kaelyn Schaden joins us as an manager on the Example project. +Jorge Bergnaum has been a engineer for 14 years. +Ignacio Wyman joins us as an engineer on the Example project. +Dannie Will is a manager in the high tech industry. +Margaretta Abbott will be the new engineer for the team. +Our latest new employee, Briana Murray PhD, has been a engineer in the industry for 4 years. +Our latest new employee, Brady Rath, has been a engineer in the industry for 4 years. +Rahsaan Adams joins us as an manager on the Example project. +Mr. Hayley Dicki will be the new engineer for the team. +Colton Pouros, an engineer, will be presenting the award. +Vida Schultz joins us as an engineer on the Example project. +Announcing manager Alexanne Turcotte. +Reba Stroman is a manager with Example Corp. +Paxton O'Connell MD, an manager, will be presenting the award. +Don Lesch joins us as an engineer on the Example project. +Help me welcome our newest engineer, Mr. Carter Von IV. +Help me welcome our newest manager, Candida Boyer. +Mr. Raymond Krajcik DVM is a engineer with Example Corp. +Markus Waelchi has been a engineer for 14 years. +Malachi Cummerata has been an engineer for over a decade. +Mr. Edmond Dietrich IV has been a manager for 14 years. +Lenora Reynolds is a engineer in the high tech industry. +Zoie Kiehn is retiring as a engineer. +Mr. Mason Lang II is a manager with Example Corp. +Virginia Reilly has been an engineer for over a decade. +Claude Emmerich, an manager, will be presenting the award. +Sebastian Prosacco has been a manager for 14 years. +Mr. Dashawn O'Hara, an manager, will be presenting the award. +Emmy Turcotte III joins us as an engineer on the Example project. +Sincere Legros joins us as an manager on the Example project. +Help me welcome our newest engineer, Mauricio Reilly. +Ms. Kimberly Bogan I is a engineer in the high tech industry. +Ms. Cassandre Murphy PhD has been a engineer for 14 years. +Kaycee Kshlerin I is a engineer in the high tech industry. +Ms. Cheyanne Rodriguez PhD is a engineer with Example Corp. +Announcing manager Gayle Wiza. +Ms. Desiree Metz is retiring as a engineer. +Our latest new employee, Hettie Beier MD, has been a engineer in the industry for 4 years. +Shakira Ledner is a manager. +Forrest Ullrich will be the new engineer for the team. +Help me welcome our newest manager, Alysha Wolff III. +Mr. Lorenza Okuneva DVM is a engineer in the high tech industry. +Nasir Walsh will be the new manager for the team. +Jeanette Rogahn is a engineer in the high tech industry. +Gilda Funk I, an manager, will be presenting the award. +Julius Gusikowski is a engineer. +Help me welcome our newest engineer, Agnes Schuster. +Our latest new employee, Delphine Thompson, has been a engineer in the industry for 4 years. +Tressa Nolan joins us as an engineer on the Example project. +Leatha Reilly I is a manager in the high tech industry. +Announcing engineer Mr. Jamar Mueller. +Announcing manager Kyleigh Franecki. +Our latest new employee, Cornell Bashirian MD, has been a manager in the industry for 4 years. +Help me welcome our newest manager, Ramiro Bogan. +Robyn McKenzie will be the new manager for the team. +Our latest new employee, Destini Rippin, has been a manager in the industry for 4 years. +Eladio Mraz joins us as an manager on the Example project. +Jayda Moore III is a manager in the high tech industry. +Alivia Koelpin is retiring as a engineer. +Alva Muller is a engineer with Example Corp. +Ms. Karianne Dibbert Sr. is a manager with Example Corp. +Hazle Langworth is retiring as a manager. +Geraldine Koelpin DVM, an manager, will be presenting the award. +Margarett Swaniawski is retiring as a manager. +Major Mosciski has been a manager for 14 years. +Cara Kuphal is a manager with Example Corp. +Announcing engineer Deshawn Fisher. +Mr. Leopoldo VonRueden DDS, an manager, will be presenting the award. +Horacio O'Connell is a manager in the high tech industry. +Salvatore Hermann will be the new engineer for the team. +Dessie Franecki is a manager in the high tech industry. +Our latest new employee, Mr. Torrey Macejkovic, has been a manager in the industry for 4 years. +Help me welcome our newest engineer, Wendell Boyer. +Our latest new employee, Providenci Heidenreich, has been a engineer in the industry for 4 years. +Announcing engineer Mr. Dorthy Williamson DDS. +Announcing manager Ena Green DDS. +Ms. Aaliyah Bernhard is retiring as a manager. +Help me welcome our newest engineer, Grace Quitzon. +Germaine VonRueden is a manager. +Lionel Goldner will be the new manager for the team. +Pearline Osinski is retiring as a engineer. +Claud Mayert is a manager. +Palma Grady joins us as an engineer on the Example project. +Andre Conn has been a manager for 14 years. +Gerardo Wilderman is a manager in the high tech industry. +Our latest new employee, Ms. Lydia Moore, has been a engineer in the industry for 4 years. +Walter Kub has been a engineer for 14 years. +Elbert Gottlieb, an engineer, will be presenting the award. +Announcing engineer Arnoldo Quitzon. +Macy Conroy joins us as an engineer on the Example project. +Cecil Metz will be the new manager for the team. +Help me welcome our newest engineer, Ms. Loyce Torphy MD. +Rylan Wyman PhD has been a manager for 14 years. +Announcing manager Clair Luettgen DDS. +Mr. Rickey Lehner is a engineer. +Kian Walter is a engineer. +Ms. Coralie Carroll II is a manager. +Ms. Leann Gutkowski Sr. has been a engineer for 14 years. +Presley Hirthe has been a manager for 14 years. +Leola King has been a manager for 14 years. +Maribel Mueller has been an manager for over a decade. +Dean Hilll is a engineer in the high tech industry. +Rosella Green, an manager, will be presenting the award. +Clementine Klein is retiring as a engineer. +Mr. Riley Roob V will be the new manager for the team. +Newell Beier will be the new manager for the team. +Orval Rodriguez joins us as an manager on the Example project. +Announcing manager Ms. Neha Kerluke. +Mr. Roger Farrell V joins us as an engineer on the Example project. +Charlie Brakus is a manager with Example Corp. +Judge Nitzsche is retiring as a engineer. +Mr. Triston Jakubowski V is a engineer. +Announcing engineer Ms. Rhoda Luettgen. +Felicia Roob is a manager. +Our latest new employee, Wendy Gulgowski, has been a engineer in the industry for 4 years. +Announcing manager Ms. Destiny Stoltenberg. +Announcing engineer Mr. Jaylen Metz. +Ms. Annamarie Heathcote is a manager. +Cayla Heaney is a engineer with Example Corp. +Eleanora Cruickshank has been a manager for 14 years. +Susie Schowalter is retiring as a manager. +Ms. Clarabelle Reichert Sr. joins us as an engineer on the Example project. +Whitney Kuhn is retiring as a manager. +Mr. Dangelo Dibbert DDS joins us as an manager on the Example project. +Mr. Jess Willms II joins us as an engineer on the Example project. +Madisyn Waelchi PhD has been an engineer for over a decade. +Ms. Sister Tillman is a engineer in the high tech industry. +Fern Weimann DVM is retiring as a manager. +Dejah Kunze II will be the new manager for the team. +Mr. Rahul Lubowitz, an manager, will be presenting the award. +Antonia Zulauf DDS is retiring as a manager. +Ms. Valentina Johnson DDS, an manager, will be presenting the award. +Shaylee Sauer is a manager. +Ms. Shanie Ruecker is a engineer in the high tech industry. +Mandy Boehm III is retiring as a manager. +Greg Hintz has been a manager for 14 years. +Our latest new employee, Vesta Lockman, has been a engineer in the industry for 4 years. +Announcing manager Lester Bahringer. +Our latest new employee, Kianna McGlynn, has been a manager in the industry for 4 years. +Our latest new employee, Matteo Turner, has been a manager in the industry for 4 years. +Lexus Gorczany has been an engineer for over a decade. +Otilia Schumm has been an engineer for over a decade. +Ms. Gabriella Boyle is a manager in the high tech industry. +Announcing engineer Edward Block. +Keanu Russel Jr. joins us as an manager on the Example project. +Raquel Schroeder has been an manager for over a decade. +Help me welcome our newest engineer, Coralie Boyer. +Ms. Stefanie Ernser is a manager with Example Corp. +Ms. Dorothy Reynolds is a manager with Example Corp. +Riley Little MD will be the new engineer for the team. +Our latest new employee, Mr. Bennie Champlin Jr., has been a manager in the industry for 4 years. +Ms. Ettie Koelpin DVM will be the new engineer for the team. +Saige Schaefer joins us as an engineer on the Example project. +Kyra Barrows, an manager, will be presenting the award. +Felton Gerhold PhD is a manager with Example Corp. +Mr. Freeman Abshire PhD is a engineer with Example Corp. +Terrence O'Conner has been a manager for 14 years. +Ms. Clarabelle Gibson DDS is a engineer with Example Corp. +Nikko Nader is a manager with Example Corp. +Mr. Arturo Moore is retiring as a engineer. +Our latest new employee, Wayne Abshire, has been a engineer in the industry for 4 years. +Help me welcome our newest manager, Sydnee Schaden. +Help me welcome our newest engineer, Matteo Robel IV. +Our latest new employee, Maverick Wyman, has been a manager in the industry for 4 years. +Our latest new employee, Mr. Westley Predovic V, has been a manager in the industry for 4 years. +Our latest new employee, Selina Donnelly, has been a manager in the industry for 4 years. +Mr. Alfonzo Von I is a engineer with Example Corp. +Doug Ruecker is a engineer. +Denis Yost joins us as an manager on the Example project. +Our latest new employee, Cyril Robel Sr., has been a engineer in the industry for 4 years. +Announcing engineer Ford Jacobi. +Dillan Grimes is a engineer. +Our latest new employee, Ms. Cecelia Kiehn PhD, has been a engineer in the industry for 4 years. +Rachael Kshlerin is a engineer with Example Corp. +Raven Kihn is retiring as a manager. +Help me welcome our newest engineer, Ms. Eileen Friesen. +Announcing manager Mr. Jett Bernhard. +Haylie Spinka has been an engineer for over a decade. +Kailey Towne Jr. has been a manager for 14 years. +Our latest new employee, Mr. Jed Rutherford, has been a manager in the industry for 4 years. +Angel Schneider is a manager. +Help me welcome our newest manager, Emma Pacocha. +Help me welcome our newest manager, Jeremie Rogahn. +Porter Herman is a engineer. +Priscilla Stanton joins us as an engineer on the Example project. +Help me welcome our newest manager, Aurelio Turner. +Melvin McLaughlin is retiring as a engineer. +Help me welcome our newest manager, Brandy Friesen. +Angelo Pfeffer has been a manager for 14 years. +Our latest new employee, Mr. Jerrold Prohaska, has been a engineer in the industry for 4 years. +Margret Turcotte has been a engineer for 14 years. +Help me welcome our newest engineer, Kathryne Schaefer II. +Kamille Blanda is a engineer with Example Corp. +Addie Tremblay, an manager, will be presenting the award. +Help me welcome our newest manager, Cathrine Bernier. +Jesus Bashirian is a engineer in the high tech industry. +Dillon Hamill is retiring as a manager. +Granville Lemke is retiring as a engineer. +Vito Greenholt III is a engineer with Example Corp. +Evie Kunde is a manager with Example Corp. +Lela Renner joins us as an manager on the Example project. +Brendon Reynolds will be the new manager for the team. +Mr. Brandt Larson joins us as an engineer on the Example project. +Mr. Arthur Brakus Jr. joins us as an manager on the Example project. +Haylie Gerhold will be the new manager for the team. +Help me welcome our newest engineer, Emile Crist. +Mr. Kale Schamberger DVM has been an engineer for over a decade. +Ms. Oceane Kerluke II will be the new manager for the team. +Matteo Auer has been a manager for 14 years. +Announcing engineer Audie Kreiger IV. +Mr. Niko Yost Jr. is retiring as a engineer. +Sage Bruen will be the new engineer for the team. +Our latest new employee, Francisco Feeney, has been a engineer in the industry for 4 years. +Jared Koelpin, an manager, will be presenting the award. +Our latest new employee, Claud Lesch, has been a engineer in the industry for 4 years. +Announcing engineer Sherman Okuneva Jr.. +Help me welcome our newest engineer, Jeramy Strosin. +Amya Schumm is a engineer with Example Corp. +Our latest new employee, Tracey Wunsch, has been a manager in the industry for 4 years. +Krystal Kunze is retiring as a engineer. +Talon Wyman V, an engineer, will be presenting the award. +Brice Mills has been a manager for 14 years. +Scottie Bergstrom has been a manager for 14 years. +Ms. Shanny Beatty is a manager with Example Corp. +Shannon Witting is a manager. +Announcing manager Taya Fahey V. +Our latest new employee, Ms. Lauriane Sanford, has been a manager in the industry for 4 years. +Emilia Lesch has been an manager for over a decade. +Randal Predovic is a engineer in the high tech industry. +Piper Heidenreich I is a engineer with Example Corp. +Jakob Kassulke, an manager, will be presenting the award. +Wilma Satterfield is retiring as a engineer. +Announcing manager Dahlia Paucek. +Peyton Will Jr. has been a manager for 14 years. +Reginald Durgan Sr. has been an engineer for over a decade. +Miracle Sauer will be the new manager for the team. +Dewayne Wintheiser will be the new manager for the team. +Announcing manager Emelia Langworth. +Ms. Elissa Reichel is retiring as a manager. +Gillian Ledner, an engineer, will be presenting the award. +Announcing engineer Mr. Morgan Bernier IV. +Mr. Brooks Prosacco, an engineer, will be presenting the award. +Mr. Junius Hintz is a engineer in the high tech industry. +Astrid Heathcote DVM is a manager. +Our latest new employee, Ms. Brooklyn Parker, has been a manager in the industry for 4 years. +Help me welcome our newest manager, Domingo Heller. +Mr. Jayde Dooley Sr. has been an engineer for over a decade. +Jada Carroll Sr. joins us as an engineer on the Example project. +Enoch Hammes has been an manager for over a decade. +Our latest new employee, Ms. Mckayla Jast, has been a engineer in the industry for 4 years. +Ulices Wunsch has been an manager for over a decade. +Ms. Jacklyn Bayer I is a engineer. +Our latest new employee, Adolph Kshlerin, has been a engineer in the industry for 4 years. +Magnolia Baumbach PhD has been an manager for over a decade. +Noelia Windler is a engineer in the high tech industry. +Jaeden Hand is a manager. +Heather Wilderman joins us as an manager on the Example project. +Daphne Hamill is retiring as a manager. +Octavia Durgan will be the new manager for the team. +Anibal Kerluke is retiring as a manager. +Mr. Orval Hammes Jr. is retiring as a manager. +Kristin Conn is a manager. +Magdalen Dietrich IV is retiring as a manager. +Ms. Haylie Rosenbaum MD is a engineer in the high tech industry. +Help me welcome our newest engineer, Elenor Howe. +Help me welcome our newest engineer, Yvonne Roberts. +Oda Wisoky has been an manager for over a decade. +Help me welcome our newest engineer, Ms. Aryanna Grimes Jr.. +Jocelyn Wilkinson joins us as an manager on the Example project. +Announcing engineer Neil Hirthe. +Aric Heidenreich has been a manager for 14 years. +Help me welcome our newest engineer, Ms. Julia Carter. +Darlene Pacocha is a manager. +Kathryne Hoeger is a engineer. +Alysson Carter V is a engineer with Example Corp. +Mr. Nicolas Blick V is a engineer with Example Corp. +Elaina Von, an engineer, will be presenting the award. +Ms. Ellen Mayer IV is a manager with Example Corp. +Our latest new employee, Darryl Casper, has been a engineer in the industry for 4 years. +Announcing engineer Mr. Kadin Metz V. +Ms. Electa Quitzon Sr. joins us as an manager on the Example project. +Mr. Hiram Howe MD is a manager in the high tech industry. +Ole Marvin joins us as an manager on the Example project. +Our latest new employee, Claudia Rice, has been a manager in the industry for 4 years. +Forest Swaniawski is a manager in the high tech industry. +Roslyn Dickens has been a engineer for 14 years. +Ms. Janis Wuckert V is a manager in the high tech industry. +Ms. Meda Jerde DVM is a engineer. +Dolores Schiller II has been a engineer for 14 years. +Mr. Enid Keeling is a engineer with Example Corp. +Our latest new employee, Burnice Bosco DDS, has been a engineer in the industry for 4 years. +Katheryn Becker, an manager, will be presenting the award. +Samantha Schmidt will be the new engineer for the team. +Mr. Royce Bashirian is a engineer. +Mitchell Parker is a engineer. +Ms. Eryn Bins is a engineer. +Announcing engineer Sven Harvey. +Help me welcome our newest manager, Mr. Melany Dibbert. +Announcing manager Ms. Ardella Sipes Jr.. +Joy Reynolds will be the new manager for the team. +Help me welcome our newest manager, Lyda Quitzon. +Sophie Gusikowski, an engineer, will be presenting the award. +Ashly Jacobi will be the new engineer for the team. +Our latest new employee, Haylie Maggio, has been a engineer in the industry for 4 years. +Deshaun Walsh, an engineer, will be presenting the award. +Mr. Malachi Gibson is a manager in the high tech industry. +Edna Fadel will be the new manager for the team. +Ms. Eula Bogan will be the new manager for the team. +Mr. Javier Kemmer DDS joins us as an manager on the Example project. +Nicole Conroy will be the new manager for the team. +Cordie Wunsch V is a manager. +Pablo Jones will be the new engineer for the team. +Ms. Jolie Schuppe DDS is a manager in the high tech industry. +Amya Swift, an engineer, will be presenting the award. +Alessandro Bartoletti will be the new manager for the team. +Our latest new employee, Sonya Schmitt, has been a manager in the industry for 4 years. +Ava D'Amore has been an engineer for over a decade. +Raphaelle Murphy will be the new manager for the team. +Seth King DVM has been an manager for over a decade. +Mr. Wilber Schaden III will be the new manager for the team. +Brian White is a engineer. +Sage Parker has been a manager for 14 years. +Katharina Wiegand is a manager. +Eric Weimann, an engineer, will be presenting the award. +Marcellus Jakubowski has been an engineer for over a decade. +Angeline Pouros has been an manager for over a decade. +Samara Veum will be the new engineer for the team. +Alberto Zemlak MD has been an engineer for over a decade. +Liza Nolan III, an manager, will be presenting the award. +Guy Turcotte is a manager. +Danyka Stamm MD is a manager with Example Corp. +Alverta Dach is retiring as a engineer. +Maybelline Kihn is a engineer with Example Corp. +Carlo Ratke has been a manager for 14 years. +Margaretta Von is a engineer. +Pinkie Green is a engineer in the high tech industry. +Mr. Elvis Gulgowski, an manager, will be presenting the award. +Chanel Harber joins us as an engineer on the Example project. +Carroll Gutmann will be the new manager for the team. +Emma Stehr is a manager with Example Corp. +Rusty Gerhold will be the new manager for the team. +Help me welcome our newest engineer, Nella Graham. +Carolyne Rippin DDS is retiring as a engineer. +Our latest new employee, Conor Rowe, has been a manager in the industry for 4 years. +Gilda Mayert II has been a engineer for 14 years. +Our latest new employee, Mr. Cale Ortiz Jr., has been a engineer in the industry for 4 years. +Morgan Parisian IV will be the new engineer for the team. +Help me welcome our newest engineer, Carolanne Russel. +Grayson VonRueden DVM joins us as an engineer on the Example project. +Ms. Jazmyne Larkin I will be the new manager for the team. +Courtney Hirthe is a engineer with Example Corp. +Announcing manager Maximus Shanahan MD. +Felipa Wiegand has been a engineer for 14 years. +Ms. Madalyn Corwin III is a engineer. +Eldridge West joins us as an engineer on the Example project. +Ms. Cleta Renner is a manager with Example Corp. +Katelynn Erdman will be the new manager for the team. +Scotty Cassin is a manager in the high tech industry. +Melyna Kertzmann is a engineer. +Mariam McCullough joins us as an engineer on the Example project. +Demarcus Donnelly V is retiring as a engineer. +Help me welcome our newest manager, Mr. Ansley Bernhard Sr.. +Chad Ondricka V has been an engineer for over a decade. +Liliana Hessel is retiring as a manager. +Ransom Crist has been an manager for over a decade. +Aisha Boehm has been an engineer for over a decade. +Adaline O'Reilly PhD is retiring as a engineer. +Announcing manager Dayna Hoppe. +Help me welcome our newest engineer, Mr. Lee Kreiger Jr.. +Help me welcome our newest manager, Payton Cummerata. +Colten Luettgen joins us as an manager on the Example project. +Ms. Nakia Johns has been a engineer for 14 years. +Freida Strosin has been an manager for over a decade. +Brad Bednar has been an engineer for over a decade. +Antone McLaughlin has been an manager for over a decade. +Izabella Berge is a engineer with Example Corp. +Carole Lowe V is a engineer in the high tech industry. +Bud Leuschke is a engineer in the high tech industry. +Archibald Hilpert joins us as an manager on the Example project. +Fernando Ebert joins us as an manager on the Example project. +Jeramy Abshire is a engineer with Example Corp. +Help me welcome our newest engineer, Jannie Weber. +Announcing engineer Mr. Mason Wolff MD. +Nelle Kutch III, an engineer, will be presenting the award. +Help me welcome our newest engineer, Keshawn Sporer. +Caterina Kunze PhD has been an engineer for over a decade. +Announcing manager Dashawn Block. +Shania Witting is retiring as a manager. +Amos Stamm is a engineer. +Announcing manager Alexandra Reichel Jr.. +Mr. Edwardo Schneider V joins us as an manager on the Example project. +Announcing manager Ms. Brigitte Waelchi. +Jeanne Keeling is a engineer in the high tech industry. +Forest Von has been a manager for 14 years. +Mr. Casimer Jast joins us as an manager on the Example project. +Ms. Ebba Conn has been a manager for 14 years. +Jany Yost is a engineer in the high tech industry. +Announcing manager Hassie Mosciski. +Mr. Zion Rosenbaum Sr. has been an manager for over a decade. +Ignacio Thompson MD is retiring as a manager. +Jeanette Conroy IV is retiring as a manager. +Garrick Graham is a manager in the high tech industry. +Misael Kuvalis has been a manager for 14 years. +Helene Dickinson III will be the new engineer for the team. +Help me welcome our newest manager, Reilly Murazik. +Our latest new employee, Jadon Ullrich, has been a engineer in the industry for 4 years. +Ms. Audra Borer has been a manager for 14 years. +Earnestine Sauer joins us as an engineer on the Example project. +Myrl Gerlach is a engineer. +Mr. Garret Krajcik is a engineer with Example Corp. +Help me welcome our newest manager, Emmet Hayes. +Ahmed Donnelly Jr. is a engineer. +Mr. Alvah Schimmel joins us as an manager on the Example project. +Ms. Marilyne Harris I has been a engineer for 14 years. +Ms. Casandra Zulauf has been an manager for over a decade. +Alfred Yundt has been a manager for 14 years. +Ford Herman has been a manager for 14 years. +Paige Beier, an engineer, will be presenting the award. +Myrtle Runte has been a engineer for 14 years. +Announcing engineer Roy Rosenbaum. +Announcing engineer Mr. Julius Borer III. +Noemi Hamill has been a engineer for 14 years. +Francisco Koelpin PhD, an manager, will be presenting the award. +Ms. Pascale Emard joins us as an manager on the Example project. +Daryl Wisozk DVM joins us as an manager on the Example project. +Mr. Noble Runolfsson, an manager, will be presenting the award. +Ms. Daija Schoen joins us as an engineer on the Example project. +Ubaldo Dach is retiring as a engineer. +Katrine Parker PhD, an manager, will be presenting the award. +Ms. Martine Treutel IV has been an manager for over a decade. +Help me welcome our newest engineer, Ms. Alice Emard II. +Garrison Nikolaus, an engineer, will be presenting the award. +Mr. Tanner Baumbach IV has been a engineer for 14 years. +Our latest new employee, Austin Wisozk II, has been a manager in the industry for 4 years. +Announcing manager Mr. Saul Little. +Ms. Ashtyn O'Conner is a engineer. +Mr. Norval Wisozk is a engineer. +Ms. Daniella Murphy I, an manager, will be presenting the award. +Rocky Osinski is retiring as a manager. +Help me welcome our newest manager, Ms. Maybelline Powlowski. +Aliyah Lindgren PhD will be the new engineer for the team. +Bradley Hauck, an engineer, will be presenting the award. +Ramiro Kilback is a manager. +Help me welcome our newest manager, Colten Hermann. +Our latest new employee, Neva Hoppe, has been a manager in the industry for 4 years. +Ms. Stephania McGlynn PhD is a manager in the high tech industry. +Florencio Williamson has been a manager for 14 years. +Ruby Langworth will be the new engineer for the team. +Our latest new employee, Mr. Stevie Corkery, has been a manager in the industry for 4 years. +Birdie Herzog V joins us as an engineer on the Example project. +Mr. Boyd Harvey has been an engineer for over a decade. +Ms. Josianne Hauck I joins us as an manager on the Example project. +Help me welcome our newest manager, Jose Marquardt V. +Cullen Gutmann is a manager. +Mr. Ola Brown DVM is a engineer with Example Corp. +Blanca Gleichner has been a engineer for 14 years. +Mr. Evan Lesch is retiring as a manager. +Hazle Grimes has been a engineer for 14 years. +Mr. Ottis Walsh III is a manager with Example Corp. +Sigmund Nienow is retiring as a engineer. +Mr. Tyrel Hermiston DDS has been an engineer for over a decade. +Mr. Woodrow Stark is retiring as a engineer. +Twila Flatley will be the new engineer for the team. +Mr. Murl Howe DDS is a manager with Example Corp. +Kathryne Price has been an engineer for over a decade. +Ms. Hellen Lind IV has been a manager for 14 years. +Ms. Alyson Lehner, an manager, will be presenting the award. +Verda Hyatt is a manager. +Announcing engineer Viola Pacocha. +Lorenza Dietrich is a manager. +Ms. Lavada Runte II has been an manager for over a decade. +Doris Rohan, an manager, will be presenting the award. +Santina Sauer is retiring as a engineer. +Help me welcome our newest engineer, Adrianna Parisian. +Ms. Maurine Senger III is a engineer. +Ms. Delfina Murray II is retiring as a manager. +Jane Kilback is a engineer with Example Corp. +Our latest new employee, Mr. Kirk Braun DDS, has been a manager in the industry for 4 years. +Maynard Hills has been an manager for over a decade. +Announcing engineer Emmitt Marks. +Patience Hilll has been a manager for 14 years. +Dave Volkman, an engineer, will be presenting the award. +Sibyl Gleichner has been a manager for 14 years. +Ressie Koelpin is retiring as a manager. +Erwin Beer will be the new manager for the team. +Geovanni Goodwin is a manager with Example Corp. +Announcing manager Alexanne Mills. +Our latest new employee, Ms. Meaghan Kris DDS, has been a manager in the industry for 4 years. +Mr. Stanton Nicolas is a engineer in the high tech industry. +Elliot Welch is retiring as a engineer. +Mr. Mathew Schowalter joins us as an engineer on the Example project. +Announcing manager Ms. May Lowe MD. +Ms. Henriette Rau joins us as an manager on the Example project. +Reuben Wiza IV has been an engineer for over a decade. +Our latest new employee, Mr. Roman Bernhard, has been a engineer in the industry for 4 years. +Norval Breitenberg is a engineer. +Deshawn Gibson joins us as an engineer on the Example project. +Nola Corwin has been a engineer for 14 years. +Bernadine Beatty III has been a manager for 14 years. +Berneice Baumbach is a engineer with Example Corp. +Aaliyah Brown will be the new engineer for the team. +Mariana Mills is a engineer with Example Corp. +Our latest new employee, Filiberto Jenkins, has been a engineer in the industry for 4 years. +Our latest new employee, Madisen Bode, has been a manager in the industry for 4 years. +Brant Kuvalis Sr. has been an manager for over a decade. +Announcing manager Mr. Wiley Green. +Nova Padberg is a engineer in the high tech industry. +Help me welcome our newest engineer, Rosanna Carter. +Jacquelyn Rau is a manager in the high tech industry. +Mr. Gunner Kub I is retiring as a manager. +Our latest new employee, Roberto Spinka, has been a manager in the industry for 4 years. +Bettie Greenfelder is retiring as a engineer. +Our latest new employee, Ms. Nedra Towne, has been a manager in the industry for 4 years. +Ms. Amely Cartwright is a engineer in the high tech industry. +Our latest new employee, Ms. Joy Wiegand, has been a engineer in the industry for 4 years. +Announcing manager Kayley Moore DDS. +Our latest new employee, Philip Mayer, has been a manager in the industry for 4 years. +Ms. Mae Bartell, an manager, will be presenting the award. +Efren Paucek has been a manager for 14 years. +Help me welcome our newest manager, Mr. Marques Mayert DDS. +Zelma Zboncak joins us as an manager on the Example project. +Camila Buckridge, an manager, will be presenting the award. +Our latest new employee, Mr. Savion Trantow V, has been a engineer in the industry for 4 years. +Lonny Bahringer has been an engineer for over a decade. +Mr. Valentin Stehr has been a manager for 14 years. +Chanelle Willms, an engineer, will be presenting the award. +Help me welcome our newest manager, Holly Swaniawski V. +Eloy Bailey, an engineer, will be presenting the award. +Doris Buckridge will be the new engineer for the team. +Help me welcome our newest manager, Mr. Zackary Fahey MD. +Nella DuBuque is a manager. +Help me welcome our newest manager, Kenya Cronin. +Blanche Torp is a engineer with Example Corp. +Our latest new employee, Estevan Walsh, has been a engineer in the industry for 4 years. +Kurt Greenholt Sr. is a manager with Example Corp. +Beverly Torp is a manager. +Ms. Dorothea Hackett is a manager with Example Corp. +Brigitte Kunde will be the new engineer for the team. +Jackeline Harber has been an manager for over a decade. +Ms. Justine Deckow Sr. has been an engineer for over a decade. +Vicenta Rolfson joins us as an engineer on the Example project. +Holly Tremblay is a manager with Example Corp. +Emilio Windler, an manager, will be presenting the award. +Erin Beier is a engineer with Example Corp. +Help me welcome our newest manager, Kali Terry. +Mr. Aron Walsh is a manager with Example Corp. +Ms. Veronica Ankunding is a manager. +Amaya Adams PhD is a manager with Example Corp. +Milford Watsica II is retiring as a manager. +Ms. Prudence Harvey will be the new manager for the team. +Brice Schinner is a manager. +Kayden Witting will be the new engineer for the team. +Shad Beatty is retiring as a manager. +Ms. Sunny Braun DVM is a engineer in the high tech industry. +Ally Kiehn, an engineer, will be presenting the award. +Sierra Dietrich Sr., an manager, will be presenting the award. +Announcing engineer Diego Hoeger. +Allene Stokes will be the new engineer for the team. +Mr. Chaz Kemmer III is a manager in the high tech industry. +Announcing engineer Ms. Lurline Kessler II. +Carli Osinski is retiring as a manager. +Prince Kunze is a manager. +Jared Schoen has been an engineer for over a decade. +Help me welcome our newest engineer, Sven Lesch. +Alec Ernser has been an manager for over a decade. +Announcing engineer Jean Daniel. +Ambrose Hansen has been an engineer for over a decade. +Ms. Aubree Cruickshank, an engineer, will be presenting the award. +Ms. Aniya Doyle is a manager. +Help me welcome our newest manager, Julianne Weissnat. +Emanuel Friesen I is a manager in the high tech industry. +Ms. Trycia Schulist DDS is a engineer in the high tech industry. +Caesar Runolfsson II has been a manager for 14 years. +Torrance Blick joins us as an manager on the Example project. +Kailyn Ortiz is a engineer. +Mackenzie Farrell V, an engineer, will be presenting the award. +Cristian Quitzon III is a engineer in the high tech industry. +Josie O'Connell PhD is a manager. +Kristian Hermann will be the new engineer for the team. +Brady Halvorson is a engineer. +Foster Monahan is a manager in the high tech industry. +Mr. Aron Dietrich V is retiring as a manager. +Ms. Delilah Blick I is retiring as a manager. +Mr. Ulises Kuvalis IV will be the new manager for the team. +Ms. Kimberly Goodwin DDS has been an engineer for over a decade. +Help me welcome our newest engineer, Ms. Tia Kling III. +Mr. Jovanny Hoppe IV, an manager, will be presenting the award. +Mohamed Brekke I has been a manager for 14 years. +Dillan Jenkins will be the new manager for the team. +Alyce Willms will be the new engineer for the team. +Claudine Corkery, an manager, will be presenting the award. +Royal Krajcik has been a manager for 14 years. +Mr. Tyrese Erdman has been a engineer for 14 years. +Geo Reichel is retiring as a engineer. +Help me welcome our newest engineer, Euna Vandervort. +Anjali Moen, an manager, will be presenting the award. +Ms. Yvette Treutel PhD will be the new engineer for the team. +Our latest new employee, Kolby Yundt, has been a manager in the industry for 4 years. +Our latest new employee, Mr. Kelton Graham, has been a engineer in the industry for 4 years. +Don Corkery is retiring as a engineer. +Wilburn Stark, an engineer, will be presenting the award. +Estel Lesch has been a manager for 14 years. +Kara Hoeger Sr. has been a manager for 14 years. +Mr. Rhiannon Daugherty is a manager with Example Corp. +Mr. Diego Wolff joins us as an manager on the Example project. +Fay Hansen has been a manager for 14 years. +Imani Fritsch is retiring as a manager. +Our latest new employee, Derrick Fay, has been a manager in the industry for 4 years. +Newell Marks has been a manager for 14 years. +Lexie Koch is retiring as a engineer. +Irma Mayert has been an manager for over a decade. +Announcing engineer Schuyler Prosacco. +Madaline Trantow is a engineer with Example Corp. +Abbie Witting II will be the new engineer for the team. +Jocelyn Sawayn PhD joins us as an manager on the Example project. +Ms. Laisha Auer is a manager with Example Corp. +Our latest new employee, Gregoria Krajcik, has been a manager in the industry for 4 years. +Rosalind Considine is retiring as a engineer. +Noemie Howell has been a engineer for 14 years. +Micah Pollich is retiring as a engineer. +Mr. Jett Parisian DVM is retiring as a engineer. +Edythe Haley PhD joins us as an engineer on the Example project. +Our latest new employee, Carlos Breitenberg, has been a manager in the industry for 4 years. +Announcing engineer Lina Bayer DVM. +Ms. Ora Cremin is a manager in the high tech industry. +Announcing engineer Mr. Hilario Bogan. +Ramona Turcotte, an manager, will be presenting the award. +Elisabeth Sanford is retiring as a manager. +Our latest new employee, Telly Streich, has been a manager in the industry for 4 years. +Ms. Naomie Feest I joins us as an manager on the Example project. +Ariane Mayer is a engineer with Example Corp. +German Kuhlman IV is a engineer. +Announcing engineer Ruby Tremblay Sr.. +Ocie Pollich has been a manager for 14 years. +Jaqueline Bailey is a engineer with Example Corp. +Mr. Kyler VonRueden will be the new engineer for the team. +Cydney Stanton MD has been an engineer for over a decade. +Our latest new employee, Marjorie Ritchie, has been a engineer in the industry for 4 years. +Our latest new employee, Marjolaine Kuphal, has been a engineer in the industry for 4 years. +Our latest new employee, Jewell McDermott, has been a engineer in the industry for 4 years. +Help me welcome our newest engineer, Armand Batz. +Gudrun Moen is a engineer in the high tech industry. +Help me welcome our newest manager, Ms. Hilda Friesen. +Announcing engineer Annalise Kshlerin. +Josephine Thiel is a engineer with Example Corp. +Casper Towne III is a engineer with Example Corp. +Buster Lubowitz is a manager in the high tech industry. +Ms. Jazmin Schultz is a manager with Example Corp. +Mr. Austyn Schuppe is a manager with Example Corp. +Mr. Geovanni Wyman will be the new manager for the team. +Mr. Fletcher Rice will be the new manager for the team. +Carleton Stoltenberg, an engineer, will be presenting the award. +Evan Jaskolski DDS is a engineer. +Help me welcome our newest engineer, Ms. Mertie Collins. +Help me welcome our newest engineer, Marianna Pfannerstill Jr.. +Conor Wilderman has been an manager for over a decade. +Our latest new employee, Jordan Mann, has been a engineer in the industry for 4 years. +Mr. Mavis Gutkowski is retiring as a engineer. +Griffin Ratke Jr. has been an engineer for over a decade. +Dan Funk will be the new manager for the team. +Help me welcome our newest engineer, Rafael Denesik. +Our latest new employee, Jazmyne Runolfsson DDS, has been a engineer in the industry for 4 years. +Our latest new employee, Aurore Dach, has been a engineer in the industry for 4 years. +Help me welcome our newest manager, Alvah Gaylord. +Mr. Jerod Gleichner joins us as an engineer on the Example project. +Ms. Brisa Ledner is a manager in the high tech industry. +Ms. Rahsaan Stokes is retiring as a engineer. +Our latest new employee, Mr. Wyatt Stokes MD, has been a engineer in the industry for 4 years. +Help me welcome our newest engineer, Molly Smitham. +Madison Block has been a manager for 14 years. +Briana Dickens has been a engineer for 14 years. +Javonte Von has been an manager for over a decade. +Help me welcome our newest manager, Marley Erdman. +Luciano Christiansen will be the new manager for the team. +Skye Schinner is a engineer with Example Corp. +Announcing manager Icie Denesik. +Lulu Thiel is retiring as a engineer. +Deion Little has been an engineer for over a decade. +Help me welcome our newest manager, Serenity Davis MD. +Wilburn Muller is retiring as a manager. +Allen Jacobson is a manager in the high tech industry. +Ms. Jada Krajcik V joins us as an manager on the Example project. +Chester Klein is a manager. +Help me welcome our newest manager, Graciela Bailey. +Myrtice Bergnaum is a manager in the high tech industry. +Help me welcome our newest manager, Mr. Allan Howell. +Dolly Hagenes Jr. has been an engineer for over a decade. +Audreanne Beahan is a engineer in the high tech industry. +Kraig Kuvalis, an manager, will be presenting the award. +Fausto Stokes has been an engineer for over a decade. +Announcing manager Una Orn. +Ms. Yasmine Pfeffer, an engineer, will be presenting the award. +Announcing engineer Ms. Cassie Brakus. +Ora Lynch MD, an manager, will be presenting the award. +Viviane Botsford MD is a manager with Example Corp. +Jade Stamm is a manager with Example Corp. +Norene Keebler II joins us as an manager on the Example project. +Orlando Reilly has been a engineer for 14 years. +Announcing manager Ms. Gertrude Greenholt. +Zora Koelpin is a manager with Example Corp. +Help me welcome our newest manager, Everett Funk. +Anthony Connelly Jr. is a engineer in the high tech industry. +Ruthie Parker is retiring as a manager. +Orlo Zemlak will be the new engineer for the team. +Baylee Kirlin Sr. is a engineer. +Catharine Bosco has been an manager for over a decade. +Clotilde Kshlerin has been a engineer for 14 years. +Ms. Shanon Strosin PhD is a manager. +Kim Kub is a engineer. +Chase Walsh III is a manager in the high tech industry. +Ms. Dahlia Gleason is retiring as a manager. +Mr. Nelson Reilly has been an manager for over a decade. +Viola Schoen will be the new manager for the team. +Yesenia Jones has been a engineer for 14 years. +Lavinia Beier is a engineer with Example Corp. +Help me welcome our newest engineer, Marcella Wunsch. +Zelma Hirthe is retiring as a engineer. +Shany Borer is a engineer with Example Corp. +Eusebio Stroman has been a manager for 14 years. +Mr. Frankie Johnson V has been a engineer for 14 years. +Mr. Liam Gleason is retiring as a manager. +Moises Greenfelder II has been a engineer for 14 years. +Announcing manager Ms. Gretchen Corkery. +Ms. Hassie Haley Jr. will be the new manager for the team. +Haleigh Carter is a manager in the high tech industry. +Announcing manager Keara Schuster. +Christelle Armstrong will be the new engineer for the team. +Misael Hamill is retiring as a engineer. +Mr. Dillan Friesen joins us as an manager on the Example project. +Mr. Jaydon Mann IV, an engineer, will be presenting the award. +Audra Goodwin has been a engineer for 14 years. +Mr. Jovan Wilkinson, an engineer, will be presenting the award. +Meggie Kuhic has been a engineer for 14 years. +Maiya Lindgren is retiring as a manager. +Tanner Wolf has been a engineer for 14 years. +Tina Barton will be the new manager for the team. +Zola Swift is a engineer. +Verda Fisher is a engineer in the high tech industry. +Joesph Stroman Jr., an engineer, will be presenting the award. +Bart Pfannerstill joins us as an manager on the Example project. +Ms. Pattie Tremblay is a manager in the high tech industry. +Mr. Sigurd Schaden DVM has been a engineer for 14 years. +Abdiel Schumm has been a manager for 14 years. +Columbus Denesik is retiring as a engineer. +Mr. Demario Shields is a engineer in the high tech industry. +Yasmeen Lowe has been a manager for 14 years. +Help me welcome our newest engineer, Maryjane McGlynn PhD. +Ms. Flavie Rutherford is a engineer with Example Corp. +Alanis Wuckert is retiring as a manager. +Ms. Sophie Predovic has been a engineer for 14 years. +Selina Torp is a engineer with Example Corp. +Announcing engineer Melyssa Tromp DDS. +Adrain Rohan has been an manager for over a decade. +Help me welcome our newest manager, Ms. Elsa Stroman. +Constance Ebert has been an engineer for over a decade. +Our latest new employee, Abigayle Schiller, has been a manager in the industry for 4 years. +Announcing engineer Arden Flatley MD. +Leonor Jaskolski has been an engineer for over a decade. +Mr. Antone Skiles PhD will be the new engineer for the team. +Bert Balistreri V is a engineer. +Sierra Stark Jr. has been a engineer for 14 years. +Thad Kilback is a manager. +Ms. Sydni Klein IV will be the new manager for the team. +Owen Herman, an engineer, will be presenting the award. +Announcing manager Jaquelin Hodkiewicz. +Joel Corkery MD is a engineer. +Help me welcome our newest manager, Magnus Christiansen. +Ms. Verla Considine V, an engineer, will be presenting the award. +Mr. Gage Murazik PhD has been an engineer for over a decade. +Mr. Pedro Abshire, an manager, will be presenting the award. +Ms. Frances Schiller joins us as an engineer on the Example project. +Our latest new employee, May Casper, has been a engineer in the industry for 4 years. +Christiana Towne will be the new engineer for the team. +Announcing manager Lester Beier. +Our latest new employee, Juwan Crooks, has been a manager in the industry for 4 years. +Brown Borer Sr. will be the new engineer for the team. +Help me welcome our newest manager, Gregory Funk V. +Ms. Alaina Altenwerth is a manager with Example Corp. +Ms. Aylin Auer is a engineer with Example Corp. +Mr. Isac Buckridge joins us as an engineer on the Example project. +Mr. Morgan Kilback DVM is a manager with Example Corp. +Our latest new employee, Rasheed Casper, has been a manager in the industry for 4 years. +Jennyfer Walker has been an engineer for over a decade. +Announcing manager Shaun Fay. +Ms. Thalia Weissnat will be the new engineer for the team. +Hoyt Balistreri is retiring as a manager. +Mr. Ronny Sipes will be the new engineer for the team. +Jailyn Hoppe has been an engineer for over a decade. +Maximillian Howe, an engineer, will be presenting the award. +Announcing engineer Mr. Sofia Hills. +Help me welcome our newest manager, Catharine Kunde. +Announcing engineer Ms. Bryana Kreiger IV. +Help me welcome our newest engineer, Lavonne Reinger. +Albert Keeling has been an engineer for over a decade. +Ms. Taya Feest III is a engineer with Example Corp. +Maida Daugherty is a manager. +Myra Heathcote is retiring as a engineer. +Brooke Price, an manager, will be presenting the award. +Mr. Kale Watsica is a engineer in the high tech industry. +Our latest new employee, Abbigail Wiza III, has been a manager in the industry for 4 years. +Jaron Dickinson is retiring as a engineer. +Announcing manager Angus Senger. +Help me welcome our newest manager, Ms. Abbie Aufderhar. +Ms. Josefina Stark III has been an engineer for over a decade. +Craig Osinski is a manager with Example Corp. +Lenny Mayer DDS is a engineer with Example Corp. +Mireya Wilderman, an engineer, will be presenting the award. +Marianne Wiegand is retiring as a manager. +Hilario Schumm has been a engineer for 14 years. +Mr. Myron Dare is retiring as a engineer. +Micaela Ryan MD has been an engineer for over a decade. +Emmett Becker, an manager, will be presenting the award. +Jamey Wolf will be the new engineer for the team. +Lue Dooley, an manager, will be presenting the award. +Shaun Kris will be the new manager for the team. +Ms. Imogene Ledner DVM joins us as an manager on the Example project. +Help me welcome our newest engineer, Neil Connelly. +Help me welcome our newest engineer, Mr. Rudy Volkman. +Patricia O'Reilly, an engineer, will be presenting the award. +Mr. Jarred Treutel V is a engineer. +Mr. Omari Murazik I is retiring as a engineer. +Albin Lockman will be the new manager for the team. +Help me welcome our newest manager, Ms. Nona Grady. +Our latest new employee, Terrence Murphy, has been a manager in the industry for 4 years. +Mr. Madyson Deckow is a manager in the high tech industry. +Ms. Carissa Kling has been a engineer for 14 years. +Help me welcome our newest engineer, Mr. Fredy Bogisich. +Reanna Wuckert is retiring as a engineer. +Angie Nolan is a manager in the high tech industry. +Virginie Braun will be the new engineer for the team. +Jarred Flatley, an engineer, will be presenting the award. +Our latest new employee, Ms. Leora Kihn II, has been a manager in the industry for 4 years. +Announcing engineer Cathrine Kovacek. +Our latest new employee, Wilmer Becker, has been a manager in the industry for 4 years. +Missouri Franecki is a engineer with Example Corp. +Mekhi Donnelly PhD has been an manager for over a decade. +Ms. Willow Towne I has been an manager for over a decade. +Jaylon Rippin will be the new manager for the team. +Alanis Hettinger has been a engineer for 14 years. +Ms. Felicita Becker DVM has been an engineer for over a decade. +Zelda Daniel is retiring as a manager. +Mr. Emil Jast IV joins us as an manager on the Example project. +Kian Satterfield is a manager in the high tech industry. +Mr. Cooper Dooley joins us as an engineer on the Example project. diff --git a/internal/service/comprehend/test-fixtures/entity_recognizer/entitylist.csv b/internal/service/comprehend/test-fixtures/entity_recognizer/entitylist.csv index f1080f9213fc..851ce28ef43a 100644 --- a/internal/service/comprehend/test-fixtures/entity_recognizer/entitylist.csv +++ b/internal/service/comprehend/test-fixtures/entity_recognizer/entitylist.csv @@ -1,1001 +1,1001 @@ Text,Type -Gerson Parker,MANAGER -Nickolas Little,MANAGER -Alejandra Stiedemann V,MANAGER -Eunice Leannon,MANAGER -Sunny Schmitt,ENGINEER -Anika Gutkowski,ENGINEER -Delaney Fisher,ENGINEER -Christian Maggio,ENGINEER -Mathias Hettinger I,MANAGER -Elias Quitzon,MANAGER -Alexandra Wunsch,MANAGER -Guido Kemmer,ENGINEER -Sim Kemmer,MANAGER -Vincenza Kertzmann,MANAGER -Skye Kuhn Jr.,ENGINEER -Kasandra Cartwright MD,MANAGER -Ettie Schimmel,MANAGER -Karlee McCullough Jr.,MANAGER -Adeline Johnson,MANAGER -Cory Morissette,MANAGER -Brandy Abshire,MANAGER -Jerome Homenick,ENGINEER -Ms. Doris Ziemann,MANAGER -Ms. Marlene Larkin,ENGINEER -Amos Kuhlman,MANAGER -Ana Ortiz II,MANAGER -Jewell Konopelski,MANAGER -Larry Effertz,ENGINEER -Ms. Vernice Fay,ENGINEER -Miss Dion Ratke,MANAGER -Rachelle Lubowitz,MANAGER -Rachael Moore,MANAGER -Sabrina Walsh,ENGINEER -Tamara Nicolas,MANAGER -Martin Lynch Sr.,MANAGER -Kaya Wisozk,MANAGER -Mrs. Cassandra Robel,ENGINEER -Donny Schroeder,MANAGER -Emmanuel Fay,MANAGER -Jefferey Adams,ENGINEER -Godfrey Feest V,MANAGER -Melyna Mertz,MANAGER -Audreanne Wiza,MANAGER -Jarvis O'Conner,MANAGER -Mertie Sanford,MANAGER -Keshaun Altenwerth,ENGINEER -Aric Beier Sr.,ENGINEER -Hoyt Rowe MD,ENGINEER -Aurelia Hintz,ENGINEER -Keon Stanton,MANAGER -Candace Wiegand,MANAGER -Flavio Smith,MANAGER -Mr. Zachery Toy,MANAGER -Kaleigh Murazik,ENGINEER -Pattie Kuvalis,ENGINEER -Serena Heidenreich,ENGINEER -Simone Little,MANAGER -Ms. Carolina Mante,ENGINEER -Julia Lemke,MANAGER -Mrs. Meagan Fisher,MANAGER -Molly Goldner,ENGINEER -Mrs. Dax McGlynn,MANAGER -Tyrique Harber,ENGINEER -Mia Larkin II,MANAGER -Winona Schoen,MANAGER -Dr. Antonette Cummings,ENGINEER -Mr. Sonya Cassin,MANAGER -Timothy Bartoletti DDS,MANAGER -Winifred Reinger,ENGINEER -Marcella Bahringer,ENGINEER -Rhea Kohler,ENGINEER -Alia McCullough,ENGINEER -Mr. Israel Gulgowski,ENGINEER -Jana Wilkinson,ENGINEER -Marjory Fay,MANAGER -Alena Mueller,ENGINEER -Kristian Keebler,ENGINEER -Katheryn Dietrich,MANAGER -Mya Grady,MANAGER -Kyra Heidenreich V,ENGINEER -Dr. Cortez Thiel,MANAGER -Shyanne Hirthe,ENGINEER -Herta Mohr,ENGINEER -Winfield Thompson,ENGINEER -Miss Bette Dooley,MANAGER -Mrs. Freida Shanahan,ENGINEER -Sunny Towne,MANAGER -Kayley Schneider,ENGINEER -Anderson Hagenes,MANAGER -Barrett Paucek Jr.,MANAGER -Lillian Koss,ENGINEER -Lance Zieme,ENGINEER -Van Hackett,ENGINEER -Cullen Schamberger,ENGINEER -Arvel Stanton,MANAGER -Nedra Goldner,MANAGER -Ms. Zetta Lindgren,MANAGER -Faye Ledner,ENGINEER -Trystan Hilll PhD,MANAGER -Arnold Hermann Jr.,ENGINEER -Hank Towne,MANAGER -Monroe Schmeler,MANAGER -Genesis Wintheiser II,ENGINEER -Angie O'Reilly,MANAGER -Deshawn Reinger,MANAGER -Mrs. Molly Lowe,ENGINEER -Kimberly Osinski,MANAGER -Napoleon Sauer,ENGINEER -Leonardo Champlin,MANAGER -Anita Bartell,MANAGER -Mrs. Jennifer Buckridge,MANAGER -Patrick Gulgowski,MANAGER -Miss Brooks Christiansen,MANAGER -Ms. Alejandra Shields,ENGINEER -Callie Lynch,ENGINEER -Hyman Bruen,ENGINEER -Ms. Lera Grant,ENGINEER -Laney West V,MANAGER -Shyanne Price,ENGINEER -Leanna Schoen,ENGINEER -Clement Bayer,ENGINEER -Mrs. Colt Kozey,MANAGER -Dr. Logan Dickinson,ENGINEER -Valentin Torp,MANAGER -Kathlyn Bechtelar,MANAGER -Vita Pollich,ENGINEER -Benedict Flatley,MANAGER -Dedrick Corkery V,MANAGER -Shea Kohler,ENGINEER -Tiana Mertz,ENGINEER -Margarett Kunze,ENGINEER -Alan Bashirian,MANAGER -Dr. Precious Murazik,MANAGER -Ms. Karine Langosh,ENGINEER -Letha Skiles,ENGINEER -Nikko Dooley,ENGINEER -Filomena McKenzie,ENGINEER -Rosario Grant Sr.,ENGINEER -Gonzalo Douglas V,ENGINEER -Lempi Pollich,ENGINEER -Candida O'Reilly Sr.,ENGINEER -Dena Lind,ENGINEER -Blair Renner,MANAGER -Imani Roob,MANAGER -Miss Drake Johns,MANAGER -Murl Jacobi,MANAGER -Nicolette Prohaska,MANAGER -Leif Quigley,MANAGER -Hugh Gleichner III,MANAGER -Neil Witting,MANAGER -Ivah Moore,ENGINEER -Amira Bruen,ENGINEER -Loy Kerluke,ENGINEER -Cleta Berge,MANAGER -Asa Schaden,ENGINEER -Marlin Nitzsche,ENGINEER -Mellie Hansen,ENGINEER -Pauline Willms,MANAGER -Giovanna Marquardt,MANAGER -Kristian Conroy IV,MANAGER -Aiyana Hagenes,ENGINEER -Melisa Barton Jr.,MANAGER -Robbie Bechtelar,MANAGER -Citlalli Lind,ENGINEER -Karlee Lubowitz,MANAGER -Isidro Jerde,ENGINEER -Conor Lemke,MANAGER -Murphy Rutherford,MANAGER -Omari Schultz,MANAGER -Selmer Labadie,MANAGER -Alverta Hilpert,MANAGER -Ali Dooley III,ENGINEER -Benjamin Lubowitz,MANAGER -Trenton Hilll,MANAGER -Bethel Carroll,ENGINEER -Nick Lang,MANAGER -Ms. Chase Graham,MANAGER -Melany Buckridge PhD,ENGINEER -Ursula McGlynn,ENGINEER -Jackie Kshlerin,MANAGER -Jarvis Langosh,ENGINEER -Bonnie Bednar,MANAGER -Simeon Dickinson,ENGINEER -Annamarie VonRueden MD,MANAGER -Ms. Hilton Hagenes,ENGINEER -Jaqueline D'Amore,MANAGER -Mario Bartell,MANAGER -Frances Kovacek,MANAGER -Avery Lakin,MANAGER -Brittany Flatley DDS,ENGINEER -Violette Sauer,MANAGER -Dorothy Farrell,ENGINEER -Miss Jordan Crooks,MANAGER -Jadyn West,MANAGER -Mrs. Johanna Borer,ENGINEER -Elyssa Crist,ENGINEER -Carli Kohler,MANAGER -Dasia Dare,ENGINEER -Lane Rath,MANAGER -Davion Kunze,ENGINEER -Vada Stoltenberg,ENGINEER -London Hagenes,ENGINEER -Albin Wintheiser,MANAGER -Mr. Eloise Jones,ENGINEER -Rashawn Bechtelar,MANAGER -Linwood Casper,ENGINEER -Mr. Phyllis O'Reilly,MANAGER -Carrie Franecki,MANAGER -Mikel Daugherty I,MANAGER -Jorge Connelly IV,MANAGER -Victor Cummings,MANAGER -Felton Kris,MANAGER -Barney Klein,MANAGER -Verdie Strosin,MANAGER -Izabella Vandervort DDS,ENGINEER -Philip Hodkiewicz,MANAGER -Mr. Carol Orn,MANAGER -Ursula Cormier,MANAGER -Ellen Hudson,ENGINEER -Bobby Conn II,ENGINEER -Mathilde Bayer,ENGINEER -Ms. Marcus Ferry,ENGINEER -Tyshawn Volkman,MANAGER -Ladarius Predovic,ENGINEER -Ally Parisian,MANAGER -Briana Reinger,MANAGER -Piper Kutch,MANAGER -Armand Ratke,MANAGER -Stephon McLaughlin DDS,ENGINEER -Cordell Cole,ENGINEER -Earl Altenwerth,ENGINEER -Garrison Lang Jr.,MANAGER -Ahmad Heaney,ENGINEER -Jed Pollich,MANAGER -Hudson Wyman,MANAGER -Dena Crist DVM,ENGINEER -Gino Auer III,MANAGER -Miss Xavier Farrell,MANAGER -Lawrence Considine,ENGINEER -Coby Lesch,ENGINEER -Hardy Mohr,MANAGER -Dr. Tamara Ryan,MANAGER -Alia Quigley PhD,ENGINEER -Noelia Bergnaum,ENGINEER -Dakota Brown,ENGINEER -Elmo Rogahn,ENGINEER -Roxanne Weimann,MANAGER -Gay Langworth,MANAGER -Ellis Ledner,ENGINEER -Weston Murazik,ENGINEER -Josefa Sauer,MANAGER -Ilene Wyman,MANAGER -Nia Gottlieb,MANAGER -Crawford Wehner,MANAGER -Brenna Ritchie,MANAGER -Ms. Mariah Hudson,MANAGER -Tyra Schneider Sr.,MANAGER -Andreane Johns,MANAGER -Mrs. Mabel Rice,ENGINEER -Emelia Jaskolski PhD,ENGINEER -Spencer Cole II,ENGINEER -Doris Stokes,MANAGER -Lilian Erdman,ENGINEER -Ms. Ramona Torp,MANAGER -Ms. Lauryn Stark,MANAGER -Israel Greenholt,ENGINEER -Ms. Boris Leannon,MANAGER -Pearlie Swaniawski,MANAGER -Delores Kilback,MANAGER -Mariam Schultz,ENGINEER -Dimitri Mueller IV,MANAGER -Maud Beahan,MANAGER -Fletcher Predovic DVM,ENGINEER -Mrs. Joanne Aufderhar,ENGINEER -Miss Paul Lowe,ENGINEER -Johnpaul Swift,MANAGER -Miss Rowena Pouros,ENGINEER -Benjamin Jenkins,ENGINEER -Erwin Jenkins,MANAGER -Ms. Zula Turner,ENGINEER -Rhiannon Lind,MANAGER -Mrs. Garth Labadie,MANAGER -Mia King,MANAGER -Ewald Cronin,ENGINEER -Carrie Roob III,MANAGER -Clementina Schmeler,MANAGER -Stewart Sipes II,ENGINEER -Katelin D'Amore,MANAGER -Verlie Wiegand,MANAGER -Marie Schaefer,ENGINEER -Tillman Boehm,ENGINEER -Jacklyn Kohler,MANAGER -Katrine Bruen,MANAGER -Lisa Gaylord,ENGINEER -Virginia Ruecker,ENGINEER -Mrs. Garnett Christiansen,ENGINEER -Anderson Weissnat,ENGINEER -Marie Armstrong,ENGINEER -Prudence Fahey V,ENGINEER -Bria Medhurst,MANAGER -Ms. Dewitt Bernhard,ENGINEER -Stanford Miller,MANAGER -Freddie Treutel,MANAGER -Oceane Bayer,MANAGER -Ms. Adalberto Lindgren,MANAGER -Meagan Bartoletti,MANAGER -Wilhelm Kutch,ENGINEER -Khalid Farrell Sr.,MANAGER -Ms. Allison Zemlak,ENGINEER -Judson Rodriguez MD,MANAGER -Mr. Alena Stanton,MANAGER -Kaylin Kohler,ENGINEER -Melany Price,ENGINEER -Palma Brekke,MANAGER -Ozella Larson,MANAGER -Earnestine Sanford,ENGINEER -Kathryne Tromp,ENGINEER -Ted Abernathy,MANAGER -Nelle Waters,ENGINEER -Dawn Kautzer,ENGINEER -Ms. Itzel Breitenberg,ENGINEER -Meta Gibson,MANAGER -Haven Nitzsche,ENGINEER -Antonetta Kilback I,MANAGER -Kiara Zboncak,MANAGER -Leola Kris,ENGINEER -Mr. Conrad Hills,MANAGER -Alize Rogahn,ENGINEER -Rudy Hamill,MANAGER -Ms. Celestino Turcotte,MANAGER -Ms. Annetta Stracke,MANAGER -Hailie Hudson,ENGINEER -Mrs. Deven Moen,MANAGER -Callie Larson,MANAGER -Quentin Morar,ENGINEER -Antonietta Kuhlman II,MANAGER -Cristal Shanahan DVM,MANAGER -Cristopher Boyer,ENGINEER -Keely Larkin,ENGINEER -Royce Berge,ENGINEER -Benjamin Hilll,ENGINEER -Rashawn Bogan,MANAGER -Ted Collier,MANAGER -Alene Corwin,MANAGER -David Hodkiewicz,MANAGER -Garland Kuhic,MANAGER -Sonya Wilderman,MANAGER -Quinn Bradtke Jr.,MANAGER -Ellen Cummerata,ENGINEER -Mason Beatty,MANAGER -Camylle Muller,MANAGER -Hadley Upton,ENGINEER -Keara Pfeffer,ENGINEER -Angie Walsh,MANAGER -Earl Cummings,MANAGER -Ephraim Marks,ENGINEER -Orval Reichert DDS,ENGINEER -Katheryn Gleichner,ENGINEER -Jalyn Fay I,ENGINEER -Virginia Keebler DVM,ENGINEER -Raphael Leffler,ENGINEER -Juliana Stokes,MANAGER -Casper Herman,MANAGER -Vladimir Reilly,MANAGER -Erin Okuneva,MANAGER -Martine White,MANAGER -Tristian Mertz,MANAGER -Mr. Sammy Schmitt,ENGINEER -Alec Schuster,MANAGER -Ms. Lorenza Walsh,ENGINEER -Eldora Mayert,ENGINEER -Justina Breitenberg,MANAGER -Mariela Grady Jr.,ENGINEER -Kevon Baumbach,MANAGER -Wendell Hayes,ENGINEER -Pat Aufderhar,ENGINEER -Bart Senger,MANAGER -Kaitlyn Hahn,ENGINEER -Mrs. Else Kozey,MANAGER -Mr. Ashton Batz,ENGINEER -Lilly Koepp,ENGINEER -Mrs. Alfredo Cormier,MANAGER -Gail Swaniawski DVM,ENGINEER -Mrs. Valentina Wilderman,ENGINEER -Paxton Doyle,ENGINEER -Jarret Block PhD,MANAGER -Arnaldo Blanda,MANAGER -Aiden Orn,MANAGER -Florine West,MANAGER -Sincere Harber,MANAGER -Joan Ziemann,ENGINEER -Katelyn Schultz,ENGINEER -Maximus Gleichner,MANAGER -Elenor Schuster,MANAGER -Marcelino Kautzer,ENGINEER -Lea Schulist Sr.,ENGINEER -Jeanne Carter MD,MANAGER -Kayleigh Goldner DDS,ENGINEER -Hilario Denesik I,MANAGER -Shirley Reichert,MANAGER -Kris Dickens,ENGINEER -Gene Frami,MANAGER -Sadye Jacobson,MANAGER -Buck Cremin,ENGINEER -Coty Lesch,ENGINEER -Dr. Kim Mertz,ENGINEER -Randy Sanford,MANAGER -Levi Kirlin,MANAGER -Davin Yundt,ENGINEER -Enola Bins,ENGINEER -Trent Kuvalis,ENGINEER -Jake Powlowski,ENGINEER -Ms. Ashlee Emmerich,MANAGER -Hannah Davis,ENGINEER -Wayne Champlin,ENGINEER -Nikki Conn Jr.,MANAGER -Carli Bauch,ENGINEER -Norbert Feest,MANAGER -Robbie Wintheiser,ENGINEER -Leta Abshire,ENGINEER -Fannie Walker,ENGINEER -Heber Wilkinson,MANAGER -Willie Bernier III,MANAGER -Orlando Price,ENGINEER -Brandt Schowalter,MANAGER -Mohammed Stokes,ENGINEER -Isai Mraz,ENGINEER -Kadin Lemke,MANAGER -Maribel Jerde,MANAGER -Myrna Kessler,MANAGER -Meredith Tremblay,ENGINEER -Mr. Jerad Schneider,ENGINEER -Lenny Pfeffer,MANAGER -Carolyne Klocko DVM,MANAGER -Monica Schulist,ENGINEER -Anika Larson V,MANAGER -Domenick Pacocha,ENGINEER -Miss Harmon Pfannerstill,ENGINEER -Mr. Annabell Pouros,MANAGER -Dr. Brisa Stroman,MANAGER -Jade Stoltenberg,MANAGER -Miss Mario Wolff,ENGINEER -Ms. Savannah Gaylord,MANAGER -Dejah Jones,MANAGER -Hector Kulas,MANAGER -Graciela Goodwin,MANAGER -Jocelyn Sauer,MANAGER -Miss Lew Hansen,MANAGER -Fannie Fay DDS,ENGINEER -Dr. Jordan Klocko,ENGINEER -Kathlyn Lynch,MANAGER -Leann Botsford,ENGINEER -Ervin Larson,MANAGER -Allie Von,MANAGER -Johanna Kohler III,MANAGER -Hilbert Armstrong,ENGINEER -Tanner Balistreri IV,MANAGER -Abagail Shields,ENGINEER -Gia Cremin,ENGINEER -Mrs. Buford Oberbrunner,ENGINEER -Madelyn White,MANAGER -Abdullah Effertz,MANAGER -Reva Stark,ENGINEER -Camryn McKenzie,MANAGER -Juwan Pouros,MANAGER -Gene Cassin,MANAGER -Felicia Kunde,ENGINEER -Jeremie Anderson,MANAGER -Katheryn Hickle Jr.,MANAGER -Edwina Hamill IV,MANAGER -Adriana Cassin DVM,MANAGER -Nelda Rowe,ENGINEER -Rodrigo Kulas V,ENGINEER -Jaiden Williamson,MANAGER -Cristopher Williamson,MANAGER -Mr. Jay Krajcik,ENGINEER -Francesco Miller,MANAGER -Brenna Reinger,MANAGER -Mr. Mollie Stanton,MANAGER -Coby Schowalter,ENGINEER -Estefania Armstrong II,MANAGER -Aimee Nienow,ENGINEER -Kimberly Batz,ENGINEER -Miss Sienna Pfannerstill,ENGINEER -Johnathon Hammes,ENGINEER -Julien Hansen,MANAGER -Mrs. Emerson Waelchi,MANAGER -Malcolm Streich,MANAGER -Aurelio Lebsack,ENGINEER -Juana Grady,ENGINEER -Kiel Lakin,MANAGER -Sarai Keeling,ENGINEER -Emilia Crona,ENGINEER -Georgianna Kris,MANAGER -Maida Heller,MANAGER -Jena Feeney,ENGINEER -Mabelle Keeling,MANAGER -Chris Bergstrom,ENGINEER -Audrey Block DDS,ENGINEER -Louvenia Kuhn,ENGINEER -Thomas O'Keefe,MANAGER -Darby Klocko,MANAGER -Arlene Weimann,MANAGER -Corbin Jones MD,ENGINEER -Lamar Mraz,ENGINEER -Miss Onie Krajcik,MANAGER -Kamille Schaefer,MANAGER -Jack Borer,ENGINEER -Reese Heaney,MANAGER -Ilene Kovacek,ENGINEER -Trace Bailey,ENGINEER -Wava Donnelly,ENGINEER -Mona Lakin,MANAGER -Weldon Heaney,MANAGER -Norris Labadie,ENGINEER -Bridgette Brown,MANAGER -Osborne Kertzmann,MANAGER -Verlie Bruen,ENGINEER -Enrique Ullrich,ENGINEER -Dr. Asia Purdy,ENGINEER -Lindsey Predovic DDS,MANAGER -Maxine Mosciski,MANAGER -Sydni Stoltenberg,ENGINEER -Paige Buckridge,ENGINEER -Miss Laverne Dach,MANAGER -Murl Abshire,MANAGER -Lou Friesen,MANAGER -Keenan Fahey,ENGINEER -Ashleigh Schultz,ENGINEER -Mrs. Keshaun Lesch,ENGINEER -Jeffrey Langosh,ENGINEER -Mckenzie Boyle,ENGINEER -Hipolito Price PhD,MANAGER -Lesley Adams III,ENGINEER -Mya Howe,ENGINEER -Nick Kutch Sr.,MANAGER -Ms. Winfield Wilkinson,ENGINEER -Leopold Schulist,ENGINEER -Orval Prosacco,ENGINEER -Wilmer Mueller,MANAGER -Karina Batz,MANAGER -Luigi Abbott,MANAGER -Pamela Miller,MANAGER -Emelie Marquardt,ENGINEER -Zola Beier,MANAGER -Mr. Elva Ritchie,ENGINEER -Mrs. Otis Quitzon,MANAGER -Dr. Willow Jacobs,MANAGER -Cathryn Koss,MANAGER -Ms. Alivia Ernser,MANAGER -Timothy Mohr,ENGINEER -Mrs. Jaylan Wuckert,MANAGER -Emerald Waelchi,ENGINEER -Vernon Heathcote,MANAGER -Lavinia Ruecker,ENGINEER -Mr. Quinn Altenwerth,MANAGER -Alejandra Marks,MANAGER -Mr. Leo Wuckert,MANAGER -Jayce Schiller MD,MANAGER -Elenora Ebert Jr.,ENGINEER -Dr. Rose Wyman,MANAGER -Wade Orn,MANAGER -Iva Marks Sr.,MANAGER -Margaret Pouros,MANAGER -Barton Deckow,MANAGER -Miss Lesly Balistreri,ENGINEER -Mr. Jacquelyn Reynolds,ENGINEER -Doyle Heidenreich,MANAGER -Heidi Ruecker,ENGINEER -Mr. Alvis Moen,MANAGER -Dr. Garnet Brown,ENGINEER -Yolanda Beier,ENGINEER -Soledad Macejkovic,ENGINEER -Urban Lowe,ENGINEER -Devyn Schmidt,MANAGER -Barbara Flatley,MANAGER -Patsy Sanford PhD,ENGINEER -Mrs. Rubye Blanda,ENGINEER -Caleigh Klocko,ENGINEER -Kali Dietrich,MANAGER -Ms. Weldon Hudson,ENGINEER -Vallie Huel,ENGINEER -Sven O'Keefe III,ENGINEER -Gerardo Wehner Sr.,ENGINEER -Kyle Kirlin,MANAGER -Marianne Berge Jr.,ENGINEER -Ms. Cristal Connelly,MANAGER -Kailey Spinka,MANAGER -Jeremie Morar,MANAGER -Daija Lind,ENGINEER -Arvel McDermott,ENGINEER -Dr. Nicholas Gorczany,MANAGER -Anne Leuschke,MANAGER -Gerda Cronin,ENGINEER -Ms. Coty Rolfson,ENGINEER -Kareem Gerhold,ENGINEER -Mrs. Nico Mann,ENGINEER -Corbin Bartell,ENGINEER -Theresa Gulgowski,MANAGER -Carmelo Boyer,MANAGER -Elinore Schulist III,MANAGER -Katarina Schultz,MANAGER -Deven Rodriguez II,MANAGER -Miss Bruce Friesen,MANAGER -Marcelle Schowalter,MANAGER -Albertha Murphy PhD,MANAGER -Elmore Doyle,ENGINEER -Reymundo Jaskolski,ENGINEER -Stephania Swaniawski I,MANAGER -Stewart Veum,MANAGER -Nathanael Bartell,MANAGER -Retha Rempel,ENGINEER -Isidro Aufderhar,MANAGER -Florencio Mohr,MANAGER -Zella Weimann,ENGINEER -Khalid Macejkovic,ENGINEER -Geraldine Torp,ENGINEER -Presley Marks,ENGINEER -Mrs. Eve Bartoletti,ENGINEER -Corine Schimmel,MANAGER -Citlalli Goldner DDS,MANAGER -Zakary Botsford,MANAGER -Florida Reilly,ENGINEER -Mr. Patsy Doyle,MANAGER -Emily Hayes II,ENGINEER -Dr. Johann Turcotte,ENGINEER -Dr. Darion Dietrich,ENGINEER -Norris Brekke,MANAGER -Janessa Marquardt,MANAGER -Felicita Wintheiser MD,MANAGER -Melyssa Muller,ENGINEER -Vivienne Weissnat DDS,ENGINEER -Ford Gerlach,ENGINEER -Keenan Kertzmann,ENGINEER -Tobin Goyette,ENGINEER -Cecilia Green,MANAGER -Abe Fisher,MANAGER -Mrs. Annabell Morissette,MANAGER -Danny Kautzer III,MANAGER -Gerard Cruickshank,ENGINEER -Joy Okuneva DDS,MANAGER -Ezequiel Macejkovic,ENGINEER -Vernie Bradtke IV,ENGINEER -Trycia Muller,ENGINEER -Clotilde Ankunding,ENGINEER -Mr. Chaya Abshire,ENGINEER -Hanna Roob,MANAGER -Ronny Dietrich,ENGINEER -Derek Durgan DVM,MANAGER -Demetrius West,MANAGER -Macey Nikolaus,MANAGER -Edison Gottlieb III,MANAGER -Bo Collins,ENGINEER -Michaela Pagac PhD,MANAGER -Mireille Kunde I,ENGINEER -Duncan Kulas,MANAGER -Mrs. Xzavier Smitham,ENGINEER -Mr. Adrianna Baumbach,MANAGER -Shad Rolfson,MANAGER -Mr. Dimitri Baumbach,MANAGER -Samara Schultz,MANAGER -Mrs. Brant Kautzer,MANAGER -Tierra Greenholt,ENGINEER -Otho Kub,MANAGER -Ana Harber,MANAGER -Ted Mertz Sr.,ENGINEER -Uriel Zieme,MANAGER -Mr. Adaline Wolff,ENGINEER -Mrs. Maurice Senger,MANAGER -Ada Gleason,MANAGER -Edwina Bernier DVM,ENGINEER -Elva Homenick,ENGINEER -Mrs. Shane Powlowski,MANAGER -Obie Nikolaus,MANAGER -Ottis Jakubowski,MANAGER -Mr. Armand Leannon,ENGINEER -Jaime Kuvalis,ENGINEER -Loyce VonRueden Jr.,ENGINEER -Evangeline Johns,MANAGER -Federico Halvorson,MANAGER -Sylvester Gerlach,MANAGER -Ashly Wunsch V,MANAGER -Rowland Miller,MANAGER -Bryon Kunde,MANAGER -Denis Ernser,ENGINEER -Jovanny O'Reilly DVM,ENGINEER -Lazaro Hermiston,MANAGER -Kelly Stehr,ENGINEER -Oda Fadel,ENGINEER -Percival Armstrong,ENGINEER -Caleigh Schimmel,MANAGER -Tyrique Pfeffer,ENGINEER -Adell Leuschke,ENGINEER -Dr. Cade Farrell,ENGINEER -Gisselle Doyle,MANAGER -Lily Reinger,MANAGER -Jeffrey Gleason,ENGINEER -Tad Huel,ENGINEER -Connor Conn,MANAGER -Mr. Cathrine Casper,ENGINEER -Dr. Beryl Rempel,MANAGER -Carlie Steuber,MANAGER -Rose Frami IV,ENGINEER -Mr. Tyrel Pagac,MANAGER -Morton Trantow,ENGINEER -Lola Ortiz,MANAGER -Kelton Champlin,MANAGER -Owen Mayert,ENGINEER -Johnny Witting,MANAGER -Thea Rolfson,MANAGER -Reanna Schmidt,ENGINEER -Ian Stehr,MANAGER -Mr. Patsy Purdy,MANAGER -Brady Ritchie,ENGINEER -Thea Effertz,MANAGER -Gerry Veum,ENGINEER -Corene Adams,MANAGER -Julian Kutch,MANAGER -Mrs. Joe Connelly,ENGINEER -Adolphus Paucek,MANAGER -Jasmin Ledner II,ENGINEER -Dr. Osbaldo Beatty,ENGINEER -Dr. Mckenna Haag,MANAGER -Abdiel Connelly DVM,ENGINEER -Liliana Baumbach III,MANAGER -Willard Kuvalis V,ENGINEER -Carolyn Jaskolski Jr.,MANAGER -Reta Franecki,ENGINEER -Percival O'Kon,ENGINEER -Kamryn Rath,MANAGER -Hailey Dooley,MANAGER -Mrs. Brycen West,ENGINEER -Margarette Miller,MANAGER -Cristian Pagac,MANAGER -Rosalee Bechtelar,MANAGER -Lessie Lesch,MANAGER -Iva Hegmann,MANAGER -Hallie Schroeder,MANAGER -Mr. Lola Volkman,ENGINEER -Arianna Wolf DDS,MANAGER -Elliot Trantow,MANAGER -Darrion Rath PhD,ENGINEER -Coralie Effertz V,ENGINEER -Ms. Corrine Effertz,ENGINEER -Ellie Keebler,ENGINEER -Tyrese Pfeffer,ENGINEER -Jayce Roberts,MANAGER -Isobel Veum,ENGINEER -Raphaelle Breitenberg,ENGINEER -Maudie Labadie I,ENGINEER -Rosario Langosh MD,ENGINEER -Raheem Mohr,MANAGER -Avery Lind,ENGINEER -Nichole Waters,ENGINEER -Blaise Gislason I,MANAGER -Everette D'Amore,ENGINEER -Darwin Conroy,MANAGER -Abdullah Heathcote,ENGINEER -Burnice Treutel,MANAGER -Libbie O'Hara,ENGINEER -Rowan Will,MANAGER -Gudrun Gleason,ENGINEER -Fannie Quitzon,MANAGER -Terence Gutkowski,ENGINEER -Tyshawn Rowe,MANAGER -Jaylan Sanford,MANAGER -Camille Schaden DVM,MANAGER -Ms. Blaze Emmerich,MANAGER -Sonny Stoltenberg,ENGINEER -Elsie Jacobson,MANAGER -London Jacobs,MANAGER -Mr. Hassie Kuhn,ENGINEER -Raul Bogan MD,ENGINEER -Adrian Abshire,MANAGER -Golden Kreiger,MANAGER -Deven Stiedemann I,MANAGER -Hilario Koepp PhD,MANAGER -Maynard Herzog,MANAGER -Nathaniel Torp,MANAGER -Courtney Strosin,MANAGER -Emely Lowe,ENGINEER -Vilma Weber,ENGINEER -Ms. Carlee Littel,ENGINEER -Hayden Mills,ENGINEER -Ervin Schimmel,ENGINEER -Gino Ortiz,ENGINEER -Amani Conroy,MANAGER -Korbin Lowe,MANAGER -Turner Bogan I,ENGINEER -Ms. Jabari Bauch,MANAGER -Mrs. Breanne Morissette,ENGINEER -Crystel Doyle,MANAGER -Isabel VonRueden,ENGINEER -Dayne Cremin,ENGINEER -Waino Armstrong,MANAGER -Deborah Armstrong,MANAGER -Ashlynn Mante DVM,ENGINEER -Karlie Pollich Jr.,ENGINEER -Maeve Schroeder,MANAGER -Hanna Fadel,ENGINEER -Delphia O'Hara,MANAGER -Jamir Hammes,ENGINEER -Nigel Ortiz,ENGINEER -Pauline Ritchie,MANAGER -Nicholaus Toy,ENGINEER -Freddy Okuneva,MANAGER -Brionna Fritsch,ENGINEER -Maiya Mills,ENGINEER -Alia Hoeger PhD,MANAGER -Alvina Mertz,ENGINEER -Raymundo Hintz,ENGINEER -Zack Stamm,ENGINEER -Dayne Klocko,MANAGER -Kyla Cremin,ENGINEER -Izabella Bernhard,ENGINEER -Zena Yundt,ENGINEER -Daron Schuppe,MANAGER -Mr. Amira Marvin,MANAGER -Boris Morar,MANAGER -Esperanza Batz,ENGINEER -Dortha Macejkovic I,MANAGER -Porter Dach V,ENGINEER -Kailyn Flatley I,MANAGER -Celine O'Keefe,MANAGER -Obie Rodriguez,MANAGER -Cade Gorczany,ENGINEER -Myles Shanahan,ENGINEER -Jayne Wiza,ENGINEER -Julius Huel,MANAGER -Ms. Rowena Kihn,ENGINEER -Ena Wehner,MANAGER -Clovis Cartwright,MANAGER -Mr. Marcelo D'Amore,MANAGER -Meggie Prosacco,ENGINEER -Lisa Schamberger PhD,ENGINEER -Mrs. Lyda Bayer,MANAGER -Newell Hettinger,MANAGER -Melany Wolf,MANAGER -Emil Schaefer,MANAGER -Samson Trantow,MANAGER -Maida Marquardt,ENGINEER -Johnpaul Howe MD,MANAGER -Mrs. Adah Lubowitz,ENGINEER -Ms. Imelda Kohler,MANAGER -Manuela Frami I,ENGINEER -Noelia Padberg,MANAGER -Una Eichmann DDS,ENGINEER -Elta Nolan,ENGINEER -Jaron Wyman,ENGINEER -Kayla Windler Sr.,MANAGER -Mrs. Zetta Stiedemann,MANAGER -Dr. Abner Adams,MANAGER -Brenden Ortiz,MANAGER -German Funk,ENGINEER -Mr. Liliane Konopelski,MANAGER -Jarrett Morar,MANAGER -Parker Huels,MANAGER -Mrs. Alvah Bayer,ENGINEER -Wilhelm Parker Jr.,ENGINEER -Leo Mertz,ENGINEER -Corine Hills,ENGINEER -Coy Raynor Sr.,ENGINEER -Mallie Streich DVM,ENGINEER -Daisy Hoeger,MANAGER -Michelle Hickle,ENGINEER -Nolan Douglas,ENGINEER -Vivian Bernier,ENGINEER -Brigitte Toy,ENGINEER -Aniyah Schoen,ENGINEER -Emmie Bins,ENGINEER -Mazie Weimann,MANAGER -Carole Aufderhar,ENGINEER -Bernhard O'Kon,ENGINEER -Flavio Moore Sr.,MANAGER -Justina Wuckert,ENGINEER -Meredith Jones,ENGINEER -Gene Champlin,MANAGER -Clare Fay,MANAGER -Lesly Johnston II,MANAGER -Cristian Kling,MANAGER -Candido Littel,MANAGER -Mrs. Gregory Ritchie,ENGINEER -Lucio Sawayn,MANAGER -Derick Rath DVM,MANAGER -Gabriella Dietrich,ENGINEER -Lula Spencer DVM,ENGINEER -Horacio Kulas,ENGINEER -Davin Vandervort DDS,ENGINEER -Ms. Avery Wisoky,ENGINEER -Talon Williamson MD,MANAGER -Gerald Hahn,MANAGER -Ettie Yost,MANAGER -Abdullah Mosciski,ENGINEER -Mrs. Marielle Bosco,ENGINEER -Kory Batz,MANAGER -Noelia Kovacek,ENGINEER -Kyleigh Nienow,MANAGER -Alize Lind,ENGINEER -Ellsworth Altenwerth,ENGINEER -Domenic Mayer,ENGINEER -Ms. Geovanny Satterfield,ENGINEER -Ella Daniel,MANAGER -Kylee Bogisich PhD,ENGINEER -Ryder Wilkinson Sr.,MANAGER -Marina Schaefer,ENGINEER -Ms. Paige Bartell,MANAGER -Mitchel Murray,ENGINEER -Tyler Quigley,MANAGER -Veronica Kreiger,ENGINEER -Halie Goldner,ENGINEER -Ryder Lakin,ENGINEER -Chloe Legros,ENGINEER -Dariana O'Conner,ENGINEER -Era Bins Jr.,ENGINEER -Laila Reichert,MANAGER -Dedrick Kuhic V,ENGINEER -Haylee Price Jr.,ENGINEER -Callie Shields,MANAGER -Jarrod Fahey,MANAGER -Earlene Cremin,ENGINEER -Ellie Bergstrom,MANAGER -Armando Grady,ENGINEER -Dr. Lamar Hessel,ENGINEER -Joe Runolfsson Sr.,ENGINEER -Manley Oberbrunner,MANAGER -Meta Weissnat II,ENGINEER -Dagmar Batz IV,ENGINEER -Susie Bayer,ENGINEER -Randi Howell,ENGINEER -Joanne Rau,MANAGER -Buck Stark,ENGINEER -Shane Donnelly,ENGINEER -Quincy Casper V,ENGINEER -Lafayette Grimes,MANAGER -Mrs. Jody Beer,ENGINEER -Miss Corene Schamberger,ENGINEER -Dr. Jesse Baumbach,ENGINEER -Brenna Quigley Jr.,MANAGER -Ms. Viviane Bins,ENGINEER -Edgar Johnson,MANAGER -Mr. Tracy Beier,ENGINEER -Juvenal Ortiz,ENGINEER -Dr. Nat Pagac,MANAGER -Julio Mitchell,ENGINEER -Clarissa Mraz Jr.,ENGINEER -Dustin Grady,MANAGER -Brennon Bayer,ENGINEER -Mrs. Birdie Nienow,MANAGER -Randal Sauer Sr.,ENGINEER -Verda Kozey,ENGINEER -Chesley Hickle,ENGINEER -Miss Rico Block,ENGINEER -Gaetano Lindgren,MANAGER -Hope Hauck,ENGINEER -Percival O'Connell,ENGINEER -Melyna Leuschke,MANAGER -Adan Collins,MANAGER -Daryl Bashirian,ENGINEER -Kara Welch,MANAGER -Norberto Swift,ENGINEER -Effie Champlin Jr.,ENGINEER -Dr. Julia Metz,MANAGER -Janice Witting,MANAGER -Bruce Eichmann,MANAGER -Isobel Swift,ENGINEER -Earnestine Mayer MD,MANAGER -Michele Bashirian,ENGINEER -Janick Crona,ENGINEER -Hank Fisher III,MANAGER -Miss Aliya Skiles,ENGINEER -Herbert Orn,MANAGER -Aglae Baumbach,ENGINEER -Gayle Carter,ENGINEER -Creola Kautzer,MANAGER -Theresa Hauck,MANAGER -Ms. Patience Wintheiser,MANAGER -Sebastian Rutherford DDS,ENGINEER -Ara Pollich I,ENGINEER -Carlos Baumbach,MANAGER -Hulda Schroeder DVM,ENGINEER -Stanton Torp,MANAGER -Ceasar Franecki,MANAGER -Lelah Miller,ENGINEER -Wyman Schultz,MANAGER -Mae Harris V,MANAGER -Hortense Koelpin,ENGINEER -Wilmer Deckow,ENGINEER -Zaria Ferry,ENGINEER -Pierre Cronin,ENGINEER -Ms. Brenna Leffler,ENGINEER -Dr. Keara Price,ENGINEER -Jane Schroeder,MANAGER -Reymundo Heathcote,MANAGER -Elton Schiller II,MANAGER -Irma Blanda,MANAGER -Mireya Turner,MANAGER -Dawson Streich,MANAGER -Gianni Cassin,MANAGER -Johnathan Kuhic V,MANAGER -Lacey Sawayn,ENGINEER +Miller Zulauf,MANAGER +Mazie Gottlieb,MANAGER +Johnathon Shields Sr.,MANAGER +Paula Windler I,MANAGER +Kaley Gleichner V,ENGINEER +Mr. Roosevelt Welch MD,ENGINEER +Ms. Shirley Purdy V,ENGINEER +Rolando Klein,ENGINEER +Ms. Sandy Osinski,MANAGER +Mr. Kristopher Bauch II,MANAGER +Ali Gleason,ENGINEER +Americo Rempel,ENGINEER +Gladys Marvin DVM,MANAGER +Danial Koch,MANAGER +Mr. Leopold Bergnaum,MANAGER +Davonte Larson,MANAGER +Ms. Tiara Collier Jr.,ENGINEER +Jessie Price,ENGINEER +Kathleen Kihn,ENGINEER +Mr. Ruben Haag,MANAGER +Maegan Quitzon,MANAGER +Clifton McKenzie,MANAGER +Lily Collins,ENGINEER +Janie Hartmann,ENGINEER +Ms. Alexandra Torphy IV,MANAGER +Rosemarie Gerlach,ENGINEER +Emilio Schultz,ENGINEER +Adalberto Reilly V,ENGINEER +Jess Schulist,MANAGER +Bianka Swaniawski,MANAGER +Mr. Oliver Lowe,ENGINEER +Winifred Mayert,MANAGER +Lamar Bahringer,ENGINEER +Celia Hamill,MANAGER +Ms. Shanon Murphy IV,ENGINEER +Mr. Doris Gislason IV,MANAGER +Hulda Bechtelar,ENGINEER +Raina Pfeffer IV,ENGINEER +Lilyan Gulgowski,ENGINEER +Mr. Gilbert Ziemann,MANAGER +Rebeca Spencer,ENGINEER +Dion Goodwin,MANAGER +Ms. Shemar Hand,MANAGER +Mr. Adrien Marquardt DDS,MANAGER +Ladarius Veum,MANAGER +Josefina Ernser,ENGINEER +Mr. Geovanny Schowalter DDS,MANAGER +Lera Rohan,MANAGER +Fredy Bogisich,MANAGER +Vada Jones,MANAGER +Alec Waelchi,MANAGER +Violet Schneider,ENGINEER +Nestor Von,ENGINEER +Ms. Zora Ortiz DVM,MANAGER +Mortimer Borer,MANAGER +Adam Rolfson,MANAGER +Willie Cronin,ENGINEER +Tianna Cole,ENGINEER +Eliza McGlynn,ENGINEER +Fidel Heathcote,MANAGER +Brendan Towne,MANAGER +Dean Lowe,MANAGER +Brycen Ortiz,MANAGER +Ford Kertzmann,ENGINEER +Alfredo Franecki,ENGINEER +Monica Pouros Jr.,MANAGER +Ms. Assunta Fay Sr.,MANAGER +Noah Lockman Jr.,MANAGER +Lonny Ebert,ENGINEER +Briana Howe,MANAGER +Ms. Vivienne Kuvalis IV,ENGINEER +Ms. Gracie Hilpert PhD,MANAGER +Thea Cronin,MANAGER +Elenora Oberbrunner I,ENGINEER +Ms. Rebecca Bergnaum,MANAGER +Hudson Lebsack,MANAGER +Sigurd Abbott,MANAGER +Kennith Wiegand V,MANAGER +Dalton Carter,MANAGER +Raegan Balistreri,ENGINEER +Brandy Cronin,ENGINEER +Ms. Adella Runolfsdottir DDS,ENGINEER +Robin Walsh,ENGINEER +Emmanuelle Rempel,ENGINEER +Mr. Jan Ullrich DVM,ENGINEER +Stefan Eichmann,ENGINEER +Giles Keeling,MANAGER +Bell O'Reilly,MANAGER +Molly Grant,MANAGER +Karlee Anderson,MANAGER +Jordyn Heller,ENGINEER +Eleonore Dibbert Sr.,ENGINEER +Efrain Borer I,MANAGER +Ms. Alisha Wiza,ENGINEER +David Haag,MANAGER +Ms. Rebecca Schmeler,MANAGER +Ebba Legros,MANAGER +Assunta McGlynn,MANAGER +Joelle Heller II,ENGINEER +Rasheed Considine,ENGINEER +Mr. Jabari Borer,ENGINEER +Mr. Americo O'Conner,ENGINEER +Mr. Johnny Kautzer DDS,MANAGER +Beverly Schimmel,MANAGER +Ms. Sarina Kuhn DDS,ENGINEER +Eusebio Kertzmann II,ENGINEER +Hilton O'Keefe,ENGINEER +Reina Weissnat,MANAGER +Hassie Kling,MANAGER +Lera Gleason,ENGINEER +Waldo Deckow,MANAGER +Mr. Norris Kling,MANAGER +Ms. Annabel Nikolaus,MANAGER +Cheyanne Hilll,MANAGER +Gage Jacobs,MANAGER +Cassidy Stokes,MANAGER +Georgianna Jacobs,ENGINEER +Mr. Ubaldo Cormier,ENGINEER +Laurie Berge,MANAGER +Mr. Karl Stehr Jr.,MANAGER +Mr. Jaquan Gibson,ENGINEER +Delores Stiedemann,ENGINEER +Anabelle Yundt,MANAGER +Gaston Bergstrom MD,ENGINEER +Verona Halvorson,ENGINEER +Ms. Bridie Thompson V,MANAGER +Albertha Tremblay,MANAGER +Courtney Becker,MANAGER +Bessie Homenick,MANAGER +Lilian Osinski,ENGINEER +Bertrand Altenwerth,MANAGER +Cruz Gottlieb,ENGINEER +Willy Runte,MANAGER +Ms. Estelle Carter,MANAGER +Arnoldo Emard,MANAGER +Brenna Lockman,ENGINEER +Kelly Bergnaum,MANAGER +Adah Labadie,MANAGER +Nichole Koepp,MANAGER +Jettie Jacobs,ENGINEER +Kellie Brekke V,MANAGER +Nya Russel IV,ENGINEER +Rowan Kling,ENGINEER +Dariana Oberbrunner V,ENGINEER +Angelo Altenwerth I,ENGINEER +Britney Herman,MANAGER +Abigayle Reichel,ENGINEER +Ms. Miracle Grady IV,MANAGER +Ms. Alison Bartoletti IV,MANAGER +Laney Nitzsche,ENGINEER +Laura Terry PhD,ENGINEER +Breanne Koepp,ENGINEER +Ines Medhurst,ENGINEER +Theodore Stokes,MANAGER +Ms. Yasmine Schulist,ENGINEER +Adolfo O'Reilly,ENGINEER +Kaelyn Schaden,MANAGER +Jorge Bergnaum,ENGINEER +Ignacio Wyman,ENGINEER +Dannie Will,MANAGER +Margaretta Abbott,ENGINEER +Briana Murray PhD,ENGINEER +Brady Rath,ENGINEER +Rahsaan Adams,MANAGER +Mr. Hayley Dicki,ENGINEER +Colton Pouros,ENGINEER +Vida Schultz,ENGINEER +Alexanne Turcotte,MANAGER +Reba Stroman,MANAGER +Paxton O'Connell MD,MANAGER +Don Lesch,ENGINEER +Mr. Carter Von IV,ENGINEER +Candida Boyer,MANAGER +Mr. Raymond Krajcik DVM,ENGINEER +Markus Waelchi,ENGINEER +Malachi Cummerata,ENGINEER +Mr. Edmond Dietrich IV,MANAGER +Lenora Reynolds,ENGINEER +Zoie Kiehn,ENGINEER +Mr. Mason Lang II,MANAGER +Virginia Reilly,ENGINEER +Claude Emmerich,MANAGER +Sebastian Prosacco,MANAGER +Mr. Dashawn O'Hara,MANAGER +Emmy Turcotte III,ENGINEER +Sincere Legros,MANAGER +Mauricio Reilly,ENGINEER +Ms. Kimberly Bogan I,ENGINEER +Ms. Cassandre Murphy PhD,ENGINEER +Kaycee Kshlerin I,ENGINEER +Ms. Cheyanne Rodriguez PhD,ENGINEER +Gayle Wiza,MANAGER +Ms. Desiree Metz,ENGINEER +Hettie Beier MD,ENGINEER +Shakira Ledner,MANAGER +Forrest Ullrich,ENGINEER +Alysha Wolff III,MANAGER +Mr. Lorenza Okuneva DVM,ENGINEER +Nasir Walsh,MANAGER +Jeanette Rogahn,ENGINEER +Gilda Funk I,MANAGER +Julius Gusikowski,ENGINEER +Agnes Schuster,ENGINEER +Delphine Thompson,ENGINEER +Tressa Nolan,ENGINEER +Leatha Reilly I,MANAGER +Mr. Jamar Mueller,ENGINEER +Kyleigh Franecki,MANAGER +Cornell Bashirian MD,MANAGER +Ramiro Bogan,MANAGER +Robyn McKenzie,MANAGER +Destini Rippin,MANAGER +Eladio Mraz,MANAGER +Jayda Moore III,MANAGER +Alivia Koelpin,ENGINEER +Alva Muller,ENGINEER +Ms. Karianne Dibbert Sr.,MANAGER +Hazle Langworth,MANAGER +Geraldine Koelpin DVM,MANAGER +Margarett Swaniawski,MANAGER +Major Mosciski,MANAGER +Cara Kuphal,MANAGER +Deshawn Fisher,ENGINEER +Mr. Leopoldo VonRueden DDS,MANAGER +Horacio O'Connell,MANAGER +Salvatore Hermann,ENGINEER +Dessie Franecki,MANAGER +Mr. Torrey Macejkovic,MANAGER +Wendell Boyer,ENGINEER +Providenci Heidenreich,ENGINEER +Mr. Dorthy Williamson DDS,ENGINEER +Ena Green DDS,MANAGER +Ms. Aaliyah Bernhard,MANAGER +Grace Quitzon,ENGINEER +Germaine VonRueden,MANAGER +Lionel Goldner,MANAGER +Pearline Osinski,ENGINEER +Claud Mayert,MANAGER +Palma Grady,ENGINEER +Andre Conn,MANAGER +Gerardo Wilderman,MANAGER +Ms. Lydia Moore,ENGINEER +Walter Kub,ENGINEER +Elbert Gottlieb,ENGINEER +Arnoldo Quitzon,ENGINEER +Macy Conroy,ENGINEER +Cecil Metz,MANAGER +Ms. Loyce Torphy MD,ENGINEER +Rylan Wyman PhD,MANAGER +Clair Luettgen DDS,MANAGER +Mr. Rickey Lehner,ENGINEER +Kian Walter,ENGINEER +Ms. Coralie Carroll II,MANAGER +Ms. Leann Gutkowski Sr.,ENGINEER +Presley Hirthe,MANAGER +Leola King,MANAGER +Maribel Mueller,MANAGER +Dean Hilll,ENGINEER +Rosella Green,MANAGER +Clementine Klein,ENGINEER +Mr. Riley Roob V,MANAGER +Newell Beier,MANAGER +Orval Rodriguez,MANAGER +Ms. Neha Kerluke,MANAGER +Mr. Roger Farrell V,ENGINEER +Charlie Brakus,MANAGER +Judge Nitzsche,ENGINEER +Mr. Triston Jakubowski V,ENGINEER +Ms. Rhoda Luettgen,ENGINEER +Felicia Roob,MANAGER +Wendy Gulgowski,ENGINEER +Ms. Destiny Stoltenberg,MANAGER +Mr. Jaylen Metz,ENGINEER +Ms. Annamarie Heathcote,MANAGER +Cayla Heaney,ENGINEER +Eleanora Cruickshank,MANAGER +Susie Schowalter,MANAGER +Ms. Clarabelle Reichert Sr.,ENGINEER +Whitney Kuhn,MANAGER +Mr. Dangelo Dibbert DDS,MANAGER +Mr. Jess Willms II,ENGINEER +Madisyn Waelchi PhD,ENGINEER +Ms. Sister Tillman,ENGINEER +Fern Weimann DVM,MANAGER +Dejah Kunze II,MANAGER +Mr. Rahul Lubowitz,MANAGER +Antonia Zulauf DDS,MANAGER +Ms. Valentina Johnson DDS,MANAGER +Shaylee Sauer,MANAGER +Ms. Shanie Ruecker,ENGINEER +Mandy Boehm III,MANAGER +Greg Hintz,MANAGER +Vesta Lockman,ENGINEER +Lester Bahringer,MANAGER +Kianna McGlynn,MANAGER +Matteo Turner,MANAGER +Lexus Gorczany,ENGINEER +Otilia Schumm,ENGINEER +Ms. Gabriella Boyle,MANAGER +Edward Block,ENGINEER +Keanu Russel Jr.,MANAGER +Raquel Schroeder,MANAGER +Coralie Boyer,ENGINEER +Ms. Stefanie Ernser,MANAGER +Ms. Dorothy Reynolds,MANAGER +Riley Little MD,ENGINEER +Mr. Bennie Champlin Jr.,MANAGER +Ms. Ettie Koelpin DVM,ENGINEER +Saige Schaefer,ENGINEER +Kyra Barrows,MANAGER +Felton Gerhold PhD,MANAGER +Mr. Freeman Abshire PhD,ENGINEER +Terrence O'Conner,MANAGER +Ms. Clarabelle Gibson DDS,ENGINEER +Nikko Nader,MANAGER +Mr. Arturo Moore,ENGINEER +Wayne Abshire,ENGINEER +Sydnee Schaden,MANAGER +Matteo Robel IV,ENGINEER +Maverick Wyman,MANAGER +Mr. Westley Predovic V,MANAGER +Selina Donnelly,MANAGER +Mr. Alfonzo Von I,ENGINEER +Doug Ruecker,ENGINEER +Denis Yost,MANAGER +Cyril Robel Sr.,ENGINEER +Ford Jacobi,ENGINEER +Dillan Grimes,ENGINEER +Ms. Cecelia Kiehn PhD,ENGINEER +Rachael Kshlerin,ENGINEER +Raven Kihn,MANAGER +Ms. Eileen Friesen,ENGINEER +Mr. Jett Bernhard,MANAGER +Haylie Spinka,ENGINEER +Kailey Towne Jr.,MANAGER +Mr. Jed Rutherford,MANAGER +Angel Schneider,MANAGER +Emma Pacocha,MANAGER +Jeremie Rogahn,MANAGER +Porter Herman,ENGINEER +Priscilla Stanton,ENGINEER +Aurelio Turner,MANAGER +Melvin McLaughlin,ENGINEER +Brandy Friesen,MANAGER +Angelo Pfeffer,MANAGER +Mr. Jerrold Prohaska,ENGINEER +Margret Turcotte,ENGINEER +Kathryne Schaefer II,ENGINEER +Kamille Blanda,ENGINEER +Addie Tremblay,MANAGER +Cathrine Bernier,MANAGER +Jesus Bashirian,ENGINEER +Dillon Hamill,MANAGER +Granville Lemke,ENGINEER +Vito Greenholt III,ENGINEER +Evie Kunde,MANAGER +Lela Renner,MANAGER +Brendon Reynolds,MANAGER +Mr. Brandt Larson,ENGINEER +Mr. Arthur Brakus Jr.,MANAGER +Haylie Gerhold,MANAGER +Emile Crist,ENGINEER +Mr. Kale Schamberger DVM,ENGINEER +Ms. Oceane Kerluke II,MANAGER +Matteo Auer,MANAGER +Audie Kreiger IV,ENGINEER +Mr. Niko Yost Jr.,ENGINEER +Sage Bruen,ENGINEER +Francisco Feeney,ENGINEER +Jared Koelpin,MANAGER +Claud Lesch,ENGINEER +Sherman Okuneva Jr.,ENGINEER +Jeramy Strosin,ENGINEER +Amya Schumm,ENGINEER +Tracey Wunsch,MANAGER +Krystal Kunze,ENGINEER +Talon Wyman V,ENGINEER +Brice Mills,MANAGER +Scottie Bergstrom,MANAGER +Ms. Shanny Beatty,MANAGER +Shannon Witting,MANAGER +Taya Fahey V,MANAGER +Ms. Lauriane Sanford,MANAGER +Emilia Lesch,MANAGER +Randal Predovic,ENGINEER +Piper Heidenreich I,ENGINEER +Jakob Kassulke,MANAGER +Wilma Satterfield,ENGINEER +Dahlia Paucek,MANAGER +Peyton Will Jr.,MANAGER +Reginald Durgan Sr.,ENGINEER +Miracle Sauer,MANAGER +Dewayne Wintheiser,MANAGER +Emelia Langworth,MANAGER +Ms. Elissa Reichel,MANAGER +Gillian Ledner,ENGINEER +Mr. Morgan Bernier IV,ENGINEER +Mr. Brooks Prosacco,ENGINEER +Mr. Junius Hintz,ENGINEER +Astrid Heathcote DVM,MANAGER +Ms. Brooklyn Parker,MANAGER +Domingo Heller,MANAGER +Mr. Jayde Dooley Sr.,ENGINEER +Jada Carroll Sr.,ENGINEER +Enoch Hammes,MANAGER +Ms. Mckayla Jast,ENGINEER +Ulices Wunsch,MANAGER +Ms. Jacklyn Bayer I,ENGINEER +Adolph Kshlerin,ENGINEER +Magnolia Baumbach PhD,MANAGER +Noelia Windler,ENGINEER +Jaeden Hand,MANAGER +Heather Wilderman,MANAGER +Daphne Hamill,MANAGER +Octavia Durgan,MANAGER +Anibal Kerluke,MANAGER +Mr. Orval Hammes Jr.,MANAGER +Kristin Conn,MANAGER +Magdalen Dietrich IV,MANAGER +Ms. Haylie Rosenbaum MD,ENGINEER +Elenor Howe,ENGINEER +Yvonne Roberts,ENGINEER +Oda Wisoky,MANAGER +Ms. Aryanna Grimes Jr.,ENGINEER +Jocelyn Wilkinson,MANAGER +Neil Hirthe,ENGINEER +Aric Heidenreich,MANAGER +Ms. Julia Carter,ENGINEER +Darlene Pacocha,MANAGER +Kathryne Hoeger,ENGINEER +Alysson Carter V,ENGINEER +Mr. Nicolas Blick V,ENGINEER +Elaina Von,ENGINEER +Ms. Ellen Mayer IV,MANAGER +Darryl Casper,ENGINEER +Mr. Kadin Metz V,ENGINEER +Ms. Electa Quitzon Sr.,MANAGER +Mr. Hiram Howe MD,MANAGER +Ole Marvin,MANAGER +Claudia Rice,MANAGER +Forest Swaniawski,MANAGER +Roslyn Dickens,ENGINEER +Ms. Janis Wuckert V,MANAGER +Ms. Meda Jerde DVM,ENGINEER +Dolores Schiller II,ENGINEER +Mr. Enid Keeling,ENGINEER +Burnice Bosco DDS,ENGINEER +Katheryn Becker,MANAGER +Samantha Schmidt,ENGINEER +Mr. Royce Bashirian,ENGINEER +Mitchell Parker,ENGINEER +Ms. Eryn Bins,ENGINEER +Sven Harvey,ENGINEER +Mr. Melany Dibbert,MANAGER +Ms. Ardella Sipes Jr.,MANAGER +Joy Reynolds,MANAGER +Lyda Quitzon,MANAGER +Sophie Gusikowski,ENGINEER +Ashly Jacobi,ENGINEER +Haylie Maggio,ENGINEER +Deshaun Walsh,ENGINEER +Mr. Malachi Gibson,MANAGER +Edna Fadel,MANAGER +Ms. Eula Bogan,MANAGER +Mr. Javier Kemmer DDS,MANAGER +Nicole Conroy,MANAGER +Cordie Wunsch V,MANAGER +Pablo Jones,ENGINEER +Ms. Jolie Schuppe DDS,MANAGER +Amya Swift,ENGINEER +Alessandro Bartoletti,MANAGER +Sonya Schmitt,MANAGER +Ava D'Amore,ENGINEER +Raphaelle Murphy,MANAGER +Seth King DVM,MANAGER +Mr. Wilber Schaden III,MANAGER +Brian White,ENGINEER +Sage Parker,MANAGER +Katharina Wiegand,MANAGER +Eric Weimann,ENGINEER +Marcellus Jakubowski,ENGINEER +Angeline Pouros,MANAGER +Samara Veum,ENGINEER +Alberto Zemlak MD,ENGINEER +Liza Nolan III,MANAGER +Guy Turcotte,MANAGER +Danyka Stamm MD,MANAGER +Alverta Dach,ENGINEER +Maybelline Kihn,ENGINEER +Carlo Ratke,MANAGER +Margaretta Von,ENGINEER +Pinkie Green,ENGINEER +Mr. Elvis Gulgowski,MANAGER +Chanel Harber,ENGINEER +Carroll Gutmann,MANAGER +Emma Stehr,MANAGER +Rusty Gerhold,MANAGER +Nella Graham,ENGINEER +Carolyne Rippin DDS,ENGINEER +Conor Rowe,MANAGER +Gilda Mayert II,ENGINEER +Mr. Cale Ortiz Jr.,ENGINEER +Morgan Parisian IV,ENGINEER +Carolanne Russel,ENGINEER +Grayson VonRueden DVM,ENGINEER +Ms. Jazmyne Larkin I,MANAGER +Courtney Hirthe,ENGINEER +Maximus Shanahan MD,MANAGER +Felipa Wiegand,ENGINEER +Ms. Madalyn Corwin III,ENGINEER +Eldridge West,ENGINEER +Ms. Cleta Renner,MANAGER +Katelynn Erdman,MANAGER +Scotty Cassin,MANAGER +Melyna Kertzmann,ENGINEER +Mariam McCullough,ENGINEER +Demarcus Donnelly V,ENGINEER +Mr. Ansley Bernhard Sr.,MANAGER +Chad Ondricka V,ENGINEER +Liliana Hessel,MANAGER +Ransom Crist,MANAGER +Aisha Boehm,ENGINEER +Adaline O'Reilly PhD,ENGINEER +Dayna Hoppe,MANAGER +Mr. Lee Kreiger Jr.,ENGINEER +Payton Cummerata,MANAGER +Colten Luettgen,MANAGER +Ms. Nakia Johns,ENGINEER +Freida Strosin,MANAGER +Brad Bednar,ENGINEER +Antone McLaughlin,MANAGER +Izabella Berge,ENGINEER +Carole Lowe V,ENGINEER +Bud Leuschke,ENGINEER +Archibald Hilpert,MANAGER +Fernando Ebert,MANAGER +Jeramy Abshire,ENGINEER +Jannie Weber,ENGINEER +Mr. Mason Wolff MD,ENGINEER +Nelle Kutch III,ENGINEER +Keshawn Sporer,ENGINEER +Caterina Kunze PhD,ENGINEER +Dashawn Block,MANAGER +Shania Witting,MANAGER +Amos Stamm,ENGINEER +Alexandra Reichel Jr.,MANAGER +Mr. Edwardo Schneider V,MANAGER +Ms. Brigitte Waelchi,MANAGER +Jeanne Keeling,ENGINEER +Forest Von,MANAGER +Mr. Casimer Jast,MANAGER +Ms. Ebba Conn,MANAGER +Jany Yost,ENGINEER +Hassie Mosciski,MANAGER +Mr. Zion Rosenbaum Sr.,MANAGER +Ignacio Thompson MD,MANAGER +Jeanette Conroy IV,MANAGER +Garrick Graham,MANAGER +Misael Kuvalis,MANAGER +Helene Dickinson III,ENGINEER +Reilly Murazik,MANAGER +Jadon Ullrich,ENGINEER +Ms. Audra Borer,MANAGER +Earnestine Sauer,ENGINEER +Myrl Gerlach,ENGINEER +Mr. Garret Krajcik,ENGINEER +Emmet Hayes,MANAGER +Ahmed Donnelly Jr.,ENGINEER +Mr. Alvah Schimmel,MANAGER +Ms. Marilyne Harris I,ENGINEER +Ms. Casandra Zulauf,MANAGER +Alfred Yundt,MANAGER +Ford Herman,MANAGER +Paige Beier,ENGINEER +Myrtle Runte,ENGINEER +Roy Rosenbaum,ENGINEER +Mr. Julius Borer III,ENGINEER +Noemi Hamill,ENGINEER +Francisco Koelpin PhD,MANAGER +Ms. Pascale Emard,MANAGER +Daryl Wisozk DVM,MANAGER +Mr. Noble Runolfsson,MANAGER +Ms. Daija Schoen,ENGINEER +Ubaldo Dach,ENGINEER +Katrine Parker PhD,MANAGER +Ms. Martine Treutel IV,MANAGER +Ms. Alice Emard II,ENGINEER +Garrison Nikolaus,ENGINEER +Mr. Tanner Baumbach IV,ENGINEER +Austin Wisozk II,MANAGER +Mr. Saul Little,MANAGER +Ms. Ashtyn O'Conner,ENGINEER +Mr. Norval Wisozk,ENGINEER +Ms. Daniella Murphy I,MANAGER +Rocky Osinski,MANAGER +Ms. Maybelline Powlowski,MANAGER +Aliyah Lindgren PhD,ENGINEER +Bradley Hauck,ENGINEER +Ramiro Kilback,MANAGER +Colten Hermann,MANAGER +Neva Hoppe,MANAGER +Ms. Stephania McGlynn PhD,MANAGER +Florencio Williamson,MANAGER +Ruby Langworth,ENGINEER +Mr. Stevie Corkery,MANAGER +Birdie Herzog V,ENGINEER +Mr. Boyd Harvey,ENGINEER +Ms. Josianne Hauck I,MANAGER +Jose Marquardt V,MANAGER +Cullen Gutmann,MANAGER +Mr. Ola Brown DVM,ENGINEER +Blanca Gleichner,ENGINEER +Mr. Evan Lesch,MANAGER +Hazle Grimes,ENGINEER +Mr. Ottis Walsh III,MANAGER +Sigmund Nienow,ENGINEER +Mr. Tyrel Hermiston DDS,ENGINEER +Mr. Woodrow Stark,ENGINEER +Twila Flatley,ENGINEER +Mr. Murl Howe DDS,MANAGER +Kathryne Price,ENGINEER +Ms. Hellen Lind IV,MANAGER +Ms. Alyson Lehner,MANAGER +Verda Hyatt,MANAGER +Viola Pacocha,ENGINEER +Lorenza Dietrich,MANAGER +Ms. Lavada Runte II,MANAGER +Doris Rohan,MANAGER +Santina Sauer,ENGINEER +Adrianna Parisian,ENGINEER +Ms. Maurine Senger III,ENGINEER +Ms. Delfina Murray II,MANAGER +Jane Kilback,ENGINEER +Mr. Kirk Braun DDS,MANAGER +Maynard Hills,MANAGER +Emmitt Marks,ENGINEER +Patience Hilll,MANAGER +Dave Volkman,ENGINEER +Sibyl Gleichner,MANAGER +Ressie Koelpin,MANAGER +Erwin Beer,MANAGER +Geovanni Goodwin,MANAGER +Alexanne Mills,MANAGER +Ms. Meaghan Kris DDS,MANAGER +Mr. Stanton Nicolas,ENGINEER +Elliot Welch,ENGINEER +Mr. Mathew Schowalter,ENGINEER +Ms. May Lowe MD,MANAGER +Ms. Henriette Rau,MANAGER +Reuben Wiza IV,ENGINEER +Mr. Roman Bernhard,ENGINEER +Norval Breitenberg,ENGINEER +Deshawn Gibson,ENGINEER +Nola Corwin,ENGINEER +Bernadine Beatty III,MANAGER +Berneice Baumbach,ENGINEER +Aaliyah Brown,ENGINEER +Mariana Mills,ENGINEER +Filiberto Jenkins,ENGINEER +Madisen Bode,MANAGER +Brant Kuvalis Sr.,MANAGER +Mr. Wiley Green,MANAGER +Nova Padberg,ENGINEER +Rosanna Carter,ENGINEER +Jacquelyn Rau,MANAGER +Mr. Gunner Kub I,MANAGER +Roberto Spinka,MANAGER +Bettie Greenfelder,ENGINEER +Ms. Nedra Towne,MANAGER +Ms. Amely Cartwright,ENGINEER +Ms. Joy Wiegand,ENGINEER +Kayley Moore DDS,MANAGER +Philip Mayer,MANAGER +Ms. Mae Bartell,MANAGER +Efren Paucek,MANAGER +Mr. Marques Mayert DDS,MANAGER +Zelma Zboncak,MANAGER +Camila Buckridge,MANAGER +Mr. Savion Trantow V,ENGINEER +Lonny Bahringer,ENGINEER +Mr. Valentin Stehr,MANAGER +Chanelle Willms,ENGINEER +Holly Swaniawski V,MANAGER +Eloy Bailey,ENGINEER +Doris Buckridge,ENGINEER +Mr. Zackary Fahey MD,MANAGER +Nella DuBuque,MANAGER +Kenya Cronin,MANAGER +Blanche Torp,ENGINEER +Estevan Walsh,ENGINEER +Kurt Greenholt Sr.,MANAGER +Beverly Torp,MANAGER +Ms. Dorothea Hackett,MANAGER +Brigitte Kunde,ENGINEER +Jackeline Harber,MANAGER +Ms. Justine Deckow Sr.,ENGINEER +Vicenta Rolfson,ENGINEER +Holly Tremblay,MANAGER +Emilio Windler,MANAGER +Erin Beier,ENGINEER +Kali Terry,MANAGER +Mr. Aron Walsh,MANAGER +Ms. Veronica Ankunding,MANAGER +Amaya Adams PhD,MANAGER +Milford Watsica II,MANAGER +Ms. Prudence Harvey,MANAGER +Brice Schinner,MANAGER +Kayden Witting,ENGINEER +Shad Beatty,MANAGER +Ms. Sunny Braun DVM,ENGINEER +Ally Kiehn,ENGINEER +Sierra Dietrich Sr.,MANAGER +Diego Hoeger,ENGINEER +Allene Stokes,ENGINEER +Mr. Chaz Kemmer III,MANAGER +Ms. Lurline Kessler II,ENGINEER +Carli Osinski,MANAGER +Prince Kunze,MANAGER +Jared Schoen,ENGINEER +Sven Lesch,ENGINEER +Alec Ernser,MANAGER +Jean Daniel,ENGINEER +Ambrose Hansen,ENGINEER +Ms. Aubree Cruickshank,ENGINEER +Ms. Aniya Doyle,MANAGER +Julianne Weissnat,MANAGER +Emanuel Friesen I,MANAGER +Ms. Trycia Schulist DDS,ENGINEER +Caesar Runolfsson II,MANAGER +Torrance Blick,MANAGER +Kailyn Ortiz,ENGINEER +Mackenzie Farrell V,ENGINEER +Cristian Quitzon III,ENGINEER +Josie O'Connell PhD,MANAGER +Kristian Hermann,ENGINEER +Brady Halvorson,ENGINEER +Foster Monahan,MANAGER +Mr. Aron Dietrich V,MANAGER +Ms. Delilah Blick I,MANAGER +Mr. Ulises Kuvalis IV,MANAGER +Ms. Kimberly Goodwin DDS,ENGINEER +Ms. Tia Kling III,ENGINEER +Mr. Jovanny Hoppe IV,MANAGER +Mohamed Brekke I,MANAGER +Dillan Jenkins,MANAGER +Alyce Willms,ENGINEER +Claudine Corkery,MANAGER +Royal Krajcik,MANAGER +Mr. Tyrese Erdman,ENGINEER +Geo Reichel,ENGINEER +Euna Vandervort,ENGINEER +Anjali Moen,MANAGER +Ms. Yvette Treutel PhD,ENGINEER +Kolby Yundt,MANAGER +Mr. Kelton Graham,ENGINEER +Don Corkery,ENGINEER +Wilburn Stark,ENGINEER +Estel Lesch,MANAGER +Kara Hoeger Sr.,MANAGER +Mr. Rhiannon Daugherty,MANAGER +Mr. Diego Wolff,MANAGER +Fay Hansen,MANAGER +Imani Fritsch,MANAGER +Derrick Fay,MANAGER +Newell Marks,MANAGER +Lexie Koch,ENGINEER +Irma Mayert,MANAGER +Schuyler Prosacco,ENGINEER +Madaline Trantow,ENGINEER +Abbie Witting II,ENGINEER +Jocelyn Sawayn PhD,MANAGER +Ms. Laisha Auer,MANAGER +Gregoria Krajcik,MANAGER +Rosalind Considine,ENGINEER +Noemie Howell,ENGINEER +Micah Pollich,ENGINEER +Mr. Jett Parisian DVM,ENGINEER +Edythe Haley PhD,ENGINEER +Carlos Breitenberg,MANAGER +Lina Bayer DVM,ENGINEER +Ms. Ora Cremin,MANAGER +Mr. Hilario Bogan,ENGINEER +Ramona Turcotte,MANAGER +Elisabeth Sanford,MANAGER +Telly Streich,MANAGER +Ms. Naomie Feest I,MANAGER +Ariane Mayer,ENGINEER +German Kuhlman IV,ENGINEER +Ruby Tremblay Sr.,ENGINEER +Ocie Pollich,MANAGER +Jaqueline Bailey,ENGINEER +Mr. Kyler VonRueden,ENGINEER +Cydney Stanton MD,ENGINEER +Marjorie Ritchie,ENGINEER +Marjolaine Kuphal,ENGINEER +Jewell McDermott,ENGINEER +Armand Batz,ENGINEER +Gudrun Moen,ENGINEER +Ms. Hilda Friesen,MANAGER +Annalise Kshlerin,ENGINEER +Josephine Thiel,ENGINEER +Casper Towne III,ENGINEER +Buster Lubowitz,MANAGER +Ms. Jazmin Schultz,MANAGER +Mr. Austyn Schuppe,MANAGER +Mr. Geovanni Wyman,MANAGER +Mr. Fletcher Rice,MANAGER +Carleton Stoltenberg,ENGINEER +Evan Jaskolski DDS,ENGINEER +Ms. Mertie Collins,ENGINEER +Marianna Pfannerstill Jr.,ENGINEER +Conor Wilderman,MANAGER +Jordan Mann,ENGINEER +Mr. Mavis Gutkowski,ENGINEER +Griffin Ratke Jr.,ENGINEER +Dan Funk,MANAGER +Rafael Denesik,ENGINEER +Jazmyne Runolfsson DDS,ENGINEER +Aurore Dach,ENGINEER +Alvah Gaylord,MANAGER +Mr. Jerod Gleichner,ENGINEER +Ms. Brisa Ledner,MANAGER +Ms. Rahsaan Stokes,ENGINEER +Mr. Wyatt Stokes MD,ENGINEER +Molly Smitham,ENGINEER +Madison Block,MANAGER +Briana Dickens,ENGINEER +Javonte Von,MANAGER +Marley Erdman,MANAGER +Luciano Christiansen,MANAGER +Skye Schinner,ENGINEER +Icie Denesik,MANAGER +Lulu Thiel,ENGINEER +Deion Little,ENGINEER +Serenity Davis MD,MANAGER +Wilburn Muller,MANAGER +Allen Jacobson,MANAGER +Ms. Jada Krajcik V,MANAGER +Chester Klein,MANAGER +Graciela Bailey,MANAGER +Myrtice Bergnaum,MANAGER +Mr. Allan Howell,MANAGER +Dolly Hagenes Jr.,ENGINEER +Audreanne Beahan,ENGINEER +Kraig Kuvalis,MANAGER +Fausto Stokes,ENGINEER +Una Orn,MANAGER +Ms. Yasmine Pfeffer,ENGINEER +Ms. Cassie Brakus,ENGINEER +Ora Lynch MD,MANAGER +Viviane Botsford MD,MANAGER +Jade Stamm,MANAGER +Norene Keebler II,MANAGER +Orlando Reilly,ENGINEER +Ms. Gertrude Greenholt,MANAGER +Zora Koelpin,MANAGER +Everett Funk,MANAGER +Anthony Connelly Jr.,ENGINEER +Ruthie Parker,MANAGER +Orlo Zemlak,ENGINEER +Baylee Kirlin Sr.,ENGINEER +Catharine Bosco,MANAGER +Clotilde Kshlerin,ENGINEER +Ms. Shanon Strosin PhD,MANAGER +Kim Kub,ENGINEER +Chase Walsh III,MANAGER +Ms. Dahlia Gleason,MANAGER +Mr. Nelson Reilly,MANAGER +Viola Schoen,MANAGER +Yesenia Jones,ENGINEER +Lavinia Beier,ENGINEER +Marcella Wunsch,ENGINEER +Zelma Hirthe,ENGINEER +Shany Borer,ENGINEER +Eusebio Stroman,MANAGER +Mr. Frankie Johnson V,ENGINEER +Mr. Liam Gleason,MANAGER +Moises Greenfelder II,ENGINEER +Ms. Gretchen Corkery,MANAGER +Ms. Hassie Haley Jr.,MANAGER +Haleigh Carter,MANAGER +Keara Schuster,MANAGER +Christelle Armstrong,ENGINEER +Misael Hamill,ENGINEER +Mr. Dillan Friesen,MANAGER +Mr. Jaydon Mann IV,ENGINEER +Audra Goodwin,ENGINEER +Mr. Jovan Wilkinson,ENGINEER +Meggie Kuhic,ENGINEER +Maiya Lindgren,MANAGER +Tanner Wolf,ENGINEER +Tina Barton,MANAGER +Zola Swift,ENGINEER +Verda Fisher,ENGINEER +Joesph Stroman Jr.,ENGINEER +Bart Pfannerstill,MANAGER +Ms. Pattie Tremblay,MANAGER +Mr. Sigurd Schaden DVM,ENGINEER +Abdiel Schumm,MANAGER +Columbus Denesik,ENGINEER +Mr. Demario Shields,ENGINEER +Yasmeen Lowe,MANAGER +Maryjane McGlynn PhD,ENGINEER +Ms. Flavie Rutherford,ENGINEER +Alanis Wuckert,MANAGER +Ms. Sophie Predovic,ENGINEER +Selina Torp,ENGINEER +Melyssa Tromp DDS,ENGINEER +Adrain Rohan,MANAGER +Ms. Elsa Stroman,MANAGER +Constance Ebert,ENGINEER +Abigayle Schiller,MANAGER +Arden Flatley MD,ENGINEER +Leonor Jaskolski,ENGINEER +Mr. Antone Skiles PhD,ENGINEER +Bert Balistreri V,ENGINEER +Sierra Stark Jr.,ENGINEER +Thad Kilback,MANAGER +Ms. Sydni Klein IV,MANAGER +Owen Herman,ENGINEER +Jaquelin Hodkiewicz,MANAGER +Joel Corkery MD,ENGINEER +Magnus Christiansen,MANAGER +Ms. Verla Considine V,ENGINEER +Mr. Gage Murazik PhD,ENGINEER +Mr. Pedro Abshire,MANAGER +Ms. Frances Schiller,ENGINEER +May Casper,ENGINEER +Christiana Towne,ENGINEER +Lester Beier,MANAGER +Juwan Crooks,MANAGER +Brown Borer Sr.,ENGINEER +Gregory Funk V,MANAGER +Ms. Alaina Altenwerth,MANAGER +Ms. Aylin Auer,ENGINEER +Mr. Isac Buckridge,ENGINEER +Mr. Morgan Kilback DVM,MANAGER +Rasheed Casper,MANAGER +Jennyfer Walker,ENGINEER +Shaun Fay,MANAGER +Ms. Thalia Weissnat,ENGINEER +Hoyt Balistreri,MANAGER +Mr. Ronny Sipes,ENGINEER +Jailyn Hoppe,ENGINEER +Maximillian Howe,ENGINEER +Mr. Sofia Hills,ENGINEER +Catharine Kunde,MANAGER +Ms. Bryana Kreiger IV,ENGINEER +Lavonne Reinger,ENGINEER +Albert Keeling,ENGINEER +Ms. Taya Feest III,ENGINEER +Maida Daugherty,MANAGER +Myra Heathcote,ENGINEER +Brooke Price,MANAGER +Mr. Kale Watsica,ENGINEER +Abbigail Wiza III,MANAGER +Jaron Dickinson,ENGINEER +Angus Senger,MANAGER +Ms. Abbie Aufderhar,MANAGER +Ms. Josefina Stark III,ENGINEER +Craig Osinski,MANAGER +Lenny Mayer DDS,ENGINEER +Mireya Wilderman,ENGINEER +Marianne Wiegand,MANAGER +Hilario Schumm,ENGINEER +Mr. Myron Dare,ENGINEER +Micaela Ryan MD,ENGINEER +Emmett Becker,MANAGER +Jamey Wolf,ENGINEER +Lue Dooley,MANAGER +Shaun Kris,MANAGER +Ms. Imogene Ledner DVM,MANAGER +Neil Connelly,ENGINEER +Mr. Rudy Volkman,ENGINEER +Patricia O'Reilly,ENGINEER +Mr. Jarred Treutel V,ENGINEER +Mr. Omari Murazik I,ENGINEER +Albin Lockman,MANAGER +Ms. Nona Grady,MANAGER +Terrence Murphy,MANAGER +Mr. Madyson Deckow,MANAGER +Ms. Carissa Kling,ENGINEER +Mr. Fredy Bogisich,ENGINEER +Reanna Wuckert,ENGINEER +Angie Nolan,MANAGER +Virginie Braun,ENGINEER +Jarred Flatley,ENGINEER +Ms. Leora Kihn II,MANAGER +Cathrine Kovacek,ENGINEER +Wilmer Becker,MANAGER +Missouri Franecki,ENGINEER +Mekhi Donnelly PhD,MANAGER +Ms. Willow Towne I,MANAGER +Jaylon Rippin,MANAGER +Alanis Hettinger,ENGINEER +Ms. Felicita Becker DVM,ENGINEER +Zelda Daniel,MANAGER +Mr. Emil Jast IV,MANAGER +Kian Satterfield,MANAGER +Mr. Cooper Dooley,ENGINEER diff --git a/internal/service/comprehend/test-fixtures/generate/document_classifier/main.go b/internal/service/comprehend/test-fixtures/generate/document_classifier/main.go index 9b7a9e44747b..b2fb0c8a28f8 100644 --- a/internal/service/comprehend/test-fixtures/generate/document_classifier/main.go +++ b/internal/service/comprehend/test-fixtures/generate/document_classifier/main.go @@ -13,7 +13,7 @@ import ( "math/rand" "os" - "syreclabs.com/go/faker" + "github.com/jaswdr/faker/v2" ) var doctypes = []string{ @@ -36,9 +36,9 @@ var spamDocs = []string{ func main() { log.SetFlags(0) - seed := int64(1) // Default rand seed + seed := int64(48) // Default rand seed r := rand.New(rand.NewSource(seed)) - faker.Seed(seed) + fake := faker.NewWithSeedInt64(seed) documentFile, err := os.OpenFile("./test-fixtures/document_classifier/documents.csv", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0600) if err != nil { @@ -48,19 +48,19 @@ func main() { documentsWriter := csv.NewWriter(documentFile) for i := 0; i < 100; i++ { - name := faker.Name().Name() + name := fake.Person().Name() doctype := doctypes[r.Intn(len(doctypes))] var line string if doctype == "PHISHING" { - order := faker.RandomString(10) - phone := faker.PhoneNumber().PhoneNumber() + order := fake.RandomStringWithLength(10) + phone := fake.Phone().Number() doc := phishingDocs[r.Intn(len(phishingDocs))] line = fmt.Sprintf(doc, name, order, phone) } else { doc := spamDocs[r.Intn(len(spamDocs))] - product := faker.Commerce().ProductName() - company := faker.Company().Name() + product := fake.Beer().Name() + company := fake.Company().Name() line = fmt.Sprintf(doc, name, product, company) } diff --git a/internal/service/comprehend/test-fixtures/generate/document_classifier_multilabel/main.go b/internal/service/comprehend/test-fixtures/generate/document_classifier_multilabel/main.go index 682130c813b7..36cc3ca1965e 100644 --- a/internal/service/comprehend/test-fixtures/generate/document_classifier_multilabel/main.go +++ b/internal/service/comprehend/test-fixtures/generate/document_classifier_multilabel/main.go @@ -14,7 +14,7 @@ import ( "os" "strings" - "syreclabs.com/go/faker" + "github.com/jaswdr/faker/v2" ) const ( @@ -41,9 +41,9 @@ var comedyWords = []string{ func main() { log.SetFlags(0) - seed := int64(1) // Default rand seed + seed := int64(48) // Default rand seed r := rand.New(rand.NewSource(seed)) - faker.Seed(seed) + fake := faker.NewWithSeedInt64(seed) // documentFile, err := os.OpenFile("./test-fixtures/document_classifier_multilabel/documents.csv", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0600) documentFile, err := os.OpenFile("../../../test-fixtures/document_classifier_multilabel/documents.csv", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0600) @@ -62,7 +62,7 @@ func main() { doctype = strings.Join(doctypes, defaultSeparator) } - title := faker.Lorem().Word() + title := fake.Lorem().Word() var desc string if doctype == "DRAMA" { diff --git a/internal/service/comprehend/test-fixtures/generate/entity_recognizer/main.go b/internal/service/comprehend/test-fixtures/generate/entity_recognizer/main.go index 7ad4937b6d4d..107595fa50f2 100644 --- a/internal/service/comprehend/test-fixtures/generate/entity_recognizer/main.go +++ b/internal/service/comprehend/test-fixtures/generate/entity_recognizer/main.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "syreclabs.com/go/faker" + "github.com/jaswdr/faker/v2" ) func main() { @@ -41,9 +41,9 @@ func main() { log.SetFlags(0) - seed := int64(1) // Default rand seed + seed := int64(48) // Default rand seed r := rand.New(rand.NewSource(seed)) - faker.Seed(seed) + fake := faker.NewWithSeedInt64(seed) entitiesFile, err := os.OpenFile("./test-fixtures/entity_recognizer/entitylist.csv", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0600) if err != nil { @@ -72,7 +72,7 @@ func main() { } for i := 0; i < 1000; i++ { - name := faker.Name().Name() + name := fake.Person().Name() entity := entities[r.Intn(len(entities))] if _, err := fmt.Fprintf(entitiesFile, "%s,%s\n", name, entity); err != nil { diff --git a/internal/service/computeoptimizer/recommendation_preferences.go b/internal/service/computeoptimizer/recommendation_preferences.go index a8c551888941..6b4c8296be46 100644 --- a/internal/service/computeoptimizer/recommendation_preferences.go +++ b/internal/service/computeoptimizer/recommendation_preferences.go @@ -71,7 +71,7 @@ func (r *recommendationPreferencesResource) Schema(ctx context.Context, request stringplanmodifier.RequiresReplace(), }, Validators: []validator.String{ - stringvalidator.OneOf(enum.Slice(awstypes.ResourceTypeAutoScalingGroup, awstypes.ResourceTypeEc2Instance, awstypes.ResourceTypeRdsDbInstance)...), + stringvalidator.OneOf(enum.Slice(awstypes.ResourceTypeAutoScalingGroup, awstypes.ResourceTypeEc2Instance, awstypes.ResourceTypeRdsDbInstance, awstypes.ResourceTypeAuroraDbClusterStorage)...), }, }, "savings_estimation_mode": schema.StringAttribute{ diff --git a/internal/service/computeoptimizer/service_endpoint_resolver_gen.go b/internal/service/computeoptimizer/service_endpoint_resolver_gen.go index 973c7333a387..bdf5e4f66c7d 100644 --- a/internal/service/computeoptimizer/service_endpoint_resolver_gen.go +++ b/internal/service/computeoptimizer/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params computeoptimizer }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up computeoptimizer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up computeoptimizer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index 6d726c0ac9c8..b688e2c3dbe8 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/configservice/config_rule.go b/internal/service/configservice/config_rule.go index 9163564532c4..d0b5dbe3a066 100644 --- a/internal/service/configservice/config_rule.go +++ b/internal/service/configservice/config_rule.go @@ -236,7 +236,7 @@ func resourceConfigRulePut(ctx context.Context, d *schema.ResourceData, meta any Tags: getTagsIn(ctx), } - _, err := tfresource.RetryWhenIsA[*types.InsufficientPermissionsException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InsufficientPermissionsException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.PutConfigRule(ctx, input) }) @@ -303,7 +303,7 @@ func resourceConfigRuleDelete(ctx context.Context, d *schema.ResourceData, meta timeout = 2 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Config Rule: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteConfigRule(ctx, &configservice.DeleteConfigRuleInput{ ConfigRuleName: aws.String(d.Id()), }) diff --git a/internal/service/configservice/conformance_pack.go b/internal/service/configservice/conformance_pack.go index 2dad2c4da9d5..c896b0b4ecc8 100644 --- a/internal/service/configservice/conformance_pack.go +++ b/internal/service/configservice/conformance_pack.go @@ -187,7 +187,7 @@ func resourceConformancePackDelete(ctx context.Context, d *schema.ResourceData, timeout = 5 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Conformance Pack: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteConformancePack(ctx, &configservice.DeleteConformancePackInput{ ConformancePackName: aws.String(d.Id()), }) diff --git a/internal/service/configservice/delivery_channel.go b/internal/service/configservice/delivery_channel.go index 219c472e9483..134dee716e7a 100644 --- a/internal/service/configservice/delivery_channel.go +++ b/internal/service/configservice/delivery_channel.go @@ -114,7 +114,7 @@ func resourceDeliveryChannelPut(ctx context.Context, d *schema.ResourceData, met input.DeliveryChannel.SnsTopicARN = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*types.InsufficientDeliveryPolicyException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InsufficientDeliveryPolicyException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.PutDeliveryChannel(ctx, input) }) diff --git a/internal/service/configservice/organization_conformance_pack.go b/internal/service/configservice/organization_conformance_pack.go index 10653f975579..6cfe5b198cd8 100644 --- a/internal/service/configservice/organization_conformance_pack.go +++ b/internal/service/configservice/organization_conformance_pack.go @@ -157,7 +157,7 @@ func resourceOrganizationConformancePackCreate(ctx context.Context, d *schema.Re input.TemplateS3Uri = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutOrganizationConformancePack(ctx, input) }) @@ -255,7 +255,7 @@ func resourceOrganizationConformancePackDelete(ctx context.Context, d *schema.Re timeout = 5 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Organization Conformance Pack: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteOrganizationConformancePack(ctx, &configservice.DeleteOrganizationConformancePackInput{ OrganizationConformancePackName: aws.String(d.Id()), }) @@ -364,7 +364,7 @@ func findOrganizationConformancePackStatuses(ctx context.Context, conn *configse const ( timeout = 15 * time.Second ) - outputRaw, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, timeout, func(ctx context.Context) (any, error) { return pages.NextPage(ctx) }) diff --git a/internal/service/configservice/organization_custom_policy_rule.go b/internal/service/configservice/organization_custom_policy_rule.go index a5f8fbf6d7c6..ceec5a2d60f6 100644 --- a/internal/service/configservice/organization_custom_policy_rule.go +++ b/internal/service/configservice/organization_custom_policy_rule.go @@ -190,7 +190,7 @@ func resourceOrganizationCustomPolicyRuleCreate(ctx context.Context, d *schema.R input.OrganizationCustomPolicyRuleMetadata.TagValueScope = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutOrganizationConfigRule(ctx, input) }) @@ -319,7 +319,7 @@ func resourceOrganizationCustomPolicyRuleDelete(ctx context.Context, d *schema.R timeout = 2 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Organization Custom Policy Rule: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteOrganizationConfigRule(ctx, &configservice.DeleteOrganizationConfigRuleInput{ OrganizationConfigRuleName: aws.String(d.Id()), }) diff --git a/internal/service/configservice/organization_custom_rule.go b/internal/service/configservice/organization_custom_rule.go index eaa2312a45d1..c224bc88a303 100644 --- a/internal/service/configservice/organization_custom_rule.go +++ b/internal/service/configservice/organization_custom_rule.go @@ -170,7 +170,7 @@ func resourceOrganizationCustomRuleCreate(ctx context.Context, d *schema.Resourc input.OrganizationCustomRuleMetadata.TagValueScope = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutOrganizationConfigRule(ctx, input) }) @@ -285,7 +285,7 @@ func resourceOrganizationCustomRuleDelete(ctx context.Context, d *schema.Resourc timeout = 2 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Organization Custom Rule: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteOrganizationConfigRule(ctx, &configservice.DeleteOrganizationConfigRuleInput{ OrganizationConfigRuleName: aws.String(d.Id()), }) diff --git a/internal/service/configservice/organization_managed_rule.go b/internal/service/configservice/organization_managed_rule.go index adf84fe8fbba..c4fb5ef8db9c 100644 --- a/internal/service/configservice/organization_managed_rule.go +++ b/internal/service/configservice/organization_managed_rule.go @@ -162,7 +162,7 @@ func resourceOrganizationManagedRuleCreate(ctx context.Context, d *schema.Resour input.OrganizationManagedRuleMetadata.TagValueScope = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, organizationsPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutOrganizationConfigRule(ctx, input) }) @@ -275,7 +275,7 @@ func resourceOrganizationManagedRuleDelete(ctx context.Context, d *schema.Resour timeout = 2 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Organization Managed Rule: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteOrganizationConfigRule(ctx, &configservice.DeleteOrganizationConfigRuleInput{ OrganizationConfigRuleName: aws.String(d.Id()), }) @@ -398,7 +398,7 @@ func findOrganizationConfigRuleStatuses(ctx context.Context, conn *configservice const ( timeout = 15 * time.Second ) - outputRaw, err := tfresource.RetryWhenIsA[*types.OrganizationAccessDeniedException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *types.OrganizationAccessDeniedException](ctx, timeout, func(ctx context.Context) (any, error) { return pages.NextPage(ctx) }) diff --git a/internal/service/configservice/remediation_configuration.go b/internal/service/configservice/remediation_configuration.go index 0038db087640..d7ef316eb36b 100644 --- a/internal/service/configservice/remediation_configuration.go +++ b/internal/service/configservice/remediation_configuration.go @@ -252,7 +252,7 @@ func resourceRemediationConfigurationDelete(ctx context.Context, d *schema.Resou timeout = 2 * time.Minute ) log.Printf("[DEBUG] Deleting ConfigService Remediation Configuration: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteRemediationConfiguration(ctx, input) }) diff --git a/internal/service/configservice/service_endpoint_resolver_gen.go b/internal/service/configservice/service_endpoint_resolver_gen.go index e01df6060787..618d51fddd7e 100644 --- a/internal/service/configservice/service_endpoint_resolver_gen.go +++ b/internal/service/configservice/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params configservice.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up configservice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up configservice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index 61f1a150fa33..eeabd8b458aa 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/connect/bot_association.go b/internal/service/connect/bot_association.go index 22427967e5c8..77e9fa47ee48 100644 --- a/internal/service/connect/bot_association.go +++ b/internal/service/connect/bot_association.go @@ -89,7 +89,7 @@ func resourceBotAssociationCreate(ctx context.Context, d *schema.ResourceData, m const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.AssociateBot(ctx, input) }) diff --git a/internal/service/connect/queue.go b/internal/service/connect/queue.go index 3308c7e0315a..2833742be89a 100644 --- a/internal/service/connect/queue.go +++ b/internal/service/connect/queue.go @@ -360,7 +360,7 @@ func resourceQueueDelete(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 1 * time.Minute ) - _, err = tfresource.RetryWhenIsA[*awstypes.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteQueue(ctx, &connect.DeleteQueueInput{ InstanceId: aws.String(instanceID), QueueId: aws.String(queueID), diff --git a/internal/service/connect/service_endpoint_resolver_gen.go b/internal/service/connect/service_endpoint_resolver_gen.go index b4680b90f281..d998436b6131 100644 --- a/internal/service/connect/service_endpoint_resolver_gen.go +++ b/internal/service/connect/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params connect.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up connect endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up connect endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index b6e2bd8d8b4e..0f54d080cc93 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/connectcases/service_endpoint_resolver_gen.go b/internal/service/connectcases/service_endpoint_resolver_gen.go index 8cfc2cd3ab06..8d6d7609bd2d 100644 --- a/internal/service/connectcases/service_endpoint_resolver_gen.go +++ b/internal/service/connectcases/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params connectcases.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up connectcases endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up connectcases endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index b0ce20a0658f..df065337cc01 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/controltower/service_endpoint_resolver_gen.go b/internal/service/controltower/service_endpoint_resolver_gen.go index f5c63b95e4ad..a97c5e978fe4 100644 --- a/internal/service/controltower/service_endpoint_resolver_gen.go +++ b/internal/service/controltower/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params controltower.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up controltower endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up controltower endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index 7caf3813d2ea..0c20d1c0ce41 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/costoptimizationhub/service_endpoint_resolver_gen.go b/internal/service/costoptimizationhub/service_endpoint_resolver_gen.go index 3a9ff94db756..e965f938a097 100644 --- a/internal/service/costoptimizationhub/service_endpoint_resolver_gen.go +++ b/internal/service/costoptimizationhub/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params costoptimization }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up costoptimizationhub endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up costoptimizationhub endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 3e72578d664b..c4404287e8bf 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/cur/service_endpoint_resolver_gen.go b/internal/service/cur/service_endpoint_resolver_gen.go index c61e30369f0e..8a97e6d8f093 100644 --- a/internal/service/cur/service_endpoint_resolver_gen.go +++ b/internal/service/cur/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params costandusagerepo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up costandusagereportservice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up costandusagereportservice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 5f1192f0d18b..7c1e0c93e706 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -603,7 +603,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/customerprofiles/service_endpoint_resolver_gen.go b/internal/service/customerprofiles/service_endpoint_resolver_gen.go index e07d29c3a981..dff8d538c74d 100644 --- a/internal/service/customerprofiles/service_endpoint_resolver_gen.go +++ b/internal/service/customerprofiles/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params customerprofiles }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up customerprofiles endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up customerprofiles endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index fe9ed1345d78..95334a75587a 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/databrew/service_endpoint_resolver_gen.go b/internal/service/databrew/service_endpoint_resolver_gen.go index 1a5af3d567d3..64352236710b 100644 --- a/internal/service/databrew/service_endpoint_resolver_gen.go +++ b/internal/service/databrew/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params databrew.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up databrew endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up databrew endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/databrew/service_endpoints_gen_test.go b/internal/service/databrew/service_endpoints_gen_test.go index 003d69a63753..a4403e28604f 100644 --- a/internal/service/databrew/service_endpoints_gen_test.go +++ b/internal/service/databrew/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dataexchange/revision_assets_tags_gen_test.go b/internal/service/dataexchange/revision_assets_tags_gen_test.go index ec154f0f5623..17120f3e1318 100644 --- a/internal/service/dataexchange/revision_assets_tags_gen_test.go +++ b/internal/service/dataexchange/revision_assets_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDataExchangeRevisionAssets_tags(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -156,6 +157,7 @@ func TestAccDataExchangeRevisionAssets_tags(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -203,6 +205,7 @@ func TestAccDataExchangeRevisionAssets_tags_null(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -240,6 +243,7 @@ func TestAccDataExchangeRevisionAssets_tags_EmptyMap(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -308,6 +312,7 @@ func TestAccDataExchangeRevisionAssets_tags_AddOnUpdate(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -377,6 +382,7 @@ func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -492,6 +498,7 @@ func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -570,6 +577,7 @@ func TestAccDataExchangeRevisionAssets_tags_EmptyTag_OnUpdate_Replace(t *testing func TestAccDataExchangeRevisionAssets_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -700,6 +708,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_providerOnly(t *testing. func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -818,6 +827,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nonOverlapping(t *testin func TestAccDataExchangeRevisionAssets_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -946,6 +956,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_overlapping(t *testing.T func TestAccDataExchangeRevisionAssets_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1022,6 +1033,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_updateToProviderOnly(t * func TestAccDataExchangeRevisionAssets_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1098,6 +1110,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_updateToResourceOnly(t * func TestAccDataExchangeRevisionAssets_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1148,6 +1161,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_emptyResourceTag(t *test func TestAccDataExchangeRevisionAssets_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1192,6 +1206,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_emptyProviderOnlyTag(t * func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1242,6 +1257,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nullOverlappingResourceT func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1294,6 +1310,7 @@ func TestAccDataExchangeRevisionAssets_tags_DefaultTags_nullNonOverlappingResour func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1338,6 +1355,7 @@ func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1440,7 @@ func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnUpdate_Add(t *testing. func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1498,6 +1517,7 @@ func TestAccDataExchangeRevisionAssets_tags_ComputedTag_OnUpdate_Replace(t *test func TestAccDataExchangeRevisionAssets_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1660,6 +1680,7 @@ func TestAccDataExchangeRevisionAssets_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccDataExchangeRevisionAssets_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dataexchange.GetRevisionOutput resourceName := "aws_dataexchange_revision_assets.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dataexchange/service_endpoint_resolver_gen.go b/internal/service/dataexchange/service_endpoint_resolver_gen.go index 0ebda75769a3..b4a45c44c67d 100644 --- a/internal/service/dataexchange/service_endpoint_resolver_gen.go +++ b/internal/service/dataexchange/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params dataexchange.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up dataexchange endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up dataexchange endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index e6390776a1ca..beba2b4ab918 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/datapipeline/pipeline_data_source_tags_gen_test.go b/internal/service/datapipeline/pipeline_data_source_tags_gen_test.go index 4e8213d47990..86ed0cbdbaaf 100644 --- a/internal/service/datapipeline/pipeline_data_source_tags_gen_test.go +++ b/internal/service/datapipeline/pipeline_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccDataPipelinePipelineDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccDataPipelinePipelineDataSource_tags(t *testing.T) { func TestAccDataPipelinePipelineDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccDataPipelinePipelineDataSource_tags_NullMap(t *testing.T) { func TestAccDataPipelinePipelineDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccDataPipelinePipelineDataSource_tags_EmptyMap(t *testing.T) { func TestAccDataPipelinePipelineDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccDataPipelinePipelineDataSource_tags_DefaultTags_nonOverlapping(t *te func TestAccDataPipelinePipelineDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccDataPipelinePipelineDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccDataPipelinePipelineDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/datapipeline/pipeline_tags_gen_test.go b/internal/service/datapipeline/pipeline_tags_gen_test.go index 5e56b32a7775..dc0399d0e3f4 100644 --- a/internal/service/datapipeline/pipeline_tags_gen_test.go +++ b/internal/service/datapipeline/pipeline_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDataPipelinePipeline_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccDataPipelinePipeline_tags(t *testing.T) { func TestAccDataPipelinePipeline_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccDataPipelinePipeline_tags_null(t *testing.T) { func TestAccDataPipelinePipeline_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccDataPipelinePipeline_tags_EmptyMap(t *testing.T) { func TestAccDataPipelinePipeline_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccDataPipelinePipeline_tags_AddOnUpdate(t *testing.T) { func TestAccDataPipelinePipeline_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccDataPipelinePipeline_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDataPipelinePipeline_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccDataPipelinePipeline_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDataPipelinePipeline_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccDataPipelinePipeline_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDataPipelinePipeline_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDataPipelinePipeline_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDataPipelinePipeline_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDataPipelinePipeline_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccDataPipelinePipeline_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccDataPipelinePipeline_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccDataPipelinePipeline_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccDataPipelinePipeline_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccDataPipelinePipeline_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccDataPipelinePipeline_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccDataPipelinePipeline_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccDataPipelinePipeline_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDataPipelinePipeline_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccDataPipelinePipeline_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDataPipelinePipeline_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccDataPipelinePipeline_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccDataPipelinePipeline_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccDataPipelinePipeline_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccDataPipelinePipeline_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.PipelineDescription resourceName := "aws_datapipeline_pipeline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/datapipeline/service_endpoint_resolver_gen.go b/internal/service/datapipeline/service_endpoint_resolver_gen.go index 9ce33bd4e962..a5e0fdaa07d7 100644 --- a/internal/service/datapipeline/service_endpoint_resolver_gen.go +++ b/internal/service/datapipeline/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params datapipeline.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up datapipeline endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up datapipeline endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index c9a3669605d3..093dd73c9c78 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/datasync/agent_identity_gen_test.go b/internal/service/datasync/agent_identity_gen_test.go index d4db315b3240..5e265a74551d 100644 --- a/internal/service/datasync/agent_identity_gen_test.go +++ b/internal/service/datasync/agent_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncAgent_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_agent.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -122,7 +122,7 @@ func TestAccDataSyncAgent_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_agent.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -258,7 +258,7 @@ func TestAccDataSyncAgent_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_agent.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_azure_blob_identity_gen_test.go b/internal/service/datasync/location_azure_blob_identity_gen_test.go index b81bfb487fbe..0021b1bdc7de 100644 --- a/internal/service/datasync/location_azure_blob_identity_gen_test.go +++ b/internal/service/datasync/location_azure_blob_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationAzureBlob_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_location_azure_blob.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -122,7 +122,7 @@ func TestAccDataSyncLocationAzureBlob_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_azure_blob.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -258,7 +258,7 @@ func TestAccDataSyncLocationAzureBlob_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_location_azure_blob.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_efs_identity_gen_test.go b/internal/service/datasync/location_efs_identity_gen_test.go index 734e87a5bf73..278b88f2cd39 100644 --- a/internal/service/datasync/location_efs_identity_gen_test.go +++ b/internal/service/datasync/location_efs_identity_gen_test.go @@ -25,7 +25,7 @@ func TestAccDataSyncLocationEFS_Identity_Basic(t *testing.T) { var v datasync.DescribeLocationEfsOutput resourceName := "aws_datasync_location_efs.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -104,7 +104,7 @@ func TestAccDataSyncLocationEFS_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_efs.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -221,7 +221,7 @@ func TestAccDataSyncLocationEFS_Identity_ExistingResource(t *testing.T) { var v datasync.DescribeLocationEfsOutput resourceName := "aws_datasync_location_efs.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_hdfs_identity_gen_test.go b/internal/service/datasync/location_hdfs_identity_gen_test.go index a856ebdc2f80..8c3ccfe29918 100644 --- a/internal/service/datasync/location_hdfs_identity_gen_test.go +++ b/internal/service/datasync/location_hdfs_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationHDFS_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_location_hdfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccDataSyncLocationHDFS_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_hdfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccDataSyncLocationHDFS_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_location_hdfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_nfs_identity_gen_test.go b/internal/service/datasync/location_nfs_identity_gen_test.go index 79db547982b1..091f9e44f16e 100644 --- a/internal/service/datasync/location_nfs_identity_gen_test.go +++ b/internal/service/datasync/location_nfs_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationNFS_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccDataSyncLocationNFS_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccDataSyncLocationNFS_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_object_storage_identity_gen_test.go b/internal/service/datasync/location_object_storage_identity_gen_test.go index 1c32e68a5e58..f7e533303de8 100644 --- a/internal/service/datasync/location_object_storage_identity_gen_test.go +++ b/internal/service/datasync/location_object_storage_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDataSyncLocationObjectStorage_Identity_Basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) domain := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -121,7 +121,7 @@ func TestAccDataSyncLocationObjectStorage_Identity_RegionOverride(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) domain := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -252,7 +252,7 @@ func TestAccDataSyncLocationObjectStorage_Identity_ExistingResource(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) domain := acctest.RandomDomainName() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_s3_identity_gen_test.go b/internal/service/datasync/location_s3_identity_gen_test.go index 36f7d3447034..f787e1dc9586 100644 --- a/internal/service/datasync/location_s3_identity_gen_test.go +++ b/internal/service/datasync/location_s3_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationS3_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_location_s3.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccDataSyncLocationS3_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_s3.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccDataSyncLocationS3_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_location_s3.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/location_smb_identity_gen_test.go b/internal/service/datasync/location_smb_identity_gen_test.go index 554fe0002671..ed556bb9d2f7 100644 --- a/internal/service/datasync/location_smb_identity_gen_test.go +++ b/internal/service/datasync/location_smb_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationSMB_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_location_smb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -122,7 +122,7 @@ func TestAccDataSyncLocationSMB_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_location_smb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -258,7 +258,7 @@ func TestAccDataSyncLocationSMB_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_location_smb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datasync/service_endpoint_resolver_gen.go b/internal/service/datasync/service_endpoint_resolver_gen.go index 307d27b963ca..489daeed63fd 100644 --- a/internal/service/datasync/service_endpoint_resolver_gen.go +++ b/internal/service/datasync/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params datasync.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up datasync endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up datasync endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index 4ee1b4cdba1a..d162ff9feb83 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/datasync/task_identity_gen_test.go b/internal/service/datasync/task_identity_gen_test.go index d31b53734f12..af0c506fdadc 100644 --- a/internal/service/datasync/task_identity_gen_test.go +++ b/internal/service/datasync/task_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncTask_Identity_Basic(t *testing.T) { resourceName := "aws_datasync_task.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccDataSyncTask_Identity_RegionOverride(t *testing.T) { resourceName := "aws_datasync_task.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -239,7 +239,7 @@ func TestAccDataSyncTask_Identity_ExistingResource(t *testing.T) { resourceName := "aws_datasync_task.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/datazone/service_endpoint_resolver_gen.go b/internal/service/datazone/service_endpoint_resolver_gen.go index 31347a04968f..2d647b8a4ed5 100644 --- a/internal/service/datazone/service_endpoint_resolver_gen.go +++ b/internal/service/datazone/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params datazone.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up datazone endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up datazone endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index 6ac731bdffcd..8099a9034461 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dax/service_endpoint_resolver_gen.go b/internal/service/dax/service_endpoint_resolver_gen.go index 9f70e0fc6755..e27ec13ec62b 100644 --- a/internal/service/dax/service_endpoint_resolver_gen.go +++ b/internal/service/dax/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params dax.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up dax endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up dax endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index e25932b2bbc3..e44e00c920c1 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/deploy/service_endpoint_resolver_gen.go b/internal/service/deploy/service_endpoint_resolver_gen.go index 3561dea007c7..ccf469ae04f8 100644 --- a/internal/service/deploy/service_endpoint_resolver_gen.go +++ b/internal/service/deploy/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params codedeploy.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up codedeploy endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up codedeploy endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index 82dc5d10b2e4..8cebc7411b4f 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/detective/graph.go b/internal/service/detective/graph.go index 0865a601cdff..33cfb29343e1 100644 --- a/internal/service/detective/graph.go +++ b/internal/service/detective/graph.go @@ -62,7 +62,7 @@ func resourceGraphCreate(ctx context.Context, d *schema.ResourceData, meta any) Tags: getTagsIn(ctx), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InternalServerException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InternalServerException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateGraph(ctx, input) }) diff --git a/internal/service/detective/member.go b/internal/service/detective/member.go index e750fe41dbb7..59d309711263 100644 --- a/internal/service/detective/member.go +++ b/internal/service/detective/member.go @@ -117,7 +117,7 @@ func resourceMemberCreate(ctx context.Context, d *schema.ResourceData, meta any) input.Message = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*awstypes.InternalServerException](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InternalServerException](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateMembers(ctx, input) }) diff --git a/internal/service/detective/service_endpoint_resolver_gen.go b/internal/service/detective/service_endpoint_resolver_gen.go index 5bf3fbefadd8..3e027360b864 100644 --- a/internal/service/detective/service_endpoint_resolver_gen.go +++ b/internal/service/detective/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params detective.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up detective endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up detective endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index ab7c87c07746..4e8478979437 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/devicefarm/device_pool_identity_gen_test.go b/internal/service/devicefarm/device_pool_identity_gen_test.go index 5fab059a8636..e2e006084c50 100644 --- a/internal/service/devicefarm/device_pool_identity_gen_test.go +++ b/internal/service/devicefarm/device_pool_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmDevicePool_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_device_pool.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccDeviceFarmDevicePool_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_device_pool.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devicefarm/instance_profile_identity_gen_test.go b/internal/service/devicefarm/instance_profile_identity_gen_test.go index 83ff2246761b..0418f0d9baed 100644 --- a/internal/service/devicefarm/instance_profile_identity_gen_test.go +++ b/internal/service/devicefarm/instance_profile_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmInstanceProfile_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_instance_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccDeviceFarmInstanceProfile_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_instance_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devicefarm/network_profile_identity_gen_test.go b/internal/service/devicefarm/network_profile_identity_gen_test.go index cfd7a0c59d62..326cbaf98ed9 100644 --- a/internal/service/devicefarm/network_profile_identity_gen_test.go +++ b/internal/service/devicefarm/network_profile_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmNetworkProfile_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_network_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccDeviceFarmNetworkProfile_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_network_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devicefarm/project_identity_gen_test.go b/internal/service/devicefarm/project_identity_gen_test.go index 4294ee486224..f8f8cff84940 100644 --- a/internal/service/devicefarm/project_identity_gen_test.go +++ b/internal/service/devicefarm/project_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmProject_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccDeviceFarmProject_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devicefarm/service_endpoint_resolver_gen.go b/internal/service/devicefarm/service_endpoint_resolver_gen.go index 093e86cec0f8..62da88fb5167 100644 --- a/internal/service/devicefarm/service_endpoint_resolver_gen.go +++ b/internal/service/devicefarm/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params devicefarm.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up devicefarm endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up devicefarm endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index f0728b88cc31..ce9a225b5821 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/devicefarm/test_grid_project_identity_gen_test.go b/internal/service/devicefarm/test_grid_project_identity_gen_test.go index 74d3471a0815..8ce7437ea40d 100644 --- a/internal/service/devicefarm/test_grid_project_identity_gen_test.go +++ b/internal/service/devicefarm/test_grid_project_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmTestGridProject_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_test_grid_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -117,7 +117,7 @@ func TestAccDeviceFarmTestGridProject_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_test_grid_project.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devicefarm/upload_identity_gen_test.go b/internal/service/devicefarm/upload_identity_gen_test.go index 24d474766df1..70c46595b631 100644 --- a/internal/service/devicefarm/upload_identity_gen_test.go +++ b/internal/service/devicefarm/upload_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccDeviceFarmUpload_Identity_Basic(t *testing.T) { resourceName := "aws_devicefarm_upload.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -120,7 +120,7 @@ func TestAccDeviceFarmUpload_Identity_ExistingResource(t *testing.T) { resourceName := "aws_devicefarm_upload.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devopsguru/event_sources_config.go b/internal/service/devopsguru/event_sources_config.go index 50dcaae4c17a..cc0d7ab19044 100644 --- a/internal/service/devopsguru/event_sources_config.go +++ b/internal/service/devopsguru/event_sources_config.go @@ -29,6 +29,7 @@ import ( // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/devopsguru;devopsguru.DescribeEventSourcesConfigOutput") // @Testing(preCheck="testAccPreCheck") // @Testing(generator=false) +// @Testing(preIdentityVersion="v5.100.0") func newEventSourcesConfigResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &eventSourcesConfigResource{}, nil } diff --git a/internal/service/devopsguru/event_sources_config_identity_gen_test.go b/internal/service/devopsguru/event_sources_config_identity_gen_test.go index f28c86e70c6f..c758adf8b50c 100644 --- a/internal/service/devopsguru/event_sources_config_identity_gen_test.go +++ b/internal/service/devopsguru/event_sources_config_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccDevOpsGuruEventSourcesConfig_Identity_Basic(t *testing.T) { var v devopsguru.DescribeEventSourcesConfigOutput resourceName := "aws_devopsguru_event_sources_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func testAccDevOpsGuruEventSourcesConfig_Identity_RegionOverride(t *testing.T) { resourceName := "aws_devopsguru_event_sources_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -229,7 +229,7 @@ func testAccDevOpsGuruEventSourcesConfig_Identity_ExistingResource(t *testing.T) var v devopsguru.DescribeEventSourcesConfigOutput resourceName := "aws_devopsguru_event_sources_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/devopsguru/service_endpoint_resolver_gen.go b/internal/service/devopsguru/service_endpoint_resolver_gen.go index 2e3c105cb463..e99c3a70e8d3 100644 --- a/internal/service/devopsguru/service_endpoint_resolver_gen.go +++ b/internal/service/devopsguru/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params devopsguru.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up devopsguru endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up devopsguru endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index c6b3fc724e48..f22dfa54bced 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/devopsguru/service_integration.go b/internal/service/devopsguru/service_integration.go index d41eb9395fca..2c16c77e059e 100644 --- a/internal/service/devopsguru/service_integration.go +++ b/internal/service/devopsguru/service_integration.go @@ -29,6 +29,7 @@ import ( // @SingletonIdentity(identityDuplicateAttributes="id") // @Testing(preCheck="testAccPreCheck") // @Testing(generator=false) +// @Testing(preIdentityVersion="v5.100.0") func newServiceIntegrationResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &serviceIntegrationResource{}, nil } diff --git a/internal/service/devopsguru/service_integration_identity_gen_test.go b/internal/service/devopsguru/service_integration_identity_gen_test.go index 0f5c98a2d0c2..141d012fd4a6 100644 --- a/internal/service/devopsguru/service_integration_identity_gen_test.go +++ b/internal/service/devopsguru/service_integration_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccDevOpsGuruServiceIntegration_IdentitySerial(t *testing.T) { func testAccDevOpsGuruServiceIntegration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_devopsguru_service_integration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +113,7 @@ func testAccDevOpsGuruServiceIntegration_Identity_RegionOverride(t *testing.T) { resourceName := "aws_devopsguru_service_integration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -222,9 +223,10 @@ func testAccDevOpsGuruServiceIntegration_Identity_RegionOverride(t *testing.T) { func testAccDevOpsGuruServiceIntegration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_devopsguru_service_integration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/directconnect/service_endpoint_resolver_gen.go b/internal/service/directconnect/service_endpoint_resolver_gen.go index 01356443ed8e..354800f12385 100644 --- a/internal/service/directconnect/service_endpoint_resolver_gen.go +++ b/internal/service/directconnect/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params directconnect.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up directconnect endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up directconnect endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index d6f8c9a1ae4c..1fabf4e792e3 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dlm/lifecycle_policy.go b/internal/service/dlm/lifecycle_policy.go index 02f1a82aedbd..81c8213459ab 100644 --- a/internal/service/dlm/lifecycle_policy.go +++ b/internal/service/dlm/lifecycle_policy.go @@ -498,7 +498,7 @@ func resourceLifecyclePolicyCreate(ctx context.Context, d *schema.ResourceData, Tags: getTagsIn(ctx), } - out, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, createRetryTimeout, func() (any, error) { + out, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, createRetryTimeout, func(ctx context.Context) (any, error) { return conn.CreateLifecyclePolicy(ctx, &input) }) diff --git a/internal/service/dlm/service_endpoint_resolver_gen.go b/internal/service/dlm/service_endpoint_resolver_gen.go index 750643613dac..dd4c75a0bca5 100644 --- a/internal/service/dlm/service_endpoint_resolver_gen.go +++ b/internal/service/dlm/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params dlm.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up dlm endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up dlm endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index 92c4be65c478..12b6b281301b 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dms/certificate_data_source_tags_gen_test.go b/internal/service/dms/certificate_data_source_tags_gen_test.go index 2fe68ba7a644..28cae691c381 100644 --- a/internal/service/dms/certificate_data_source_tags_gen_test.go +++ b/internal/service/dms/certificate_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDMSCertificateDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDMSCertificateDataSource_tags(t *testing.T) { func TestAccDMSCertificateDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDMSCertificateDataSource_tags_NullMap(t *testing.T) { func TestAccDMSCertificateDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDMSCertificateDataSource_tags_EmptyMap(t *testing.T) { func TestAccDMSCertificateDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDMSCertificateDataSource_tags_DefaultTags_nonOverlapping(t *testing. func TestAccDMSCertificateDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDMSCertificateDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccDMSCertificateDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/certificate_tags_gen_test.go b/internal/service/dms/certificate_tags_gen_test.go index 1c913d1e01f3..6f45e0bd6ec1 100644 --- a/internal/service/dms/certificate_tags_gen_test.go +++ b/internal/service/dms/certificate_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDMSCertificate_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccDMSCertificate_tags(t *testing.T) { func TestAccDMSCertificate_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccDMSCertificate_tags_null(t *testing.T) { func TestAccDMSCertificate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccDMSCertificate_tags_EmptyMap(t *testing.T) { func TestAccDMSCertificate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccDMSCertificate_tags_AddOnUpdate(t *testing.T) { func TestAccDMSCertificate_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccDMSCertificate_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccDMSCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccDMSCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccDMSCertificate_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccDMSCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccDMSCertificate_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccDMSCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccDMSCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccDMSCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccDMSCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccDMSCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccDMSCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccDMSCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccDMSCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccDMSCertificate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccDMSCertificate_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccDMSCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccDMSCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccDMSCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccDMSCertificate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/endpoint.go b/internal/service/dms/endpoint.go index f69c31587647..e109733122de 100644 --- a/internal/service/dms/endpoint.go +++ b/internal/service/dms/endpoint.go @@ -831,8 +831,8 @@ func resourceEndpointCreate(ctx context.Context, d *schema.ResourceData, meta an expandTopLevelConnectionInfo(d, &input) } - _, err := tfresource.RetryWhenIsA[*awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutCreate), + func(ctx context.Context) (any, error) { return conn.CreateEndpoint(ctx, &input) }) diff --git a/internal/service/dms/endpoint_data_source_tags_gen_test.go b/internal/service/dms/endpoint_data_source_tags_gen_test.go index 6e0022939547..05f89e60f6f8 100644 --- a/internal/service/dms/endpoint_data_source_tags_gen_test.go +++ b/internal/service/dms/endpoint_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDMSEndpointDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDMSEndpointDataSource_tags(t *testing.T) { func TestAccDMSEndpointDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDMSEndpointDataSource_tags_NullMap(t *testing.T) { func TestAccDMSEndpointDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDMSEndpointDataSource_tags_EmptyMap(t *testing.T) { func TestAccDMSEndpointDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDMSEndpointDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccDMSEndpointDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDMSEndpointDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccDMSEndpointDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/endpoint_tags_gen_test.go b/internal/service/dms/endpoint_tags_gen_test.go index dedd4ecea3fa..1a333cf53f09 100644 --- a/internal/service/dms/endpoint_tags_gen_test.go +++ b/internal/service/dms/endpoint_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDMSEndpoint_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -210,6 +211,7 @@ func TestAccDMSEndpoint_tags(t *testing.T) { func TestAccDMSEndpoint_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -279,6 +281,7 @@ func TestAccDMSEndpoint_tags_null(t *testing.T) { func TestAccDMSEndpoint_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -344,6 +347,7 @@ func TestAccDMSEndpoint_tags_EmptyMap(t *testing.T) { func TestAccDMSEndpoint_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -427,6 +431,7 @@ func TestAccDMSEndpoint_tags_AddOnUpdate(t *testing.T) { func TestAccDMSEndpoint_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -521,6 +526,7 @@ func TestAccDMSEndpoint_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSEndpoint_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -663,6 +669,7 @@ func TestAccDMSEndpoint_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSEndpoint_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -754,6 +761,7 @@ func TestAccDMSEndpoint_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -946,6 +954,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1114,6 +1123,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1298,6 +1308,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1390,6 +1401,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1481,6 +1493,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1548,6 +1561,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1607,6 +1621,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccDMSEndpoint_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1686,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccDMSEndpoint_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1735,6 +1751,7 @@ func TestAccDMSEndpoint_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccDMSEndpoint_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1792,6 +1809,7 @@ func TestAccDMSEndpoint_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSEndpoint_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1891,6 +1909,7 @@ func TestAccDMSEndpoint_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSEndpoint_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1980,6 +1999,7 @@ func TestAccDMSEndpoint_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSEndpoint_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2141,6 +2161,7 @@ func TestAccDMSEndpoint_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccDMSEndpoint_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/event_subscription_tags_gen_test.go b/internal/service/dms/event_subscription_tags_gen_test.go index 4c92d5236178..266389f8cd4a 100644 --- a/internal/service/dms/event_subscription_tags_gen_test.go +++ b/internal/service/dms/event_subscription_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDMSEventSubscription_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccDMSEventSubscription_tags(t *testing.T) { func TestAccDMSEventSubscription_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccDMSEventSubscription_tags_null(t *testing.T) { func TestAccDMSEventSubscription_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccDMSEventSubscription_tags_EmptyMap(t *testing.T) { func TestAccDMSEventSubscription_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccDMSEventSubscription_tags_AddOnUpdate(t *testing.T) { func TestAccDMSEventSubscription_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccDMSEventSubscription_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSEventSubscription_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccDMSEventSubscription_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSEventSubscription_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccDMSEventSubscription_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSEventSubscription_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSEventSubscription_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSEventSubscription_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSEventSubscription_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccDMSEventSubscription_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccDMSEventSubscription_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccDMSEventSubscription_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccDMSEventSubscription_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccDMSEventSubscription_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccDMSEventSubscription_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccDMSEventSubscription_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccDMSEventSubscription_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSEventSubscription_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccDMSEventSubscription_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSEventSubscription_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccDMSEventSubscription_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccDMSEventSubscription_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccDMSEventSubscription_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccDMSEventSubscription_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.EventSubscription resourceName := "aws_dms_event_subscription.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_config_identity_gen_test.go b/internal/service/dms/replication_config_identity_gen_test.go index fd516d3ed612..388458195d2f 100644 --- a/internal/service/dms/replication_config_identity_gen_test.go +++ b/internal/service/dms/replication_config_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDMSReplicationConfig_Identity_Basic(t *testing.T) { resourceName := "aws_dms_replication_config.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccDMSReplicationConfig_Identity_RegionOverride(t *testing.T) { resourceName := "aws_dms_replication_config.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -242,7 +242,7 @@ func TestAccDMSReplicationConfig_Identity_ExistingResource(t *testing.T) { resourceName := "aws_dms_replication_config.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/dms/replication_config_tags_gen_test.go b/internal/service/dms/replication_config_tags_gen_test.go index 68c42caaa67d..05d975f3434a 100644 --- a/internal/service/dms/replication_config_tags_gen_test.go +++ b/internal/service/dms/replication_config_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDMSReplicationConfig_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccDMSReplicationConfig_tags(t *testing.T) { func TestAccDMSReplicationConfig_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccDMSReplicationConfig_tags_null(t *testing.T) { func TestAccDMSReplicationConfig_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccDMSReplicationConfig_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationConfig_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccDMSReplicationConfig_tags_AddOnUpdate(t *testing.T) { func TestAccDMSReplicationConfig_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccDMSReplicationConfig_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSReplicationConfig_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccDMSReplicationConfig_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationConfig_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccDMSReplicationConfig_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSReplicationConfig_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSReplicationConfig_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSReplicationConfig_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSReplicationConfig_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccDMSReplicationConfig_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccDMSReplicationConfig_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccDMSReplicationConfig_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccDMSReplicationConfig_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccDMSReplicationConfig_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccDMSReplicationConfig_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccDMSReplicationConfig_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccDMSReplicationConfig_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSReplicationConfig_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccDMSReplicationConfig_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationConfig_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccDMSReplicationConfig_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccDMSReplicationConfig_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccDMSReplicationConfig_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccDMSReplicationConfig_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfig resourceName := "aws_dms_replication_config.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_instance_data_source_tags_gen_test.go b/internal/service/dms/replication_instance_data_source_tags_gen_test.go index d17d7ca5bb08..c70e7a8ba913 100644 --- a/internal/service/dms/replication_instance_data_source_tags_gen_test.go +++ b/internal/service/dms/replication_instance_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDMSReplicationInstanceDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDMSReplicationInstanceDataSource_tags(t *testing.T) { func TestAccDMSReplicationInstanceDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDMSReplicationInstanceDataSource_tags_NullMap(t *testing.T) { func TestAccDMSReplicationInstanceDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDMSReplicationInstanceDataSource_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationInstanceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDMSReplicationInstanceDataSource_tags_DefaultTags_nonOverlapping(t * func TestAccDMSReplicationInstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDMSReplicationInstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag( func TestAccDMSReplicationInstanceDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_instance_tags_gen_test.go b/internal/service/dms/replication_instance_tags_gen_test.go index 786e93e4c60a..d88018324a72 100644 --- a/internal/service/dms/replication_instance_tags_gen_test.go +++ b/internal/service/dms/replication_instance_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDMSReplicationInstance_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -210,6 +211,7 @@ func TestAccDMSReplicationInstance_tags(t *testing.T) { func TestAccDMSReplicationInstance_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -279,6 +281,7 @@ func TestAccDMSReplicationInstance_tags_null(t *testing.T) { func TestAccDMSReplicationInstance_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -344,6 +347,7 @@ func TestAccDMSReplicationInstance_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationInstance_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -427,6 +431,7 @@ func TestAccDMSReplicationInstance_tags_AddOnUpdate(t *testing.T) { func TestAccDMSReplicationInstance_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -521,6 +526,7 @@ func TestAccDMSReplicationInstance_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSReplicationInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -663,6 +669,7 @@ func TestAccDMSReplicationInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationInstance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -754,6 +761,7 @@ func TestAccDMSReplicationInstance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccDMSReplicationInstance_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -946,6 +954,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSReplicationInstance_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1114,6 +1123,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccDMSReplicationInstance_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1298,6 +1308,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSReplicationInstance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1390,6 +1401,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_updateToProviderOnly(t *test func TestAccDMSReplicationInstance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1481,6 +1493,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_updateToResourceOnly(t *test func TestAccDMSReplicationInstance_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1548,6 +1561,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_emptyResourceTag(t *testing. func TestAccDMSReplicationInstance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1607,6 +1621,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_emptyProviderOnlyTag(t *test func TestAccDMSReplicationInstance_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1686,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccDMSReplicationInstance_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1735,6 +1751,7 @@ func TestAccDMSReplicationInstance_tags_DefaultTags_nullNonOverlappingResourceTa func TestAccDMSReplicationInstance_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1792,6 +1809,7 @@ func TestAccDMSReplicationInstance_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSReplicationInstance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1891,6 +1909,7 @@ func TestAccDMSReplicationInstance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationInstance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1980,6 +1999,7 @@ func TestAccDMSReplicationInstance_tags_ComputedTag_OnUpdate_Replace(t *testing. func TestAccDMSReplicationInstance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2141,6 +2161,7 @@ func TestAccDMSReplicationInstance_tags_IgnoreTags_Overlap_DefaultTag(t *testing func TestAccDMSReplicationInstance_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_subnet_group.go b/internal/service/dms/replication_subnet_group.go index eacfa2754d58..4b44cb9d4069 100644 --- a/internal/service/dms/replication_subnet_group.go +++ b/internal/service/dms/replication_subnet_group.go @@ -81,7 +81,7 @@ func resourceReplicationSubnetGroupCreate(ctx context.Context, d *schema.Resourc Tags: getTagsIn(ctx), } - _, err := tfresource.RetryWhenIsA[*awstypes.AccessDeniedFault](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.AccessDeniedFault](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateReplicationSubnetGroup(ctx, input) }) if err != nil { diff --git a/internal/service/dms/replication_subnet_group_data_source_tags_gen_test.go b/internal/service/dms/replication_subnet_group_data_source_tags_gen_test.go index 4bb45437c592..64bd204d6ca6 100644 --- a/internal/service/dms/replication_subnet_group_data_source_tags_gen_test.go +++ b/internal/service/dms/replication_subnet_group_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDMSReplicationSubnetGroupDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDMSReplicationSubnetGroupDataSource_tags(t *testing.T) { func TestAccDMSReplicationSubnetGroupDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDMSReplicationSubnetGroupDataSource_tags_NullMap(t *testing.T) { func TestAccDMSReplicationSubnetGroupDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDMSReplicationSubnetGroupDataSource_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationSubnetGroupDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDMSReplicationSubnetGroupDataSource_tags_DefaultTags_nonOverlapping( func TestAccDMSReplicationSubnetGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDMSReplicationSubnetGroupDataSource_tags_IgnoreTags_Overlap_DefaultT func TestAccDMSReplicationSubnetGroupDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_subnet_group_tags_gen_test.go b/internal/service/dms/replication_subnet_group_tags_gen_test.go index 71d3ace46264..5cc2c52e6d2f 100644 --- a/internal/service/dms/replication_subnet_group_tags_gen_test.go +++ b/internal/service/dms/replication_subnet_group_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDMSReplicationSubnetGroup_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccDMSReplicationSubnetGroup_tags(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccDMSReplicationSubnetGroup_tags_null(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccDMSReplicationSubnetGroup_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccDMSReplicationSubnetGroup_tags_AddOnUpdate(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccDMSReplicationSubnetGroup_tags_EmptyTag_OnUpdate_Replace(t *testing. func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_providerOnly(t *testing.T func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nonOverlapping(t *testing func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_overlapping(t *testing.T) func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_updateToProviderOnly(t *t func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_updateToResourceOnly(t *t func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_emptyResourceTag(t *testi func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_emptyProviderOnlyTag(t *t func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nullOverlappingResourceTa func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccDMSReplicationSubnetGroup_tags_DefaultTags_nullNonOverlappingResourc func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccDMSReplicationSubnetGroup_tags_ComputedTag_OnUpdate_Replace(t *testi func TestAccDMSReplicationSubnetGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccDMSReplicationSubnetGroup_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccDMSReplicationSubnetGroup_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_replication_subnet_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_task_data_source_tags_gen_test.go b/internal/service/dms/replication_task_data_source_tags_gen_test.go index 1b24f0504a36..5f940cf09e93 100644 --- a/internal/service/dms/replication_task_data_source_tags_gen_test.go +++ b/internal/service/dms/replication_task_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDMSReplicationTaskDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDMSReplicationTaskDataSource_tags(t *testing.T) { func TestAccDMSReplicationTaskDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDMSReplicationTaskDataSource_tags_NullMap(t *testing.T) { func TestAccDMSReplicationTaskDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDMSReplicationTaskDataSource_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationTaskDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDMSReplicationTaskDataSource_tags_DefaultTags_nonOverlapping(t *test func TestAccDMSReplicationTaskDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDMSReplicationTaskDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccDMSReplicationTaskDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/replication_task_tags_gen_test.go b/internal/service/dms/replication_task_tags_gen_test.go index 3a0f223e96ab..9a01eab7bf31 100644 --- a/internal/service/dms/replication_task_tags_gen_test.go +++ b/internal/service/dms/replication_task_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDMSReplicationTask_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccDMSReplicationTask_tags(t *testing.T) { func TestAccDMSReplicationTask_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccDMSReplicationTask_tags_null(t *testing.T) { func TestAccDMSReplicationTask_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccDMSReplicationTask_tags_EmptyMap(t *testing.T) { func TestAccDMSReplicationTask_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccDMSReplicationTask_tags_AddOnUpdate(t *testing.T) { func TestAccDMSReplicationTask_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccDMSReplicationTask_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSReplicationTask_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccDMSReplicationTask_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationTask_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccDMSReplicationTask_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSReplicationTask_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSReplicationTask_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSReplicationTask_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSReplicationTask_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccDMSReplicationTask_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccDMSReplicationTask_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDMSReplicationTask_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccDMSReplicationTask_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccDMSReplicationTask_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccDMSReplicationTask_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccDMSReplicationTask_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccDMSReplicationTask_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSReplicationTask_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccDMSReplicationTask_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSReplicationTask_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccDMSReplicationTask_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSReplicationTask_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccDMSReplicationTask_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccDMSReplicationTask_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationTask resourceName := "aws_dms_replication_task.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/s3_endpoint.go b/internal/service/dms/s3_endpoint.go index 75a197fe3a08..97b430cf4b68 100644 --- a/internal/service/dms/s3_endpoint.go +++ b/internal/service/dms/s3_endpoint.go @@ -351,7 +351,7 @@ func resourceS3EndpointCreate(ctx context.Context, d *schema.ResourceData, meta input.ExtraConnectionAttributes = extraConnectionAnomalies(d) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateEndpoint(ctx, input) }) @@ -493,7 +493,7 @@ func resourceS3EndpointUpdate(ctx context.Context, d *schema.ResourceData, meta input.ExtraConnectionAttributes = extraConnectionAnomalies(d) } - _, err := tfresource.RetryWhenIsA[*awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.AccessDeniedFault](ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.ModifyEndpoint(ctx, input) }) diff --git a/internal/service/dms/s3_endpoint_tags_gen_test.go b/internal/service/dms/s3_endpoint_tags_gen_test.go index 757c888dd28b..0eb94eb75bc9 100644 --- a/internal/service/dms/s3_endpoint_tags_gen_test.go +++ b/internal/service/dms/s3_endpoint_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDMSS3Endpoint_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccDMSS3Endpoint_tags(t *testing.T) { func TestAccDMSS3Endpoint_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccDMSS3Endpoint_tags_null(t *testing.T) { func TestAccDMSS3Endpoint_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccDMSS3Endpoint_tags_EmptyMap(t *testing.T) { func TestAccDMSS3Endpoint_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccDMSS3Endpoint_tags_AddOnUpdate(t *testing.T) { func TestAccDMSS3Endpoint_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccDMSS3Endpoint_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDMSS3Endpoint_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccDMSS3Endpoint_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDMSS3Endpoint_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccDMSS3Endpoint_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccDMSS3Endpoint_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccDMSS3Endpoint_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccDMSS3Endpoint_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccDMSS3Endpoint_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccDMSS3Endpoint_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDMSS3Endpoint_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccDMSS3Endpoint_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDMSS3Endpoint_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccDMSS3Endpoint_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDMSS3Endpoint_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccDMSS3Endpoint_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccDMSS3Endpoint_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dms_s3_endpoint.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dms/service_endpoint_resolver_gen.go b/internal/service/dms/service_endpoint_resolver_gen.go index 1a3d37461269..d6ad98682d99 100644 --- a/internal/service/dms/service_endpoint_resolver_gen.go +++ b/internal/service/dms/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params databasemigratio }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up databasemigrationservice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up databasemigrationservice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index 8e875deb340e..3f4f810c7b12 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/docdb/cluster.go b/internal/service/docdb/cluster.go index e8e7b2a96011..a044fed304d4 100644 --- a/internal/service/docdb/cluster.go +++ b/internal/service/docdb/cluster.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -301,6 +302,31 @@ func resourceCluster() *schema.Resource { "snapshot_identifier", }, }, + "serverless_v2_scaling_configuration": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + names.AttrMaxCapacity: { + Type: schema.TypeFloat, + Required: true, + ValidateFunc: validation.All( + validation.FloatBetween(1.0, 256.0), + validateServerlessCapacity, + ), + }, + "min_capacity": { + Type: schema.TypeFloat, + Required: true, + ValidateFunc: validation.All( + validation.FloatBetween(0.5, 256.0), + validateServerlessCapacity, + ), + }, + }, + }, + }, "skip_final_snapshot": { Type: schema.TypeBool, Optional: true, @@ -346,9 +372,39 @@ func resourceCluster() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, }, }, + CustomizeDiff: customdiff.All( + // if serverless_v2_scaling_configuration is newly set or deleted, ForceNew is required + customdiff.ForceNewIfChange("serverless_v2_scaling_configuration", + func(_ context.Context, old, new, meta any) bool { + o := old != nil && len(old.([]any)) > 0 + n := new != nil && len(new.([]any)) > 0 + if (o && n) || (!o && !n) { + return false + } + return true + }), + ), } } +func validateServerlessCapacity(i any, k string) (ws []string, es []error) { + const ( + epsilon = 1.0e-10 + ) + + v, ok := i.(float64) + if !ok { + es = append(es, fmt.Errorf("expected type of %s to be float64", k)) + return + } + // add a small epsilon to avoid floating point precision issues + if int(v*10+epsilon)%5 != 0 { + es = append(es, fmt.Errorf("%s must be a multiple of 0.5", k)) + return + } + return +} + func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).DocDBClient(ctx) @@ -444,6 +500,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any requiresModifyDbCluster = true } + if v, ok := d.GetOk("serverless_v2_scaling_configuration"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { + input.ServerlessV2ScalingConfiguration = expandServerlessV2ScalingConfiguration(v.([]any)[0].(map[string]any)) + } + if v, ok := d.GetOk(names.AttrStorageType); ok { input.StorageType = aws.String(v.(string)) } @@ -452,7 +512,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any input.VpcSecurityGroupIds = flex.ExpandStringValueSet(v) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.RestoreDBClusterFromSnapshot(ctx, &input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -501,6 +561,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any input.Port = aws.Int32(int32(v.(int))) } + if v, ok := d.GetOk("serverless_v2_scaling_configuration"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { + input.ServerlessV2ScalingConfiguration = expandServerlessV2ScalingConfiguration(v.([]any)[0].(map[string]any)) + } + if v, ok := d.GetOk(names.AttrStorageType); ok { input.StorageType = aws.String(v.(string)) } @@ -509,7 +573,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any input.VpcSecurityGroupIds = flex.ExpandStringValueSet(v) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.RestoreDBClusterToPointInTime(ctx, &input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") if err != nil { @@ -597,6 +661,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any input.PreferredMaintenanceWindow = aws.String(v.(string)) } + if v, ok := d.GetOk("serverless_v2_scaling_configuration"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { + input.ServerlessV2ScalingConfiguration = expandServerlessV2ScalingConfiguration(v.([]any)[0].(map[string]any)) + } + if v, ok := d.GetOk(names.AttrStorageEncrypted); ok { input.StorageEncrypted = aws.Bool(v.(bool)) } @@ -609,7 +677,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any input.VpcSecurityGroupIds = flex.ExpandStringValueSet(v) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateDBCluster(ctx, &input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -704,6 +772,9 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) d.Set("preferred_backup_window", dbc.PreferredBackupWindow) d.Set(names.AttrPreferredMaintenanceWindow, dbc.PreferredMaintenanceWindow) d.Set("reader_endpoint", dbc.ReaderEndpoint) + if err := d.Set("serverless_v2_scaling_configuration", flattenServerlessV2ScalingConfiguration(dbc.ServerlessV2ScalingConfiguration)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting serverless_v2_scaling_configuration: %s", err) + } d.Set(names.AttrStorageEncrypted, dbc.StorageEncrypted) d.Set(names.AttrStorageType, dbc.StorageType) d.Set(names.AttrVPCSecurityGroupIDs, tfslices.ApplyToAll(dbc.VpcSecurityGroups, func(v awstypes.VpcSecurityGroupMembership) string { @@ -771,6 +842,12 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any input.PreferredBackupWindow = aws.String(d.Get("preferred_backup_window").(string)) } + if d.HasChange("serverless_v2_scaling_configuration") { + if v, ok := d.GetOk("serverless_v2_scaling_configuration"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { + input.ServerlessV2ScalingConfiguration = expandServerlessV2ScalingConfiguration(v.([]any)[0].(map[string]any)) + } + } + if d.HasChange(names.AttrStorageType) { input.StorageType = aws.String(d.Get(names.AttrStorageType).(string)) } @@ -929,6 +1006,38 @@ func diffCloudWatchLogsExportConfiguration(old, new []any) ([]any, []any) { return add, disable } +func expandServerlessV2ScalingConfiguration(v map[string]any) *awstypes.ServerlessV2ScalingConfiguration { + if v == nil { + return nil + } + + apiObject := &awstypes.ServerlessV2ScalingConfiguration{} + if v, ok := v[names.AttrMaxCapacity].(float64); ok { + apiObject.MaxCapacity = aws.Float64(v) + } + if v, ok := v["min_capacity"].(float64); ok { + apiObject.MinCapacity = aws.Float64(v) + } + + return apiObject +} + +func flattenServerlessV2ScalingConfiguration(v *awstypes.ServerlessV2ScalingConfigurationInfo) []any { + if v == nil { + return nil + } + + tfMap := map[string]any{} + + if v.MaxCapacity != nil { + tfMap[names.AttrMaxCapacity] = aws.ToFloat64(v.MaxCapacity) + } + if v.MinCapacity != nil { + tfMap["min_capacity"] = aws.ToFloat64(v.MinCapacity) + } + return []any{tfMap} +} + func removeClusterFromGlobalCluster(ctx context.Context, conn *docdb.Client, clusterARN, globalClusterID string, timeout time.Duration) error { input := docdb.RemoveFromGlobalClusterInput{ DbClusterIdentifier: aws.String(clusterARN), diff --git a/internal/service/docdb/cluster_instance.go b/internal/service/docdb/cluster_instance.go index 6b0cc56af960..e96772799fd2 100644 --- a/internal/service/docdb/cluster_instance.go +++ b/internal/service/docdb/cluster_instance.go @@ -219,7 +219,7 @@ func resourceClusterInstanceCreate(ctx context.Context, d *schema.ResourceData, input.PreferredMaintenanceWindow = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateDBInstance(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -341,7 +341,7 @@ func resourceClusterInstanceUpdate(ctx context.Context, d *schema.ResourceData, input.PromotionTier = aws.Int32(int32(d.Get("promotion_tier").(int))) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.ModifyDBInstance(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") diff --git a/internal/service/docdb/cluster_test.go b/internal/service/docdb/cluster_test.go index a27bf7e5cb56..8656f91de0c3 100644 --- a/internal/service/docdb/cluster_test.go +++ b/internal/service/docdb/cluster_test.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -80,6 +81,7 @@ func TestAccDocDBCluster_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "preferred_backup_window"), resource.TestCheckResourceAttrSet(resourceName, names.AttrPreferredMaintenanceWindow), resource.TestCheckResourceAttrSet(resourceName, "reader_endpoint"), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.#", "0"), resource.TestCheckResourceAttr(resourceName, "skip_final_snapshot", acctest.CtTrue), resource.TestCheckNoResourceAttr(resourceName, "snapshot_identifier"), resource.TestCheckResourceAttr(resourceName, names.AttrStorageEncrypted, acctest.CtFalse), @@ -320,6 +322,11 @@ func TestAccDocDBCluster_updateCloudWatchLogsExports(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccClusterConfig_noCloudWatchLogs(rName), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.#", "0"), @@ -339,6 +346,11 @@ func TestAccDocDBCluster_updateCloudWatchLogsExports(t *testing.T) { }, { Config: testAccClusterConfig_basic(rName), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.#", "2"), @@ -434,6 +446,11 @@ func TestAccDocDBCluster_backupsUpdate(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccClusterConfig_backups(rName), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "backup_retention_period", "5"), @@ -455,6 +472,11 @@ func TestAccDocDBCluster_backupsUpdate(t *testing.T) { }, { Config: testAccClusterConfig_backupsUpdate(rName), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "backup_retention_period", "10"), @@ -1005,6 +1027,79 @@ func TestAccDocDBCluster_manageMasterUserPassword(t *testing.T) { }) } +func TestAccDocDBCluster_serverless(t *testing.T) { + ctx := acctest.Context(t) + var dbCluster awstypes.DBCluster + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_docdb_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.DocDBServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterConfig_serverless(rName, 0.6, 1.0), + ExpectError: regexache.MustCompile(`must be a multiple of 0.5`), + }, + { + Config: testAccClusterConfig_serverless(rName, 0.5, 1.0), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.0.min_capacity", "0.5"), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.0.max_capacity", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + names.AttrAllowMajorVersionUpgrade, + names.AttrApplyImmediately, + names.AttrFinalSnapshotIdentifier, + "master_password", + "skip_final_snapshot", + "manage_master_user_password", + }, + }, + { + Config: testAccClusterConfig_serverless(rName, 1.0, 1.5), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.0.min_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.0.max_capacity", "1.5"), + ), + }, + { + Config: testAccClusterConfig_serverlessRemoved(rName), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionDestroyBeforeCreate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "serverless_v2_scaling_configuration.#", "0"), + ), + }, + }, + }) +} + func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).DocDBClient(ctx) @@ -1637,3 +1732,32 @@ resource "aws_docdb_cluster" "test" { } `, rName, passwordConfig)) } + +func testAccClusterConfig_serverless(rName string, minCapacity, maxCapacity float64) string { + return acctest.ConfigCompose(fmt.Sprintf(` +resource "aws_docdb_cluster" "test" { + cluster_identifier = %[1]q + + master_password = "avoid-plaintext-passwords" + master_username = "tfacctest" + skip_final_snapshot = true + + serverless_v2_scaling_configuration { + min_capacity = %[2]f + max_capacity = %[3]f + } +} +`, rName, minCapacity, maxCapacity)) +} + +func testAccClusterConfig_serverlessRemoved(rName string) string { + return acctest.ConfigCompose(fmt.Sprintf(` +resource "aws_docdb_cluster" "test" { + cluster_identifier = %[1]q + + master_password = "avoid-plaintext-passwords" + master_username = "tfacctest" + skip_final_snapshot = true +} +`, rName)) +} diff --git a/internal/service/docdb/global_cluster.go b/internal/service/docdb/global_cluster.go index 9388b793d6b9..1efcb4b2c98a 100644 --- a/internal/service/docdb/global_cluster.go +++ b/internal/service/docdb/global_cluster.go @@ -251,7 +251,7 @@ func resourceGlobalClusterUpdate(ctx context.Context, d *schema.ResourceData, me EngineVersion: aws.String(engineVersion), } - _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.ModifyDBCluster(ctx, input) }, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") diff --git a/internal/service/docdb/service_endpoint_resolver_gen.go b/internal/service/docdb/service_endpoint_resolver_gen.go index e8255189f574..97b2de0568bb 100644 --- a/internal/service/docdb/service_endpoint_resolver_gen.go +++ b/internal/service/docdb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params docdb.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up docdb endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up docdb endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index 28aae8ce3af0..619475bbc410 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/docdbelastic/cluster.go b/internal/service/docdbelastic/cluster.go index bfffb2e4f4a3..293a288177e5 100644 --- a/internal/service/docdbelastic/cluster.go +++ b/internal/service/docdbelastic/cluster.go @@ -42,6 +42,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/docdbelastic/types;awstypes;awstypes.Cluster") // @Testing(importIgnore="admin_user_password") +// @Testing(preIdentityVersion="v5.100.0") func newClusterResource(context.Context) (resource.ResourceWithConfigure, error) { r := &clusterResource{} diff --git a/internal/service/docdbelastic/cluster_identity_gen_test.go b/internal/service/docdbelastic/cluster_identity_gen_test.go index 558e3ce7e98f..79ce28f1d9c9 100644 --- a/internal/service/docdbelastic/cluster_identity_gen_test.go +++ b/internal/service/docdbelastic/cluster_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDocDBElasticCluster_Identity_Basic(t *testing.T) { resourceName := "aws_docdbelastic_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccDocDBElasticCluster_Identity_RegionOverride(t *testing.T) { resourceName := "aws_docdbelastic_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -252,7 +252,7 @@ func TestAccDocDBElasticCluster_Identity_ExistingResource(t *testing.T) { resourceName := "aws_docdbelastic_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/docdbelastic/service_endpoint_resolver_gen.go b/internal/service/docdbelastic/service_endpoint_resolver_gen.go index 38a7dfa18d41..5364316f949c 100644 --- a/internal/service/docdbelastic/service_endpoint_resolver_gen.go +++ b/internal/service/docdbelastic/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params docdbelastic.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up docdbelastic endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up docdbelastic endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index 2c7f79764337..396aa628447a 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/drs/replication_configuration_template.go b/internal/service/drs/replication_configuration_template.go index 564eac092d70..49acddae358a 100644 --- a/internal/service/drs/replication_configuration_template.go +++ b/internal/service/drs/replication_configuration_template.go @@ -282,7 +282,7 @@ func (r *replicationConfigurationTemplateResource) Delete(ctx context.Context, r ReplicationConfigurationTemplateID: data.ID.ValueStringPointer(), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func(ctx context.Context) (any, error) { return conn.DeleteReplicationConfigurationTemplate(ctx, input) }, "DependencyViolation") diff --git a/internal/service/drs/replication_configuration_template_tags_gen_test.go b/internal/service/drs/replication_configuration_template_tags_gen_test.go index 0f090644e30e..540a792d97d8 100644 --- a/internal/service/drs/replication_configuration_template_tags_gen_test.go +++ b/internal/service/drs/replication_configuration_template_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccDRSReplicationConfigurationTemplate_tagsSerial(t *testing.T) { func testAccDRSReplicationConfigurationTemplate_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccDRSReplicationConfigurationTemplate_tags(t *testing.T) { func testAccDRSReplicationConfigurationTemplate_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -291,6 +293,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_null(t *testing.T) { func testAccDRSReplicationConfigurationTemplate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -341,6 +344,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_EmptyMap(t *testing.T) { func testAccDRSReplicationConfigurationTemplate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -421,6 +425,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_AddOnUpdate(t *testing.T) { func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -511,6 +516,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnCreate(t *testin func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -650,6 +656,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnUpdate_Add(t *te func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -740,6 +747,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_EmptyTag_OnUpdate_Replace(t func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -921,6 +929,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_providerOnly(t func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1081,6 +1090,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nonOverlapping( func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1257,6 +1267,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_overlapping(t * func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1347,6 +1358,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_updateToProvide func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1436,6 +1448,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_updateToResourc func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1502,6 +1515,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_emptyResourceTa func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1560,6 +1574,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_emptyProviderOn func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1629,6 +1644,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nullOverlapping func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1700,6 +1716,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_DefaultTags_nullNonOverlapp func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1755,6 +1772,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnCreate(t *tes func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1852,6 +1870,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnUpdate_Add(t func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1939,6 +1958,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_ComputedTag_OnUpdate_Replac func testAccDRSReplicationConfigurationTemplate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2101,6 +2121,7 @@ func testAccDRSReplicationConfigurationTemplate_tags_IgnoreTags_Overlap_DefaultT func testAccDRSReplicationConfigurationTemplate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ReplicationConfigurationTemplate resourceName := "aws_drs_replication_configuration_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/drs/service_endpoint_resolver_gen.go b/internal/service/drs/service_endpoint_resolver_gen.go index 894ecaf255eb..fcc7e41a57a4 100644 --- a/internal/service/drs/service_endpoint_resolver_gen.go +++ b/internal/service/drs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params drs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up drs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up drs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index b121a2113d2f..1a26ad92abdd 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ds/service_endpoint_resolver_gen.go b/internal/service/ds/service_endpoint_resolver_gen.go index 0c2d51f5a96f..d014b5183672 100644 --- a/internal/service/ds/service_endpoint_resolver_gen.go +++ b/internal/service/ds/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params directoryservice }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up directoryservice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up directoryservice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index e92ca4b341a7..2eb0b2c699c7 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dsql/cluster_tags_gen_test.go b/internal/service/dsql/cluster_tags_gen_test.go index 3ee833ac3994..bb1bfc9b10cf 100644 --- a/internal/service/dsql/cluster_tags_gen_test.go +++ b/internal/service/dsql/cluster_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDSQLCluster_tags(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -208,6 +209,7 @@ func TestAccDSQLCluster_tags(t *testing.T) { func TestAccDSQLCluster_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccDSQLCluster_tags_null(t *testing.T) { func TestAccDSQLCluster_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -324,6 +327,7 @@ func TestAccDSQLCluster_tags_EmptyMap(t *testing.T) { func TestAccDSQLCluster_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccDSQLCluster_tags_AddOnUpdate(t *testing.T) { func TestAccDSQLCluster_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccDSQLCluster_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDSQLCluster_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccDSQLCluster_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDSQLCluster_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccDSQLCluster_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -924,6 +932,7 @@ func TestAccDSQLCluster_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1090,6 +1099,7 @@ func TestAccDSQLCluster_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func TestAccDSQLCluster_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1364,6 +1375,7 @@ func TestAccDSQLCluster_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1455,6 +1467,7 @@ func TestAccDSQLCluster_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1536,7 @@ func TestAccDSQLCluster_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1583,6 +1597,7 @@ func TestAccDSQLCluster_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccDSQLCluster_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1669,7 @@ func TestAccDSQLCluster_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccDSQLCluster_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1743,7 @@ func TestAccDSQLCluster_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccDSQLCluster_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1784,6 +1801,7 @@ func TestAccDSQLCluster_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDSQLCluster_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1883,6 +1901,7 @@ func TestAccDSQLCluster_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDSQLCluster_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1972,6 +1991,7 @@ func TestAccDSQLCluster_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDSQLCluster_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2134,6 +2154,7 @@ func TestAccDSQLCluster_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccDSQLCluster_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v dsql.GetClusterOutput resourceName := "aws_dsql_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dsql/service_endpoint_resolver_gen.go b/internal/service/dsql/service_endpoint_resolver_gen.go index 19eb64cd78ed..cc2cf618add3 100644 --- a/internal/service/dsql/service_endpoint_resolver_gen.go +++ b/internal/service/dsql/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params dsql.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up dsql endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up dsql endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dsql/service_endpoints_gen_test.go b/internal/service/dsql/service_endpoints_gen_test.go index 2df8610491c4..1f8b10de72dc 100644 --- a/internal/service/dsql/service_endpoints_gen_test.go +++ b/internal/service/dsql/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dynamodb/resource_policy.go b/internal/service/dynamodb/resource_policy.go index 54083058a32e..bb6337f126f1 100644 --- a/internal/service/dynamodb/resource_policy.go +++ b/internal/service/dynamodb/resource_policy.go @@ -31,6 +31,7 @@ import ( // @ArnIdentity("resource_arn", identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/dynamodb;dynamodb.GetResourcePolicyOutput") // @Testing(importIgnore="policy") +// @Testing(preIdentityVersion="v5.100.0") func newResourcePolicyResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &resourcePolicyResource{} diff --git a/internal/service/dynamodb/resource_policy_identity_gen_test.go b/internal/service/dynamodb/resource_policy_identity_gen_test.go index 1be8e78f39c5..33ccb055fb80 100644 --- a/internal/service/dynamodb/resource_policy_identity_gen_test.go +++ b/internal/service/dynamodb/resource_policy_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDynamoDBResourcePolicy_Identity_Basic(t *testing.T) { resourceName := "aws_dynamodb_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccDynamoDBResourcePolicy_Identity_RegionOverride(t *testing.T) { resourceName := "aws_dynamodb_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -252,7 +252,7 @@ func TestAccDynamoDBResourcePolicy_Identity_ExistingResource(t *testing.T) { resourceName := "aws_dynamodb_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/dynamodb/service_endpoint_resolver_gen.go b/internal/service/dynamodb/service_endpoint_resolver_gen.go index 191011ed05b2..c95db3d33fb1 100644 --- a/internal/service/dynamodb/service_endpoint_resolver_gen.go +++ b/internal/service/dynamodb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params dynamodb.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up dynamodb endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up dynamodb endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index 3003c5ddb7c1..e4d677fa50ba 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -659,7 +659,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index a69a51054aa8..2537b5bb95c8 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -299,6 +299,11 @@ func resourceTable() *schema.Resource { Default: awstypes.MultiRegionConsistencyEventual, ValidateDiagFunc: enum.Validate[awstypes.MultiRegionConsistency](), }, + "deletion_protection_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, names.AttrKMSKeyARN: { Type: schema.TypeString, Optional: true, @@ -1573,6 +1578,12 @@ func createReplicas(ctx context.Context, conn *dynamodb.Client, tableName string if err = updatePITR(ctx, conn, tableName, tfMap["point_in_time_recovery"].(bool), nil, tfMap["region_name"].(string), timeout); err != nil { return fmt.Errorf("updating replica (%s) point in time recovery: %w", tfMap["region_name"].(string), err) } + + if v, ok := tfMap["deletion_protection_enabled"].(bool); ok { + if err = updateReplicaDeletionProtection(ctx, conn, tableName, tfMap["region_name"].(string), v, timeout); err != nil { + return fmt.Errorf("updating replica (%s) deletion protection: %w", tfMap["region_name"].(string), err) + } + } } } return nil @@ -1683,6 +1694,26 @@ func updatePITR(ctx context.Context, conn *dynamodb.Client, tableName string, en return nil } +func updateReplicaDeletionProtection(ctx context.Context, conn *dynamodb.Client, tableName, region string, enabled bool, timeout time.Duration) error { + log.Printf("[DEBUG] Updating DynamoDB deletion protection to %v (%s)", enabled, region) + input := dynamodb.UpdateTableInput{ + TableName: aws.String(tableName), + DeletionProtectionEnabled: aws.Bool(enabled), + } + + optFn := func(o *dynamodb.Options) { o.Region = region } + _, err := conn.UpdateTable(ctx, &input, optFn) + if err != nil { + return fmt.Errorf("updating deletion protection: %w", err) + } + + if _, err := waitReplicaActive(ctx, conn, tableName, region, timeout, replicaPropagationDelay); err != nil { + return fmt.Errorf("waiting for deletion protection update: %w", err) + } + + return nil +} + func updateReplica(ctx context.Context, conn *dynamodb.Client, d *schema.ResourceData) error { oRaw, nRaw := d.GetChange("replica") o := oRaw.(*schema.Set) @@ -1766,6 +1797,14 @@ func updateReplica(ctx context.Context, conn *dynamodb.Client, d *schema.Resourc break } + // just update deletion protection + if ma["deletion_protection_enabled"].(bool) != mr["deletion_protection_enabled"].(bool) { + if err := updateReplicaDeletionProtection(ctx, conn, d.Id(), ma["region_name"].(string), ma["deletion_protection_enabled"].(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { + return fmt.Errorf("updating replica (%s) deletion protection: %w", ma["region_name"].(string), err) + } + break + } + // nothing changed, assuming propagate_tags changed so do nothing here break } @@ -2210,12 +2249,12 @@ func enrichReplicas(ctx context.Context, conn *dynamodb.Client, arn, tableName s continue } - tfMap[names.AttrStreamARN] = aws.ToString(table.LatestStreamArn) - tfMap["stream_label"] = aws.ToString(table.LatestStreamLabel) - + tfMap["deletion_protection_enabled"] = aws.ToBool(table.DeletionProtectionEnabled) if table.SSEDescription != nil { tfMap[names.AttrKMSKeyARN] = aws.ToString(table.SSEDescription.KMSMasterKeyArn) } + tfMap[names.AttrStreamARN] = aws.ToString(table.LatestStreamArn) + tfMap["stream_label"] = aws.ToString(table.LatestStreamLabel) tfList[i] = tfMap } diff --git a/internal/service/dynamodb/table_data_source_tags_gen_test.go b/internal/service/dynamodb/table_data_source_tags_gen_test.go index a96e5793dc4a..9a281010fc9e 100644 --- a/internal/service/dynamodb/table_data_source_tags_gen_test.go +++ b/internal/service/dynamodb/table_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccDynamoDBTableDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccDynamoDBTableDataSource_tags(t *testing.T) { func TestAccDynamoDBTableDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccDynamoDBTableDataSource_tags_NullMap(t *testing.T) { func TestAccDynamoDBTableDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccDynamoDBTableDataSource_tags_EmptyMap(t *testing.T) { func TestAccDynamoDBTableDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccDynamoDBTableDataSource_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccDynamoDBTableDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccDynamoDBTableDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccDynamoDBTableDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dynamodb/table_export_identity_gen_test.go b/internal/service/dynamodb/table_export_identity_gen_test.go index 509780fa5fed..c7c86a6f61b3 100644 --- a/internal/service/dynamodb/table_export_identity_gen_test.go +++ b/internal/service/dynamodb/table_export_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccDynamoDBTableExport_Identity_Basic(t *testing.T) { resourceName := "aws_dynamodb_table_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccDynamoDBTableExport_Identity_RegionOverride(t *testing.T) { resourceName := "aws_dynamodb_table_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccDynamoDBTableExport_Identity_ExistingResource(t *testing.T) { resourceName := "aws_dynamodb_table_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/dynamodb/table_replica_tags_gen_test.go b/internal/service/dynamodb/table_replica_tags_gen_test.go index 9a5172d861c2..174a8b529fdc 100644 --- a/internal/service/dynamodb/table_replica_tags_gen_test.go +++ b/internal/service/dynamodb/table_replica_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccDynamoDBTableReplica_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -213,6 +214,7 @@ func TestAccDynamoDBTableReplica_tags(t *testing.T) { func TestAccDynamoDBTableReplica_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -284,6 +286,7 @@ func TestAccDynamoDBTableReplica_tags_null(t *testing.T) { func TestAccDynamoDBTableReplica_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -351,6 +354,7 @@ func TestAccDynamoDBTableReplica_tags_EmptyMap(t *testing.T) { func TestAccDynamoDBTableReplica_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -436,6 +440,7 @@ func TestAccDynamoDBTableReplica_tags_AddOnUpdate(t *testing.T) { func TestAccDynamoDBTableReplica_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -531,6 +536,7 @@ func TestAccDynamoDBTableReplica_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDynamoDBTableReplica_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -676,6 +682,7 @@ func TestAccDynamoDBTableReplica_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDynamoDBTableReplica_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -769,6 +776,7 @@ func TestAccDynamoDBTableReplica_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDynamoDBTableReplica_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -957,6 +965,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDynamoDBTableReplica_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1122,6 +1131,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDynamoDBTableReplica_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1303,6 +1313,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDynamoDBTableReplica_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1395,6 +1406,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccDynamoDBTableReplica_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1486,6 +1498,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccDynamoDBTableReplica_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1552,6 +1565,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccDynamoDBTableReplica_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1610,6 +1624,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccDynamoDBTableReplica_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1673,6 +1688,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccDynamoDBTableReplica_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1736,6 +1752,7 @@ func TestAccDynamoDBTableReplica_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccDynamoDBTableReplica_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1792,6 +1809,7 @@ func TestAccDynamoDBTableReplica_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDynamoDBTableReplica_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1891,6 +1909,7 @@ func TestAccDynamoDBTableReplica_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDynamoDBTableReplica_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1980,6 +1999,7 @@ func TestAccDynamoDBTableReplica_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccDynamoDBTableReplica_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2144,6 +2164,7 @@ func TestAccDynamoDBTableReplica_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccDynamoDBTableReplica_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_dynamodb_table_replica.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dynamodb/table_tags_gen_test.go b/internal/service/dynamodb/table_tags_gen_test.go index 19b2b8d43241..df502c918323 100644 --- a/internal/service/dynamodb/table_tags_gen_test.go +++ b/internal/service/dynamodb/table_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccDynamoDBTable_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccDynamoDBTable_tags(t *testing.T) { func TestAccDynamoDBTable_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccDynamoDBTable_tags_null(t *testing.T) { func TestAccDynamoDBTable_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccDynamoDBTable_tags_EmptyMap(t *testing.T) { func TestAccDynamoDBTable_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccDynamoDBTable_tags_AddOnUpdate(t *testing.T) { func TestAccDynamoDBTable_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccDynamoDBTable_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_overlapping(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccDynamoDBTable_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccDynamoDBTable_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccDynamoDBTable_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccDynamoDBTable_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccDynamoDBTable_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccDynamoDBTable_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccDynamoDBTable_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccDynamoDBTable_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TableDescription resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index cdcc07803489..7d1a45ba8d1a 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -2034,24 +2034,26 @@ func TestAccDynamoDBTable_Replica_multiple(t *testing.T) { ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("replica"), knownvalue.SetExact([]knownvalue.Check{ knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.AlternateRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNThirdRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.ThirdRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNThirdRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNThirdRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.ThirdRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNThirdRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), })), }, @@ -2079,24 +2081,26 @@ func TestAccDynamoDBTable_Replica_multiple(t *testing.T) { ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("replica"), knownvalue.SetExact([]knownvalue.Check{ knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.AlternateRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNThirdRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.ThirdRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNThirdRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNThirdRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.ThirdRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNThirdRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), })), }, @@ -2147,14 +2151,15 @@ func TestAccDynamoDBTable_Replica_single(t *testing.T) { ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("replica"), knownvalue.SetExact([]knownvalue.Check{ knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.AlternateRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), })), streamLabelExpectChangeWhenRecreated.AddStateValue(resourceName, tfjsonpath.New("replica").AtSliceIndex(0).AtMapKey("stream_label")), @@ -2193,14 +2198,15 @@ func TestAccDynamoDBTable_Replica_single(t *testing.T) { ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("replica"), knownvalue.SetExact([]knownvalue.Check{ knownvalue.ObjectExact(map[string]knownvalue.Check{ - names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), - "consistency_mode": knownvalue.StringExact("EVENTUAL"), - names.AttrKMSKeyARN: knownvalue.StringExact(""), - "point_in_time_recovery": knownvalue.Bool(false), - names.AttrPropagateTags: knownvalue.Bool(false), - "region_name": knownvalue.StringExact(acctest.AlternateRegion()), - names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), - "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), + names.AttrARN: tfknownvalue.RegionalARNAlternateRegionExact("dynamodb", "table/"+rName), + "consistency_mode": knownvalue.StringExact("EVENTUAL"), + "deletion_protection_enabled": knownvalue.Bool(false), + names.AttrKMSKeyARN: knownvalue.StringExact(""), + "point_in_time_recovery": knownvalue.Bool(false), + names.AttrPropagateTags: knownvalue.Bool(false), + "region_name": knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrStreamARN: tfknownvalue.RegionalARNAlternateRegionRegexp("dynamodb", regexache.MustCompile(`table/`+rName+`/stream/`+streamLabelRegex)), + "stream_label": knownvalue.StringRegexp(regexache.MustCompile(`^` + streamLabelRegex + `$`)), }), })), streamLabelExpectChangeWhenRecreated.AddStateValue(resourceName, tfjsonpath.New("replica").AtSliceIndex(0).AtMapKey("stream_label")), @@ -4220,6 +4226,66 @@ func TestAccDynamoDBTable_Replica_upgradeV6_2_0(t *testing.T) { }) } +func TestAccDynamoDBTable_Replica_deletionProtection(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var conf awstypes.TableDescription + resourceName := "aws_dynamodb_table.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckMultipleRegion(t, 3) + }, + ErrorCheck: acctest.ErrorCheck(t, names.DynamoDBServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), + CheckDestroy: testAccCheckTableDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccTableConfig_replicaDeletionProtection(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "replica.0.deletion_protection_enabled", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, "replica.1.deletion_protection_enabled", acctest.CtTrue), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccTableConfig_replicaDeletionProtection(rName, false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "replica.0.deletion_protection_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "replica.1.deletion_protection_enabled", acctest.CtFalse), + ), + }, + { + Config: testAccTableConfig_replicaDeletionProtection(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "replica.0.deletion_protection_enabled", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, "replica.1.deletion_protection_enabled", acctest.CtTrue), + ), + }, + { + Config: testAccTableConfig_replicaDeletionProtection(rName, false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "replica.0.deletion_protection_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "replica.1.deletion_protection_enabled", acctest.CtFalse), + ), + }, + }, + }) +} + func TestAccDynamoDBTable_tableClassInfrequentAccess(t *testing.T) { ctx := acctest.Context(t) var table awstypes.TableDescription @@ -7021,6 +7087,38 @@ resource "aws_dynamodb_table" "test" { `, rName, streamEnabled, viewType)) } +func testAccTableConfig_replicaDeletionProtection(rName string, deletionProtection bool) string { + return acctest.ConfigCompose( + acctest.ConfigMultipleRegionProvider(3), + fmt.Sprintf(` +data "aws_region" "alternate" { + provider = "awsalternate" +} +data "aws_region" "third" { + provider = "awsthird" +} +resource "aws_dynamodb_table" "test" { + name = %[1]q + hash_key = "TestTableHashKey" + billing_mode = "PAY_PER_REQUEST" + stream_enabled = true + stream_view_type = "NEW_AND_OLD_IMAGES" + attribute { + name = "TestTableHashKey" + type = "S" + } + replica { + region_name = data.aws_region.alternate.name + deletion_protection_enabled = %[2]t + } + replica { + region_name = data.aws_region.third.name + deletion_protection_enabled = %[2]t + } +} +`, rName, deletionProtection)) +} + func testAccTableConfig_lsi(rName, lsiName string) string { return fmt.Sprintf(` resource "aws_dynamodb_table" "test" { diff --git a/internal/service/ec2/ebs_snapshot.go b/internal/service/ec2/ebs_snapshot.go index d626bb02c90c..09d6ae27148a 100644 --- a/internal/service/ec2/ebs_snapshot.go +++ b/internal/service/ec2/ebs_snapshot.go @@ -127,7 +127,7 @@ func resourceEBSSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta } outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 1*time.Minute, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateSnapshot(ctx, &input) }, errCodeSnapshotCreationPerVolumeRateExceeded, "The maximum per volume CreateSnapshot request rate has been exceeded") @@ -139,7 +139,7 @@ func resourceEBSSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta d.SetId(aws.ToString(outputRaw.(*ec2.CreateSnapshotOutput).SnapshotId)) _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return waitSnapshotCompleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)) }, errCodeResourceNotReady) @@ -253,7 +253,7 @@ func resourceEBSSnapshotDelete(ctx context.Context, d *schema.ResourceData, meta input := ec2.DeleteSnapshotInput{ SnapshotId: aws.String(d.Id()), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteSnapshot(ctx, &input) }, errCodeInvalidSnapshotInUse) diff --git a/internal/service/ec2/ebs_snapshot_block_public_access_identity_gen_test.go b/internal/service/ec2/ebs_snapshot_block_public_access_identity_gen_test.go index b381d38a3035..8af681baba7f 100644 --- a/internal/service/ec2/ebs_snapshot_block_public_access_identity_gen_test.go +++ b/internal/service/ec2/ebs_snapshot_block_public_access_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccEC2EBSEBSSnapshotBlockPublicAccess_IdentitySerial(t *testing.T) { func testAccEC2EBSEBSSnapshotBlockPublicAccess_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ebs_snapshot_block_public_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,7 +107,7 @@ func testAccEC2EBSEBSSnapshotBlockPublicAccess_Identity_RegionOverride(t *testin resourceName := "aws_ebs_snapshot_block_public_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -213,9 +214,10 @@ func testAccEC2EBSEBSSnapshotBlockPublicAccess_Identity_RegionOverride(t *testin func testAccEC2EBSEBSSnapshotBlockPublicAccess_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ebs_snapshot_block_public_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ec2/ebs_snapshot_copy.go b/internal/service/ec2/ebs_snapshot_copy.go index c94b1526f7af..d974d337acd3 100644 --- a/internal/service/ec2/ebs_snapshot_copy.go +++ b/internal/service/ec2/ebs_snapshot_copy.go @@ -151,7 +151,7 @@ func resourceEBSSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, d.SetId(aws.ToString(output.SnapshotId)) _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return waitSnapshotCompleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)) }, errCodeResourceNotReady) diff --git a/internal/service/ec2/ebs_snapshot_import.go b/internal/service/ec2/ebs_snapshot_import.go index d9adc9b5fda8..ea5e63331d5e 100644 --- a/internal/service/ec2/ebs_snapshot_import.go +++ b/internal/service/ec2/ebs_snapshot_import.go @@ -223,7 +223,7 @@ func resourceEBSSnapshotImportCreate(ctx context.Context, d *schema.ResourceData } outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.ImportSnapshot(ctx, &input) }, errCodeInvalidParameter, "provided does not exist or does not have sufficient permissions") diff --git a/internal/service/ec2/ebs_volume.go b/internal/service/ec2/ebs_volume.go index c547ace29cec..8faca39d2ee2 100644 --- a/internal/service/ec2/ebs_volume.go +++ b/internal/service/ec2/ebs_volume.go @@ -292,7 +292,7 @@ func resourceEBSVolumeDelete(ctx context.Context, d *schema.ResourceData, meta a } outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, 1*time.Minute, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateSnapshot(ctx, &input) }, errCodeSnapshotCreationPerVolumeRateExceeded, "The maximum per volume CreateSnapshot request rate has been exceeded") @@ -304,7 +304,7 @@ func resourceEBSVolumeDelete(ctx context.Context, d *schema.ResourceData, meta a snapshotID := aws.ToString(outputRaw.(*ec2.CreateSnapshotOutput).SnapshotId) _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), - func() (any, error) { + func(ctx context.Context) (any, error) { return waitSnapshotCompleted(ctx, conn, snapshotID, d.Timeout(schema.TimeoutDelete)) }, errCodeResourceNotReady) @@ -319,7 +319,7 @@ func resourceEBSVolumeDelete(ctx context.Context, d *schema.ResourceData, meta a VolumeId: aws.String(d.Id()), } _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteVolume(ctx, &input) }, errCodeVolumeInUse) diff --git a/internal/service/ec2/ec2_eip.go b/internal/service/ec2/ec2_eip.go index d0ac6df09610..f4d3b3c7e1c8 100644 --- a/internal/service/ec2/ec2_eip.go +++ b/internal/service/ec2/ec2_eip.go @@ -192,7 +192,7 @@ func resourceEIPCreate(ctx context.Context, d *schema.ResourceData, meta any) di if instanceID, eniID := d.Get("instance").(string), d.Get("network_interface").(string); instanceID != "" || eniID != "" { _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return nil, associateEIP(ctx, conn, d.Id(), instanceID, eniID, d.Get("associate_with_private_ip").(string)) }, errCodeInvalidAllocationIDNotFound) diff --git a/internal/service/ec2/ec2_image_block_public_access_identity_gen_test.go b/internal/service/ec2/ec2_image_block_public_access_identity_gen_test.go index 5a6f30bbf8b4..8a29bf04faad 100644 --- a/internal/service/ec2/ec2_image_block_public_access_identity_gen_test.go +++ b/internal/service/ec2/ec2_image_block_public_access_identity_gen_test.go @@ -31,9 +31,10 @@ func testAccEC2ImageBlockPublicAccess_IdentitySerial(t *testing.T) { func testAccEC2ImageBlockPublicAccess_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ec2_image_block_public_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -59,9 +60,10 @@ func testAccEC2ImageBlockPublicAccess_Identity_Basic(t *testing.T) { func testAccEC2ImageBlockPublicAccess_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ec2_image_block_public_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ec2/ec2_instance.go b/internal/service/ec2/ec2_instance.go index 0212932a47ad..4d97df236371 100644 --- a/internal/service/ec2/ec2_instance.go +++ b/internal/service/ec2/ec2_instance.go @@ -358,6 +358,11 @@ func resourceInstance() *schema.Resource { return create.StringHashcode(buf.String()) }, }, + names.AttrForceDestroy: { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "get_password_data": { Type: schema.TypeBool, Optional: true, @@ -2232,12 +2237,12 @@ func resourceInstanceDelete(ctx context.Context, d *schema.ResourceData, meta an var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Client(ctx) - if err := disableInstanceAPITermination(ctx, conn, d.Id(), false); err != nil { - log.Printf("[WARN] attempting to terminate EC2 Instance (%s) despite error disabling API termination: %s", d.Id(), err) - } + if d.Get(names.AttrForceDestroy).(bool) { + if err := disableInstanceAPITermination(ctx, conn, d.Id(), false); err != nil { + log.Printf("[WARN] attempting to terminate EC2 Instance (%s) despite error disabling API termination: %s", d.Id(), err) + } - if v, ok := d.GetOk("disable_api_stop"); ok { - if err := disableInstanceAPIStop(ctx, conn, d.Id(), v.(bool)); err != nil { + if err := disableInstanceAPIStop(ctx, conn, d.Id(), false); err != nil { log.Printf("[WARN] attempting to terminate EC2 Instance (%s) despite error disabling API stop: %s", d.Id(), err) } } @@ -3236,7 +3241,7 @@ func startInstance(ctx context.Context, conn *ec2.Client, id string, retry bool, if retry { // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16433. _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, ec2PropagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.StartInstances(ctx, &ec2.StartInstancesInput{ InstanceIds: []string{id}, }) diff --git a/internal/service/ec2/ec2_instance_data_source_tags_gen_test.go b/internal/service/ec2/ec2_instance_data_source_tags_gen_test.go index a3221e530668..de9fef100947 100644 --- a/internal/service/ec2/ec2_instance_data_source_tags_gen_test.go +++ b/internal/service/ec2/ec2_instance_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccEC2InstanceDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -47,6 +48,7 @@ func TestAccEC2InstanceDataSource_tags(t *testing.T) { func TestAccEC2InstanceDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -69,6 +71,7 @@ func TestAccEC2InstanceDataSource_tags_NullMap(t *testing.T) { func TestAccEC2InstanceDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -91,6 +94,7 @@ func TestAccEC2InstanceDataSource_tags_EmptyMap(t *testing.T) { func TestAccEC2InstanceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -121,6 +125,7 @@ func TestAccEC2InstanceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccEC2InstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -157,6 +162,7 @@ func TestAccEC2InstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccEC2InstanceDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_instance.test" acctest.ParallelTest(ctx, t, resource.TestCase{ diff --git a/internal/service/ec2/ec2_instance_tags_gen_test.go b/internal/service/ec2/ec2_instance_tags_gen_test.go index 2d81474394f8..66fae8101217 100644 --- a/internal/service/ec2/ec2_instance_tags_gen_test.go +++ b/internal/service/ec2/ec2_instance_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccEC2Instance_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -203,6 +204,7 @@ func TestAccEC2Instance_tags(t *testing.T) { func TestAccEC2Instance_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -269,6 +271,7 @@ func TestAccEC2Instance_tags_null(t *testing.T) { func TestAccEC2Instance_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -331,6 +334,7 @@ func TestAccEC2Instance_tags_EmptyMap(t *testing.T) { func TestAccEC2Instance_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -411,6 +415,7 @@ func TestAccEC2Instance_tags_AddOnUpdate(t *testing.T) { func TestAccEC2Instance_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -501,6 +506,7 @@ func TestAccEC2Instance_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccEC2Instance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -638,6 +644,7 @@ func TestAccEC2Instance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccEC2Instance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -726,6 +733,7 @@ func TestAccEC2Instance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -910,6 +918,7 @@ func TestAccEC2Instance_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1072,6 +1081,7 @@ func TestAccEC2Instance_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1250,6 +1260,7 @@ func TestAccEC2Instance_tags_DefaultTags_overlapping(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1339,6 +1350,7 @@ func TestAccEC2Instance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1427,6 +1439,7 @@ func TestAccEC2Instance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1492,6 +1505,7 @@ func TestAccEC2Instance_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1549,6 +1563,7 @@ func TestAccEC2Instance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccEC2Instance_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1611,6 +1626,7 @@ func TestAccEC2Instance_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccEC2Instance_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1673,6 +1689,7 @@ func TestAccEC2Instance_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccEC2Instance_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1728,6 +1745,7 @@ func TestAccEC2Instance_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccEC2Instance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1824,6 +1842,7 @@ func TestAccEC2Instance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccEC2Instance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -1910,6 +1929,7 @@ func TestAccEC2Instance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccEC2Instance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" @@ -2068,6 +2088,7 @@ func TestAccEC2Instance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccEC2Instance_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Instance resourceName := "aws_instance.test" diff --git a/internal/service/ec2/ec2_instance_test.go b/internal/service/ec2/ec2_instance_test.go index 7b63a4fe10c9..e5cae5e00f02 100644 --- a/internal/service/ec2/ec2_instance_test.go +++ b/internal/service/ec2/ec2_instance_test.go @@ -202,7 +202,7 @@ func TestAccEC2Instance_basic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -257,7 +257,7 @@ func TestAccEC2Instance_inDefaultVPCBySgName(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -285,7 +285,7 @@ func TestAccEC2Instance_inDefaultVPCBySgID(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -318,7 +318,7 @@ func TestAccEC2Instance_atLeastOneOtherEBSVolume(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, // We repeat the exact same test so that we can be sure // that the user data hash stuff is working without generating @@ -451,7 +451,7 @@ func TestAccEC2Instance_RootBlockDevice_kmsKeyARN(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -480,7 +480,7 @@ func TestAccEC2Instance_userDataBase64(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -515,7 +515,7 @@ func TestAccEC2Instance_userDataBase64_updateWithBashFile(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -550,7 +550,7 @@ func TestAccEC2Instance_userDataBase64_updateWithZipFile(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -586,7 +586,7 @@ func TestAccEC2Instance_userDataBase64_update(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -636,7 +636,7 @@ func TestAccEC2Instance_gp2IopsDevice(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -776,7 +776,7 @@ func TestAccEC2Instance_blockDevices(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"ephemeral_block_device", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{"ephemeral_block_device", names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -807,7 +807,7 @@ func TestAccEC2Instance_rootInstanceStore(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -876,7 +876,7 @@ func TestAccEC2Instance_noAMIEphemeralDevices(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"ephemeral_block_device", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{"ephemeral_block_device", names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -918,7 +918,7 @@ func TestAccEC2Instance_sourceDestCheck(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_sourceDestEnable(rName), @@ -962,7 +962,7 @@ func TestAccEC2Instance_autoRecovery(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_autoRecovery(rName, "disabled"), @@ -999,7 +999,7 @@ func TestAccEC2Instance_disableAPIStop(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_disableAPIStop(rName, false), @@ -1008,6 +1008,13 @@ func TestAccEC2Instance_disableAPIStop(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "disable_api_stop", acctest.CtFalse), ), }, + { + Config: testAccInstanceConfig_disableAPIStop(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "disable_api_stop", acctest.CtTrue), + ), + }, }, }) } @@ -1035,7 +1042,7 @@ func TestAccEC2Instance_disableAPITerminationFinalFalse(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_disableAPITermination(rName, false), @@ -1065,13 +1072,14 @@ func TestAccEC2Instance_disableAPITerminationFinalTrue(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "disable_api_termination", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, names.AttrForceDestroy, acctest.CtTrue), ), }, { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1134,7 +1142,7 @@ func TestAccEC2Instance_outpost(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1222,7 +1230,7 @@ func TestAccEC2Instance_IPv6_supportAddressCount(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1277,7 +1285,7 @@ func TestAccEC2Instance_IPv6_primaryEnable(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1314,7 +1322,7 @@ func TestAccEC2Instance_IPv6_primaryDisable(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1343,7 +1351,7 @@ func TestAccEC2Instance_IPv6_supportAddressCountWithIPv4(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1437,7 +1445,7 @@ func TestAccEC2Instance_IPv6AddressesExplicit(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -1566,7 +1574,7 @@ func TestAccEC2Instance_BlockDeviceTags_volumeTags(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"ephemeral_block_device", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{"ephemeral_block_device", names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_blockDeviceTagsVolumeTags(rName), @@ -1699,7 +1707,7 @@ func TestAccEC2Instance_BlockDeviceTags_ebsAndRoot(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"ephemeral_block_device", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{"ephemeral_block_device", names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2058,7 +2066,7 @@ func TestAccEC2Instance_instanceProfileChange(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_profile(rName1), @@ -2117,7 +2125,7 @@ func TestAccEC2Instance_iamInstanceProfile(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2146,7 +2154,7 @@ func TestAccEC2Instance_iamInstanceProfilePath(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2185,7 +2193,7 @@ func TestAccEC2Instance_privateIP(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2224,7 +2232,7 @@ func TestAccEC2Instance_associatePublicIPAndPrivateIP(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2265,7 +2273,7 @@ func TestAccEC2Instance_Empty_privateIP(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2297,7 +2305,7 @@ func TestAccEC2Instance_PrivateDNSNameOptions_computed(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2329,7 +2337,7 @@ func TestAccEC2Instance_PrivateDNSNameOptions_configured(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName, true, true, "ip-name"), @@ -2435,7 +2443,7 @@ func TestAccEC2Instance_forceNewAndTagsDrift(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -2481,7 +2489,7 @@ func TestAccEC2Instance_changeInstanceType(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_instanceType(rName, "t2.large"), @@ -2639,7 +2647,7 @@ func TestAccEC2Instance_changeInstanceTypeAndUserData(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -2677,7 +2685,7 @@ func TestAccEC2Instance_changeInstanceTypeAndUserDataBase64(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -3156,7 +3164,7 @@ func TestAccEC2Instance_EBSRootDevice_multipleDynamicEBSBlockDevices(t *testing. ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3207,7 +3215,7 @@ func TestAccEC2Instance_gp3RootBlockDevice(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3383,7 +3391,7 @@ func TestAccEC2Instance_addSecurityGroupNetworkInterface(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_addSecurityGroupAfter(rName), @@ -3431,7 +3439,7 @@ func TestAccEC2Instance_NewNetworkInterface_publicIPAndSecondaryPrivateIPs(t *te ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3463,7 +3471,7 @@ func TestAccEC2Instance_NewNetworkInterface_emptyPrivateIPAndSecondaryPrivateIPs ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3512,7 +3520,7 @@ func TestAccEC2Instance_NewNetworkInterface_emptyPrivateIPAndSecondaryPrivateIPs ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3545,7 +3553,7 @@ func TestAccEC2Instance_NewNetworkInterface_privateIPAndSecondaryPrivateIPs(t *t ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3595,7 +3603,7 @@ func TestAccEC2Instance_NewNetworkInterface_privateIPAndSecondaryPrivateIPsUpdat ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3626,7 +3634,7 @@ func TestAccEC2Instance_AssociatePublic_defaultPrivate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3657,7 +3665,7 @@ func TestAccEC2Instance_AssociatePublic_defaultPublic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3688,7 +3696,7 @@ func TestAccEC2Instance_AssociatePublic_explicitPublic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3719,7 +3727,7 @@ func TestAccEC2Instance_AssociatePublic_explicitPrivate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3750,7 +3758,7 @@ func TestAccEC2Instance_AssociatePublic_overridePublic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -3781,7 +3789,7 @@ func TestAccEC2Instance_AssociatePublic_overridePrivate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4083,7 +4091,7 @@ func TestAccEC2Instance_GetPasswordData_falseToTrue(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_getPasswordData(rName, publicKey, true), @@ -4176,7 +4184,7 @@ func TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToDisabledToEnabledToUnspe ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { // test DiffSuppressFunc to suppress "" to "disabled" @@ -4243,7 +4251,7 @@ func TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToEnabledToDisabledToUnspe ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { // expect recreation when it is enabled @@ -4308,7 +4316,7 @@ func TestAccEC2Instance_cpuOptionsAmdSevSnpEnabledToDisabled(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_cpuOptionsAmdSevSnp(rName, string(awstypes.AmdSevSnpSpecificationDisabled)), @@ -4352,7 +4360,7 @@ func TestAccEC2Instance_cpuOptionsAmdSevSnpDisabledToEnabled(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_cpuOptionsAmdSevSnp(rName, string(awstypes.AmdSevSnpSpecificationEnabled)), @@ -4403,7 +4411,7 @@ func TestAccEC2Instance_cpuOptionsAmdSevSnpCoreThreads(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_cpuOptionsAmdSevSnpCoreThreads(rName, string(awstypes.AmdSevSnpSpecificationDisabled), updatedCoreCount, updatedThreadsPerCore), @@ -4450,7 +4458,7 @@ func TestAccEC2Instance_cpuOptionsCoreThreads(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_cpuOptionsCoreThreads(rName, updatedCoreCount, updatedThreadsPerCore), @@ -4494,7 +4502,7 @@ func TestAccEC2Instance_cpuOptionsCoreThreadsUnspecifiedToSpecified(t *testing.T ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { // EC2 instance should not be recreated @@ -4608,7 +4616,7 @@ func TestAccEC2Instance_CreditSpecificationUnspecifiedToEmpty_nonBurstable(t *te ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationEmptyNonBurstable(rName), @@ -4644,7 +4652,7 @@ func TestAccEC2Instance_CreditSpecification_unspecifiedDefaultsToStandard(t *tes ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4674,7 +4682,7 @@ func TestAccEC2Instance_CreditSpecification_standardCPUCredits(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnspecified(rName), @@ -4712,7 +4720,7 @@ func TestAccEC2Instance_CreditSpecification_unlimitedCPUCredits(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnspecified(rName), @@ -4750,7 +4758,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t2(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4780,7 +4788,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t3(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4810,7 +4818,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t3a(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4840,7 +4848,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t4g(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4870,7 +4878,7 @@ func TestAccEC2Instance_CreditSpecification_updateCPUCredits(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnlimitedCPUCredits(rName), @@ -4944,7 +4952,7 @@ func TestAccEC2Instance_CreditSpecificationT3_unspecifiedDefaultsToUnlimited(t * ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -4974,7 +4982,7 @@ func TestAccEC2Instance_CreditSpecificationT3_standardCPUCredits(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnspecifiedT3(rName), @@ -5012,7 +5020,7 @@ func TestAccEC2Instance_CreditSpecificationT3_unlimitedCPUCredits(t *testing.T) ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnspecifiedT3(rName), @@ -5050,7 +5058,7 @@ func TestAccEC2Instance_CreditSpecificationT3_updateCPUCredits(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnlimitedCPUCreditsT3(rName), @@ -5096,7 +5104,7 @@ func TestAccEC2Instance_CreditSpecificationStandardCPUCredits_t2Tot3Taint(t *tes ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationStandardCPUCreditsT3(rName), @@ -5135,7 +5143,7 @@ func TestAccEC2Instance_CreditSpecificationUnlimitedCPUCredits_t2Tot3Taint(t *te ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_creditSpecificationUnlimitedCPUCreditsT3(rName), @@ -5236,7 +5244,7 @@ func TestAccEC2Instance_UserData_basic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5276,7 +5284,7 @@ func TestAccEC2Instance_UserData_update(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5310,7 +5318,7 @@ func TestAccEC2Instance_UserData_stringToEncodedString(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, }, }) @@ -5343,7 +5351,7 @@ func TestAccEC2Instance_UserData_emptyStringToUnspecified(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data", "user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data", "user_data_replace_on_change"}, }, // Switching should show no difference { @@ -5388,7 +5396,7 @@ func TestAccEC2Instance_UserData_unspecifiedToEmptyString(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, // Switching should show no difference { @@ -5432,7 +5440,7 @@ func TestAccEC2Instance_UserData_ReplaceOnChange_On(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, // Switching should force a recreate { @@ -5518,7 +5526,7 @@ func TestAccEC2Instance_UserData_ReplaceOnChange_Off(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, // Switching should not force a recreate { @@ -5604,7 +5612,7 @@ func TestAccEC2Instance_hibernation(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_hibernation(rName, false), @@ -5694,7 +5702,7 @@ func TestAccEC2Instance_metadataOptions(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5724,7 +5732,7 @@ func TestAccEC2Instance_enclaveOptions(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, { Config: testAccInstanceConfig_enclaveOptions(rName, false), @@ -5769,7 +5777,7 @@ func TestAccEC2Instance_CapacityReservation_unspecifiedDefaultsToOpen(t *testing ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, // Adding 'open' preference should show no difference { @@ -5812,7 +5820,7 @@ func TestAccEC2Instance_CapacityReservationPreference_open(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5843,7 +5851,7 @@ func TestAccEC2Instance_CapacityReservationPreference_none(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5874,7 +5882,7 @@ func TestAccEC2Instance_CapacityReservation_targetID(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -5994,7 +6002,7 @@ func TestAccEC2Instance_basicWithSpot(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, + ImportStateVerifyIgnore: []string{names.AttrForceDestroy, "user_data_replace_on_change"}, }, }, }) @@ -6995,6 +7003,8 @@ resource "aws_instance" "test" { subnet_id = aws_subnet.test.id disable_api_stop = %[2]t + force_destroy = true + tags = { Name = %[1]q } @@ -7012,6 +7022,7 @@ resource "aws_instance" "test" { instance_type = "t2.small" subnet_id = aws_subnet.test.id disable_api_termination = %[2]t + force_destroy = true tags = { Name = %[1]q diff --git a/internal/service/ec2/ec2_serial_console_access_identity_gen_test.go b/internal/service/ec2/ec2_serial_console_access_identity_gen_test.go index 40f75eae754e..7a1a86c5651e 100644 --- a/internal/service/ec2/ec2_serial_console_access_identity_gen_test.go +++ b/internal/service/ec2/ec2_serial_console_access_identity_gen_test.go @@ -31,9 +31,10 @@ func testAccEC2SerialConsoleAccess_IdentitySerial(t *testing.T) { func testAccEC2SerialConsoleAccess_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ec2_serial_console_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -97,9 +98,10 @@ func testAccEC2SerialConsoleAccess_Identity_Basic(t *testing.T) { func testAccEC2SerialConsoleAccess_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ec2_serial_console_access.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ec2/ec2_spot_fleet_request.go b/internal/service/ec2/ec2_spot_fleet_request.go index 4e2faf245a83..b488e0b0f3b8 100644 --- a/internal/service/ec2/ec2_spot_fleet_request.go +++ b/internal/service/ec2/ec2_spot_fleet_request.go @@ -998,7 +998,7 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, log.Printf("[DEBUG] Creating EC2 Spot Fleet Request: %s", d.Id()) outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.RequestSpotFleet(ctx, &input) }, errCodeInvalidSpotFleetRequestConfig, "SpotFleetRequestConfig.IamFleetRole", diff --git a/internal/service/ec2/service_endpoint_resolver_gen.go b/internal/service/ec2/service_endpoint_resolver_gen.go index f4b2a033bd36..ec0d57e483af 100644 --- a/internal/service/ec2/service_endpoint_resolver_gen.go +++ b/internal/service/ec2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ec2.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ec2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ec2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index 0503434eae4a..f31b15df767a 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index 9664a15064bf..a375e325575d 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -1427,7 +1427,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Tags: unique.Make(inttypes.ServicePackageResourceTags{ IdentifierAttribute: names.AttrID, }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity(names.AttrID), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceSecurityGroupRule, @@ -1472,7 +1476,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Tags: unique.Make(inttypes.ServicePackageResourceTags{ IdentifierAttribute: names.AttrID, }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity(names.AttrID), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceVerifiedAccessEndpoint, diff --git a/internal/service/ec2/testdata/SecurityGroup/basic/main_gen.tf b/internal/service/ec2/testdata/SecurityGroup/basic/main_gen.tf new file mode 100644 index 000000000000..67d8a529a3f2 --- /dev/null +++ b/internal/service/ec2/testdata/SecurityGroup/basic/main_gen.tf @@ -0,0 +1,17 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_security_group" "test" { + name = var.rName + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/ec2/testdata/SecurityGroup/basic_v6.7.0/main_gen.tf b/internal/service/ec2/testdata/SecurityGroup/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..80d9a7cdd57f --- /dev/null +++ b/internal/service/ec2/testdata/SecurityGroup/basic_v6.7.0/main_gen.tf @@ -0,0 +1,27 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_security_group" "test" { + name = var.rName + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ec2/testdata/SecurityGroup/region_override/main_gen.tf b/internal/service/ec2/testdata/SecurityGroup/region_override/main_gen.tf new file mode 100644 index 000000000000..428723a7b319 --- /dev/null +++ b/internal/service/ec2/testdata/SecurityGroup/region_override/main_gen.tf @@ -0,0 +1,27 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_security_group" "test" { + region = var.region + + name = var.rName + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + region = var.region + + cidr_block = "10.1.0.0/16" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ec2/testdata/Subnet/basic/main_gen.tf b/internal/service/ec2/testdata/Subnet/basic/main_gen.tf new file mode 100644 index 000000000000..dd708ec5350f --- /dev/null +++ b/internal/service/ec2/testdata/Subnet/basic/main_gen.tf @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + diff --git a/internal/service/ec2/testdata/Subnet/basic_v6.8.0/main_gen.tf b/internal/service/ec2/testdata/Subnet/basic_v6.8.0/main_gen.tf new file mode 100644 index 000000000000..0e1bcefbdaef --- /dev/null +++ b/internal/service/ec2/testdata/Subnet/basic_v6.8.0/main_gen.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.8.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ec2/testdata/Subnet/region_override/main_gen.tf b/internal/service/ec2/testdata/Subnet/region_override/main_gen.tf new file mode 100644 index 000000000000..9fb8bc73c9e2 --- /dev/null +++ b/internal/service/ec2/testdata/Subnet/region_override/main_gen.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_subnet" "test" { + region = var.region + + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id +} + +resource "aws_vpc" "test" { + region = var.region + + cidr_block = "10.1.0.0/16" +} + + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ec2/testdata/tmpl/vpc_security_group_tags.gtpl b/internal/service/ec2/testdata/tmpl/vpc_security_group_tags.gtpl index 90532b2d8085..47e49a3cb92c 100644 --- a/internal/service/ec2/testdata/tmpl/vpc_security_group_tags.gtpl +++ b/internal/service/ec2/testdata/tmpl/vpc_security_group_tags.gtpl @@ -1,4 +1,5 @@ resource "aws_security_group" "test" { +{{- template "region" }} name = var.rName vpc_id = aws_vpc.test.id @@ -6,5 +7,6 @@ resource "aws_security_group" "test" { } resource "aws_vpc" "test" { +{{- template "region" }} cidr_block = "10.1.0.0/16" } diff --git a/internal/service/ec2/testdata/tmpl/vpc_subnet_tags.gtpl b/internal/service/ec2/testdata/tmpl/vpc_subnet_tags.gtpl index 4be3eb970274..9b919eaa41d1 100644 --- a/internal/service/ec2/testdata/tmpl/vpc_subnet_tags.gtpl +++ b/internal/service/ec2/testdata/tmpl/vpc_subnet_tags.gtpl @@ -1,4 +1,5 @@ resource "aws_subnet" "test" { +{{- template "region" }} cidr_block = "10.1.1.0/24" vpc_id = aws_vpc.test.id @@ -6,5 +7,6 @@ resource "aws_subnet" "test" { } resource "aws_vpc" "test" { +{{- template "region" }} cidr_block = "10.1.0.0/16" } diff --git a/internal/service/ec2/transitgateway_.go b/internal/service/ec2/transitgateway_.go index 382f667b8913..5acf92ab34db 100644 --- a/internal/service/ec2/transitgateway_.go +++ b/internal/service/ec2/transitgateway_.go @@ -305,7 +305,7 @@ func resourceTransitGatewayDelete(ctx context.Context, d *schema.ResourceData, m const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteTransitGateway(ctx, &ec2.DeleteTransitGatewayInput{ TransitGatewayId: aws.String(d.Id()), }) diff --git a/internal/service/ec2/vpc_.go b/internal/service/ec2/vpc_.go index b4cdaf23d8ce..ce177ab42d1e 100644 --- a/internal/service/ec2/vpc_.go +++ b/internal/service/ec2/vpc_.go @@ -221,7 +221,7 @@ func resourceVPCCreate(ctx context.Context, d *schema.ResourceData, meta any) di } // "UnsupportedOperation: The operation AllocateIpamPoolCidr is not supported. Account 123456789012 is not monitored by IPAM ipam-07b079e3392782a55." - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, ec2PropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateVpc(ctx, input) }, errCodeUnsupportedOperation, "is not monitored by IPAM") @@ -449,7 +449,7 @@ func resourceVPCDelete(ctx context.Context, d *schema.ResourceData, meta any) di } log.Printf("[INFO] Deleting EC2 VPC: %s", d.Id()) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteVpc(ctx, input) }, errCodeDependencyViolation) diff --git a/internal/service/ec2/vpc_block_public_access_exclusion_tags_gen_test.go b/internal/service/ec2/vpc_block_public_access_exclusion_tags_gen_test.go index 0f503e47f1da..da79481de5d3 100644 --- a/internal/service/ec2/vpc_block_public_access_exclusion_tags_gen_test.go +++ b/internal/service/ec2/vpc_block_public_access_exclusion_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccVPCBlockPublicAccessExclusion_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -189,6 +190,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags(t *testing.T) { func TestAccVPCBlockPublicAccessExclusion_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -247,6 +249,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_null(t *testing.T) { func TestAccVPCBlockPublicAccessExclusion_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -293,6 +296,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_EmptyMap(t *testing.T) { func TestAccVPCBlockPublicAccessExclusion_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -368,6 +372,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_AddOnUpdate(t *testing.T) { func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -452,6 +457,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -584,6 +590,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnUpdate_Add(t *testing. func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -669,6 +676,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_EmptyTag_OnUpdate_Replace(t *test func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -840,6 +848,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_providerOnly(t *testi func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -992,6 +1001,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nonOverlapping(t *tes func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1160,6 +1170,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_overlapping(t *testin func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1245,6 +1256,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_updateToProviderOnly( func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1329,6 +1341,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_updateToResourceOnly( func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1391,6 +1404,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_emptyResourceTag(t *t func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1445,6 +1459,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_emptyProviderOnlyTag( func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1510,6 +1525,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nullOverlappingResour func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1577,6 +1593,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_DefaultTags_nullNonOverlappingRes func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1628,6 +1645,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnCreate(t *testing.T func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1720,6 +1738,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnUpdate_Add(t *testi func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1802,6 +1821,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_ComputedTag_OnUpdate_Replace(t *t func TestAccVPCBlockPublicAccessExclusion_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -1959,6 +1979,7 @@ func TestAccVPCBlockPublicAccessExclusion_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccVPCBlockPublicAccessExclusion_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_vpc_block_public_access_exclusion.test" acctest.ParallelTest(ctx, t, resource.TestCase{ diff --git a/internal/service/ec2/vpc_data_source_tags_gen_test.go b/internal/service/ec2/vpc_data_source_tags_gen_test.go index dd9dfc395c52..6ddcc71b002f 100644 --- a/internal/service/ec2/vpc_data_source_tags_gen_test.go +++ b/internal/service/ec2/vpc_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccVPCVPCDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -47,6 +48,7 @@ func TestAccVPCVPCDataSource_tags(t *testing.T) { func TestAccVPCVPCDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -69,6 +71,7 @@ func TestAccVPCVPCDataSource_tags_NullMap(t *testing.T) { func TestAccVPCVPCDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -91,6 +94,7 @@ func TestAccVPCVPCDataSource_tags_EmptyMap(t *testing.T) { func TestAccVPCVPCDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -121,6 +125,7 @@ func TestAccVPCVPCDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCVPCDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -157,6 +162,7 @@ func TestAccVPCVPCDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccVPCVPCDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc.test" acctest.ParallelTest(ctx, t, resource.TestCase{ diff --git a/internal/service/ec2/vpc_dhcp_options.go b/internal/service/ec2/vpc_dhcp_options.go index 7ca9cfcf484d..696457271ee4 100644 --- a/internal/service/ec2/vpc_dhcp_options.go +++ b/internal/service/ec2/vpc_dhcp_options.go @@ -208,7 +208,7 @@ func resourceVPCDHCPOptionsDelete(ctx context.Context, d *schema.ResourceData, m } log.Printf("[INFO] Deleting EC2 DHCP Options Set: %s", d.Id()) - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteDhcpOptions(ctx, input) }, errCodeDependencyViolation) diff --git a/internal/service/ec2/vpc_flow_log.go b/internal/service/ec2/vpc_flow_log.go index 3b0920c623c9..734b2b576afd 100644 --- a/internal/service/ec2/vpc_flow_log.go +++ b/internal/service/ec2/vpc_flow_log.go @@ -231,7 +231,7 @@ func resourceLogFlowCreate(ctx context.Context, d *schema.ResourceData, meta any input.MaxAggregationInterval = aws.Int32(int32(v.(int))) } - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateFlowLogs(ctx, input) }, errCodeInvalidParameter, "Unable to assume given IAM role") diff --git a/internal/service/ec2/vpc_internet_gateway.go b/internal/service/ec2/vpc_internet_gateway.go index 518591daadd0..4388c7e7fca0 100644 --- a/internal/service/ec2/vpc_internet_gateway.go +++ b/internal/service/ec2/vpc_internet_gateway.go @@ -164,7 +164,7 @@ func resourceInternetGatewayDelete(ctx context.Context, d *schema.ResourceData, } log.Printf("[INFO] Deleting Internet Gateway: %s", d.Id()) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteInternetGateway(ctx, input) }, errCodeDependencyViolation) @@ -186,7 +186,7 @@ func attachInternetGateway(ctx context.Context, conn *ec2.Client, internetGatewa } log.Printf("[INFO] Attaching EC2 Internet Gateway: %#v", input) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.AttachInternetGateway(ctx, input) }, errCodeInvalidInternetGatewayIDNotFound) @@ -210,7 +210,7 @@ func detachInternetGateway(ctx context.Context, conn *ec2.Client, internetGatewa } log.Printf("[INFO] Detaching EC2 Internet Gateway: %#v", input) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.DetachInternetGateway(ctx, input) }, errCodeDependencyViolation) diff --git a/internal/service/ec2/vpc_ipam_pool_cidr.go b/internal/service/ec2/vpc_ipam_pool_cidr.go index f158abf2db67..1883fa77000d 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr.go @@ -88,16 +88,10 @@ func resourceIPAMPoolCIDR() *schema.Resource { "netmask_length": { Type: schema.TypeInt, Optional: true, + Computed: true, ForceNew: true, ValidateFunc: validation.IntBetween(0, 128), ConflictsWith: []string{"cidr"}, - // NetmaskLength is not outputted by GetIpamPoolCidrsOutput - DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { - if o != "0" && n == "0" { - return true - } - return false - }, }, }, } @@ -171,6 +165,7 @@ func resourceIPAMPoolCIDRRead(ctx context.Context, d *schema.ResourceData, meta d.Set("cidr", output.Cidr) d.Set("ipam_pool_cidr_id", output.IpamPoolCidrId) d.Set("ipam_pool_id", poolID) + d.Set("netmask_length", output.NetmaskLength) return diags } diff --git a/internal/service/ec2/vpc_ipam_pool_cidr_test.go b/internal/service/ec2/vpc_ipam_pool_cidr_test.go index 0d84f35fed7d..a77e71734658 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr_test.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr_test.go @@ -44,9 +44,6 @@ func TestAccIPAMPoolCIDR_basic(t *testing.T) { // nosemgrep:ci.vpc-in-test-name ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "netmask_length", - }, }, }, }) @@ -77,9 +74,6 @@ func TestAccIPAMPoolCIDR_basicNetmaskLength(t *testing.T) { // nosemgrep:ci.vpc- ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "netmask_length", - }, }, }, }) diff --git a/internal/service/ec2/vpc_managed_prefix_list.go b/internal/service/ec2/vpc_managed_prefix_list.go index 6d1eb93d0fbf..aea314e1906c 100644 --- a/internal/service/ec2/vpc_managed_prefix_list.go +++ b/internal/service/ec2/vpc_managed_prefix_list.go @@ -248,12 +248,12 @@ func resourceManagedPrefixListUpdate(ctx context.Context, d *schema.ResourceData } if len(descriptionOnlyRemovals) > 0 { - input := ec2.ModifyManagedPrefixListInput{ + removeInput := ec2.ModifyManagedPrefixListInput{ CurrentVersion: input.CurrentVersion, PrefixListId: aws.String(d.Id()), RemoveEntries: descriptionOnlyRemovals, } - _, err := conn.ModifyManagedPrefixList(ctx, &input) + _, err := conn.ModifyManagedPrefixList(ctx, &removeInput) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EC2 Managed Prefix List (%s): %s", d.Id(), err) diff --git a/internal/service/ec2/vpc_managed_prefix_list_entry.go b/internal/service/ec2/vpc_managed_prefix_list_entry.go index 3a64df8165e5..99560a11decd 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_entry.go +++ b/internal/service/ec2/vpc_managed_prefix_list_entry.go @@ -71,7 +71,7 @@ func resourceManagedPrefixListEntryCreate(ctx context.Context, d *schema.Resourc addPrefixListEntry.Description = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { mutexKey := fmt.Sprintf("vpc-managed-prefix-list-%s", plID) conns.GlobalMutexKV.Lock(mutexKey) defer conns.GlobalMutexKV.Unlock(mutexKey) @@ -146,7 +146,7 @@ func resourceManagedPrefixListEntryDelete(ctx context.Context, d *schema.Resourc return sdkdiag.AppendFromErr(diags, err) } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { mutexKey := fmt.Sprintf("vpc-managed-prefix-list-%s", plID) conns.GlobalMutexKV.Lock(mutexKey) defer conns.GlobalMutexKV.Unlock(mutexKey) diff --git a/internal/service/ec2/vpc_managed_prefix_list_test.go b/internal/service/ec2/vpc_managed_prefix_list_test.go index 6f4bb6894295..20b387018798 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_test.go @@ -358,6 +358,41 @@ func TestAccVPCManagedPrefixList_tags(t *testing.T) { }) } +func TestAccVPCManagedPrefixList_descriptionOnlyChange(t *testing.T) { + ctx := acctest.Context(t) + resourceName := "aws_ec2_managed_prefix_list.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCManagedPrefixListConfig_simpleDescriptionChange(rName, "old description"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccManagedPrefixListExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "entry.#", "1"), + ), + }, + { + // This reproduces the bug: change ONLY the description + // Before the fix, this would fail with "PrefixListVersionMismatch" + Config: testAccVPCManagedPrefixListConfig_simpleDescriptionChange(rName, "new description"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccManagedPrefixListExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "entry.#", "1"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "entry.*", map[string]string{ + "cidr": "1.0.0.0/8", + names.AttrDescription: "new description", + }), + ), + }, + }, + }) +} + func testAccCheckManagedPrefixListDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx) @@ -556,3 +591,18 @@ resource "aws_ec2_managed_prefix_list" "test" { } `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } + +func testAccVPCManagedPrefixListConfig_simpleDescriptionChange(rName string, description string) string { + return fmt.Sprintf(` +resource "aws_ec2_managed_prefix_list" "test" { + address_family = "IPv4" + max_entries = 1 + name = %[1]q + + entry { + cidr = "1.0.0.0/8" + description = %[2]q + } +} +`, rName, description) +} diff --git a/internal/service/ec2/vpc_network_acl.go b/internal/service/ec2/vpc_network_acl.go index 2fa5f757d66a..4c59f0b906a0 100644 --- a/internal/service/ec2/vpc_network_acl.go +++ b/internal/service/ec2/vpc_network_acl.go @@ -288,7 +288,7 @@ func resourceNetworkACLDelete(ctx context.Context, d *schema.ResourceData, meta } log.Printf("[INFO] Deleting EC2 Network ACL: %s", d.Id()) - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteNetworkAcl(ctx, input) }, errCodeDependencyViolation) diff --git a/internal/service/ec2/vpc_network_acl_association.go b/internal/service/ec2/vpc_network_acl_association.go index 946e2f2b304a..4122ab09eded 100644 --- a/internal/service/ec2/vpc_network_acl_association.go +++ b/internal/service/ec2/vpc_network_acl_association.go @@ -133,7 +133,7 @@ func networkACLAssociationCreate(ctx context.Context, conn *ec2.Client, naclID, } log.Printf("[DEBUG] Creating EC2 Network ACL Association: %#v", input) - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.ReplaceNetworkAclAssociation(ctx, input) }, errCodeInvalidAssociationIDNotFound) diff --git a/internal/service/ec2/vpc_network_insights_path.go b/internal/service/ec2/vpc_network_insights_path.go index 83ce6f4cb29c..63b9561e418c 100644 --- a/internal/service/ec2/vpc_network_insights_path.go +++ b/internal/service/ec2/vpc_network_insights_path.go @@ -265,7 +265,7 @@ func resourceNetworkInsightsPathDelete(ctx context.Context, d *schema.ResourceDa input := ec2.DeleteNetworkInsightsPathInput{ NetworkInsightsPathId: aws.String(d.Id()), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteNetworkInsightsPath(ctx, &input) }, errCodeAnalysisExistsForNetworkInsightsPath) diff --git a/internal/service/ec2/vpc_route.go b/internal/service/ec2/vpc_route.go index 437954d1132b..60e7859a7037 100644 --- a/internal/service/ec2/vpc_route.go +++ b/internal/service/ec2/vpc_route.go @@ -254,7 +254,7 @@ func resourceRouteCreate(ctx context.Context, d *schema.ResourceData, meta any) } _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateRoute(ctx, input) }, errCodeInvalidParameterException, @@ -457,7 +457,7 @@ func resourceRouteDelete(ctx context.Context, d *schema.ResourceData, meta any) log.Printf("[DEBUG] Deleting Route: %v", input) _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteRoute(ctx, input) }, errCodeInvalidParameterException, diff --git a/internal/service/ec2/vpc_route_table.go b/internal/service/ec2/vpc_route_table.go index bfaa5ef74d99..9bc6ed77016a 100644 --- a/internal/service/ec2/vpc_route_table.go +++ b/internal/service/ec2/vpc_route_table.go @@ -487,7 +487,7 @@ func routeTableAddRoute(ctx context.Context, conn *ec2.Client, routeTableID stri // created by AWS so probably doesn't need a retry but just to be sure // we provide a small one _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, time.Second*15, - func() (any, error) { + func(ctx context.Context) (any, error) { return routeFinder(ctx, conn, routeTableID, destination) }, errCodeInvalidRouteNotFound, @@ -505,7 +505,7 @@ func routeTableAddRoute(ctx context.Context, conn *ec2.Client, routeTableID stri } _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateRoute(ctx, input) }, errCodeInvalidParameterException, @@ -636,7 +636,7 @@ func routeTableEnableVGWRoutePropagation(ctx context.Context, conn *ec2.Client, } _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.EnableVgwRoutePropagation(ctx, input) }, errCodeGatewayNotAttached, diff --git a/internal/service/ec2/vpc_route_table_association.go b/internal/service/ec2/vpc_route_table_association.go index 6b5a66d16325..87de94529aaf 100644 --- a/internal/service/ec2/vpc_route_table_association.go +++ b/internal/service/ec2/vpc_route_table_association.go @@ -78,7 +78,7 @@ func resourceRouteTableAssociationCreate(ctx context.Context, d *schema.Resource } output, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.AssociateRouteTable(ctx, input) }, errCodeInvalidRouteTableIDNotFound, diff --git a/internal/service/ec2/vpc_route_table_tags_gen_test.go b/internal/service/ec2/vpc_route_table_tags_gen_test.go index 9f80345cb529..bc567cabfee1 100644 --- a/internal/service/ec2/vpc_route_table_tags_gen_test.go +++ b/internal/service/ec2/vpc_route_table_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCRouteTable_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -191,6 +192,7 @@ func TestAccVPCRouteTable_tags(t *testing.T) { func TestAccVPCRouteTable_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -254,6 +256,7 @@ func TestAccVPCRouteTable_tags_null(t *testing.T) { func TestAccVPCRouteTable_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -313,6 +316,7 @@ func TestAccVPCRouteTable_tags_EmptyMap(t *testing.T) { func TestAccVPCRouteTable_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -390,6 +394,7 @@ func TestAccVPCRouteTable_tags_AddOnUpdate(t *testing.T) { func TestAccVPCRouteTable_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -474,6 +479,7 @@ func TestAccVPCRouteTable_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -605,6 +611,7 @@ func TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -690,6 +697,7 @@ func TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -862,6 +870,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1015,6 +1024,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1184,6 +1194,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_overlapping(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1270,6 +1281,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1355,6 +1367,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1417,6 +1430,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1471,6 +1485,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1530,6 +1545,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1589,6 +1605,7 @@ func TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccVPCRouteTable_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1641,6 +1658,7 @@ func TestAccVPCRouteTable_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1734,6 +1752,7 @@ func TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1817,6 +1836,7 @@ func TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" @@ -1975,6 +1995,7 @@ func TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccVPCRouteTable_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.RouteTable resourceName := "aws_route_table.test" diff --git a/internal/service/ec2/vpc_security_group.go b/internal/service/ec2/vpc_security_group.go index 9d9710cdc46f..5397965c94e3 100644 --- a/internal/service/ec2/vpc_security_group.go +++ b/internal/service/ec2/vpc_security_group.go @@ -37,6 +37,9 @@ import ( // @Tags(identifierAttribute="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ec2/types;awstypes;awstypes.SecurityGroup") // @Testing(importIgnore="revoke_rules_on_delete") +// @IdentityAttribute("id") +// @Testing(preIdentityVersion="v6.7.0") +// @Testing(plannableImportAction="NoOp") func resourceSecurityGroup() *schema.Resource { //lintignore:R011 return &schema.Resource{ @@ -45,10 +48,6 @@ func resourceSecurityGroup() *schema.Resource { UpdateWithoutTimeout: resourceSecurityGroupUpdate, DeleteWithoutTimeout: resourceSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(15 * time.Minute), @@ -368,7 +367,7 @@ func resourceSecurityGroupDelete(ctx context.Context, d *schema.ResourceData, me _, err := tfresource.RetryWhenAWSErrCodeEquals( ctx, firstShortRetry, // short initial attempt followed by full length attempt - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ GroupId: aws.String(d.Id()), }) @@ -388,7 +387,7 @@ func resourceSecurityGroupDelete(ctx context.Context, d *schema.ResourceData, me _, err = tfresource.RetryWhenAWSErrCodeEquals( ctx, remainingRetry, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ GroupId: aws.String(d.Id()), }) diff --git a/internal/service/ec2/vpc_security_group_data_source_tags_gen_test.go b/internal/service/ec2/vpc_security_group_data_source_tags_gen_test.go index 931ed02e2c16..9440862299fc 100644 --- a/internal/service/ec2/vpc_security_group_data_source_tags_gen_test.go +++ b/internal/service/ec2/vpc_security_group_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccVPCSecurityGroupDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccVPCSecurityGroupDataSource_tags(t *testing.T) { func TestAccVPCSecurityGroupDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccVPCSecurityGroupDataSource_tags_NullMap(t *testing.T) { func TestAccVPCSecurityGroupDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccVPCSecurityGroupDataSource_tags_EmptyMap(t *testing.T) { func TestAccVPCSecurityGroupDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccVPCSecurityGroupDataSource_tags_DefaultTags_nonOverlapping(t *testin func TestAccVPCSecurityGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccVPCSecurityGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccVPCSecurityGroupDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ec2/vpc_security_group_egress_rule_tags_gen_test.go b/internal/service/ec2/vpc_security_group_egress_rule_tags_gen_test.go index df87c348efc3..d25fcd085f7e 100644 --- a/internal/service/ec2/vpc_security_group_egress_rule_tags_gen_test.go +++ b/internal/service/ec2/vpc_security_group_egress_rule_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCSecurityGroupEgressRule_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccVPCSecurityGroupEgressRule_tags(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_null(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_EmptyMap(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_AddOnUpdate(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_EmptyTag_OnUpdate_Replace(t *testing func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_providerOnly(t *testing. func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nonOverlapping(t *testin func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_overlapping(t *testing.T func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_updateToProviderOnly(t * func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_updateToResourceOnly(t * func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_emptyResourceTag(t *test func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_emptyProviderOnlyTag(t * func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nullOverlappingResourceT func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_DefaultTags_nullNonOverlappingResour func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnUpdate_Add(t *testing. func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_ComputedTag_OnUpdate_Replace(t *test func TestAccVPCSecurityGroupEgressRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccVPCSecurityGroupEgressRule_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccVPCSecurityGroupEgressRule_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_egress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ec2/vpc_security_group_identity_gen_test.go b/internal/service/ec2/vpc_security_group_identity_gen_test.go new file mode 100644 index 000000000000..62ac89ef68f6 --- /dev/null +++ b/internal/service/ec2/vpc_security_group_identity_gen_test.go @@ -0,0 +1,257 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ec2_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccVPCSecurityGroup_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.SecurityGroup + resourceName := "aws_security_group.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecurityGroupExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "revoke_rules_on_delete", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccVPCSecurityGroup_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_security_group.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "revoke_rules_on_delete", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccVPCSecurityGroup_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.SecurityGroup + resourceName := "aws_security_group.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecurityGroupExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SecurityGroup/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + }, + }) +} diff --git a/internal/service/ec2/vpc_security_group_ingress_rule_tags_gen_test.go b/internal/service/ec2/vpc_security_group_ingress_rule_tags_gen_test.go index a336b5e413b0..db84211e097d 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_tags_gen_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCSecurityGroupIngressRule_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccVPCSecurityGroupIngressRule_tags(t *testing.T) { func TestAccVPCSecurityGroupIngressRule_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_null(t *testing.T) { func TestAccVPCSecurityGroupIngressRule_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_EmptyMap(t *testing.T) { func TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate(t *testing.T) { func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace(t *testin func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly(t *testing func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping(t *testi func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping(t *testing. func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly(t func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly(t func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag(t *tes func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResource func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResou func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate(t *testing.T) func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add(t *testing func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace(t *tes func TestAccVPCSecurityGroupIngressRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccVPCSecurityGroupIngressRule_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccVPCSecurityGroupIngressRule_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroupRule resourceName := "aws_vpc_security_group_ingress_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ec2/vpc_security_group_tags_gen_test.go b/internal/service/ec2/vpc_security_group_tags_gen_test.go index 3dce23c53b9e..8a43af9fee18 100644 --- a/internal/service/ec2/vpc_security_group_tags_gen_test.go +++ b/internal/service/ec2/vpc_security_group_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCSecurityGroup_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccVPCSecurityGroup_tags(t *testing.T) { func TestAccVPCSecurityGroup_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccVPCSecurityGroup_tags_null(t *testing.T) { func TestAccVPCSecurityGroup_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccVPCSecurityGroup_tags_EmptyMap(t *testing.T) { func TestAccVPCSecurityGroup_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccVPCSecurityGroup_tags_AddOnUpdate(t *testing.T) { func TestAccVPCSecurityGroup_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccVPCSecurityGroup_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCSecurityGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccVPCSecurityGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccVPCSecurityGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccVPCSecurityGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCSecurityGroup_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccVPCSecurityGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCSecurityGroup_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_overlapping(t *testing.T) { func TestAccVPCSecurityGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccVPCSecurityGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccVPCSecurityGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccVPCSecurityGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccVPCSecurityGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccVPCSecurityGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccVPCSecurityGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccVPCSecurityGroup_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccVPCSecurityGroup_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCSecurityGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccVPCSecurityGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccVPCSecurityGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccVPCSecurityGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCSecurityGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccVPCSecurityGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccVPCSecurityGroup_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.SecurityGroup resourceName := "aws_security_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index 7f8ef93755fd..e3019869de7d 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -1137,7 +1137,7 @@ func TestAccVPCSecurityGroup_allowAll(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete", "ingress"}, }, }, }) @@ -1193,7 +1193,7 @@ func TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules(t *testing.T) ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete", "ingress"}, }, }, }) @@ -1221,7 +1221,7 @@ func TestAccVPCSecurityGroup_ipRangesWithSameRules(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete", "ingress"}, }, }, }) diff --git a/internal/service/ec2/vpc_security_group_vpc_association_identity_gen_test.go b/internal/service/ec2/vpc_security_group_vpc_association_identity_gen_test.go index db014511054f..ef24a44e21f4 100644 --- a/internal/service/ec2/vpc_security_group_vpc_association_identity_gen_test.go +++ b/internal/service/ec2/vpc_security_group_vpc_association_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccVPCSecurityGroupVPCAssociation_Identity_Basic(t *testing.T) { resourceName := "aws_vpc_security_group_vpc_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -118,7 +118,7 @@ func TestAccVPCSecurityGroupVPCAssociation_Identity_RegionOverride(t *testing.T) resourceName := "aws_vpc_security_group_vpc_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -212,7 +212,7 @@ func TestAccVPCSecurityGroupVPCAssociation_Identity_ExistingResource(t *testing. resourceName := "aws_vpc_security_group_vpc_association.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ec2/vpc_subnet.go b/internal/service/ec2/vpc_subnet.go index f9158e365028..6069614d19fa 100644 --- a/internal/service/ec2/vpc_subnet.go +++ b/internal/service/ec2/vpc_subnet.go @@ -31,6 +31,8 @@ import ( // @Tags(identifierAttribute="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ec2/types;awstypes;awstypes.Subnet") // @Testing(generator=false) +// @IdentityAttribute("id") +// @Testing(preIdentityVersion="v6.8.0") func resourceSubnet() *schema.Resource { //lintignore:R011 return &schema.Resource{ @@ -38,9 +40,6 @@ func resourceSubnet() *schema.Resource { ReadWithoutTimeout: resourceSubnetRead, UpdateWithoutTimeout: resourceSubnetUpdate, DeleteWithoutTimeout: resourceSubnetDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(10 * time.Minute), @@ -373,7 +372,7 @@ func resourceSubnetDelete(ctx context.Context, d *schema.ResourceData, meta any) return sdkdiag.AppendErrorf(diags, "deleting ENIs for EC2 Subnet (%s): %s", d.Id(), err) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteSubnet(ctx, &ec2.DeleteSubnetInput{ SubnetId: aws.String(d.Id()), }) diff --git a/internal/service/ec2/vpc_subnet_data_source_tags_gen_test.go b/internal/service/ec2/vpc_subnet_data_source_tags_gen_test.go index 11130acd0c80..eb12479efeb2 100644 --- a/internal/service/ec2/vpc_subnet_data_source_tags_gen_test.go +++ b/internal/service/ec2/vpc_subnet_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccVPCSubnetDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -47,6 +48,7 @@ func TestAccVPCSubnetDataSource_tags(t *testing.T) { func TestAccVPCSubnetDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -69,6 +71,7 @@ func TestAccVPCSubnetDataSource_tags_NullMap(t *testing.T) { func TestAccVPCSubnetDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -91,6 +94,7 @@ func TestAccVPCSubnetDataSource_tags_EmptyMap(t *testing.T) { func TestAccVPCSubnetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -121,6 +125,7 @@ func TestAccVPCSubnetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCSubnetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ @@ -157,6 +162,7 @@ func TestAccVPCSubnetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccVPCSubnetDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_subnet.test" acctest.ParallelTest(ctx, t, resource.TestCase{ diff --git a/internal/service/ec2/vpc_subnet_identity_gen_test.go b/internal/service/ec2/vpc_subnet_identity_gen_test.go new file mode 100644 index 000000000000..8e1d0e5d4344 --- /dev/null +++ b/internal/service/ec2/vpc_subnet_identity_gen_test.go @@ -0,0 +1,231 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ec2_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccVPCSubnet_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Subnet + resourceName := "aws_subnet.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: testAccCheckSubnetDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSubnetExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic/"), + ConfigVariables: config.Variables{}, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccVPCSubnet_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_subnet.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccVPCSubnet_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Subnet + resourceName := "aws_subnet.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + CheckDestroy: testAccCheckSubnetDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic_v6.8.0/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSubnetExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Subnet/basic/"), + ConfigVariables: config.Variables{}, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrID: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrID)), + }, + }, + }, + }) +} diff --git a/internal/service/ec2/vpc_subnet_tags_gen_test.go b/internal/service/ec2/vpc_subnet_tags_gen_test.go index 3178bb9e0383..9d841dce2ce6 100644 --- a/internal/service/ec2/vpc_subnet_tags_gen_test.go +++ b/internal/service/ec2/vpc_subnet_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCSubnet_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -191,6 +192,7 @@ func TestAccVPCSubnet_tags(t *testing.T) { func TestAccVPCSubnet_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -254,6 +256,7 @@ func TestAccVPCSubnet_tags_null(t *testing.T) { func TestAccVPCSubnet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -313,6 +316,7 @@ func TestAccVPCSubnet_tags_EmptyMap(t *testing.T) { func TestAccVPCSubnet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -390,6 +394,7 @@ func TestAccVPCSubnet_tags_AddOnUpdate(t *testing.T) { func TestAccVPCSubnet_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -474,6 +479,7 @@ func TestAccVPCSubnet_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCSubnet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -605,6 +611,7 @@ func TestAccVPCSubnet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccVPCSubnet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -690,6 +697,7 @@ func TestAccVPCSubnet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -862,6 +870,7 @@ func TestAccVPCSubnet_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1015,6 +1024,7 @@ func TestAccVPCSubnet_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1184,6 +1194,7 @@ func TestAccVPCSubnet_tags_DefaultTags_overlapping(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1270,6 +1281,7 @@ func TestAccVPCSubnet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1355,6 +1367,7 @@ func TestAccVPCSubnet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1417,6 +1430,7 @@ func TestAccVPCSubnet_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1471,6 +1485,7 @@ func TestAccVPCSubnet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccVPCSubnet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1530,6 +1545,7 @@ func TestAccVPCSubnet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func TestAccVPCSubnet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1589,6 +1605,7 @@ func TestAccVPCSubnet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. func TestAccVPCSubnet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1641,6 +1658,7 @@ func TestAccVPCSubnet_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCSubnet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1734,6 +1752,7 @@ func TestAccVPCSubnet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccVPCSubnet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1817,6 +1836,7 @@ func TestAccVPCSubnet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCSubnet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" @@ -1975,6 +1995,7 @@ func TestAccVPCSubnet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccVPCSubnet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Subnet resourceName := "aws_subnet.test" diff --git a/internal/service/ec2/vpc_tags_gen_test.go b/internal/service/ec2/vpc_tags_gen_test.go index cf9673ad78cf..9ead77c352b4 100644 --- a/internal/service/ec2/vpc_tags_gen_test.go +++ b/internal/service/ec2/vpc_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCVPC_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -191,6 +192,7 @@ func TestAccVPCVPC_tags(t *testing.T) { func TestAccVPCVPC_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -254,6 +256,7 @@ func TestAccVPCVPC_tags_null(t *testing.T) { func TestAccVPCVPC_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -313,6 +316,7 @@ func TestAccVPCVPC_tags_EmptyMap(t *testing.T) { func TestAccVPCVPC_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -390,6 +394,7 @@ func TestAccVPCVPC_tags_AddOnUpdate(t *testing.T) { func TestAccVPCVPC_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -474,6 +479,7 @@ func TestAccVPCVPC_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCVPC_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -605,6 +611,7 @@ func TestAccVPCVPC_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccVPCVPC_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -690,6 +697,7 @@ func TestAccVPCVPC_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -862,6 +870,7 @@ func TestAccVPCVPC_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1015,6 +1024,7 @@ func TestAccVPCVPC_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1184,6 +1194,7 @@ func TestAccVPCVPC_tags_DefaultTags_overlapping(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1270,6 +1281,7 @@ func TestAccVPCVPC_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1355,6 +1367,7 @@ func TestAccVPCVPC_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1417,6 +1430,7 @@ func TestAccVPCVPC_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1471,6 +1485,7 @@ func TestAccVPCVPC_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1530,6 +1545,7 @@ func TestAccVPCVPC_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccVPCVPC_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1589,6 +1605,7 @@ func TestAccVPCVPC_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) func TestAccVPCVPC_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1641,6 +1658,7 @@ func TestAccVPCVPC_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCVPC_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1734,6 +1752,7 @@ func TestAccVPCVPC_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccVPCVPC_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1817,6 +1836,7 @@ func TestAccVPCVPC_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccVPCVPC_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" @@ -1975,6 +1995,7 @@ func TestAccVPCVPC_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccVPCVPC_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Vpc resourceName := "aws_vpc.test" diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 31b3c27cd5e8..056accddcd37 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -94,6 +94,11 @@ func TestAccVPC_disappears(t *testing.T) { acctest.CheckResourceDisappears(ctx, acctest.Provider, tfec2.ResourceVPC(), resourceName), ), ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, }, }, }) diff --git a/internal/service/ec2/vpnclient_endpoint.go b/internal/service/ec2/vpnclient_endpoint.go index 11ce355714ed..c49ccbf292e6 100644 --- a/internal/service/ec2/vpnclient_endpoint.go +++ b/internal/service/ec2/vpnclient_endpoint.go @@ -373,8 +373,8 @@ func resourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData, d.Set(names.AttrDescription, ep.Description) d.Set("disconnect_on_session_timeout", ep.DisconnectOnSessionTimeout) d.Set(names.AttrDNSName, ep.DnsName) - d.Set("dns_servers", aws.StringSlice(ep.DnsServers)) - d.Set(names.AttrSecurityGroupIDs, aws.StringSlice(ep.SecurityGroupIds)) + d.Set("dns_servers", ep.DnsServers) + d.Set(names.AttrSecurityGroupIDs, ep.SecurityGroupIds) if aws.ToString(ep.SelfServicePortalUrl) != "" { d.Set("self_service_portal", awstypes.SelfServicePortalEnabled) } else { diff --git a/internal/service/ec2/vpnclient_endpoint_data_source.go b/internal/service/ec2/vpnclient_endpoint_data_source.go index dd57af467bea..462888dce15e 100644 --- a/internal/service/ec2/vpnclient_endpoint_data_source.go +++ b/internal/service/ec2/vpnclient_endpoint_data_source.go @@ -258,8 +258,8 @@ func dataSourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData } d.Set(names.AttrDescription, ep.Description) d.Set(names.AttrDNSName, ep.DnsName) - d.Set("dns_servers", aws.StringSlice(ep.DnsServers)) - d.Set(names.AttrSecurityGroupIDs, aws.StringSlice(ep.SecurityGroupIds)) + d.Set("dns_servers", ep.DnsServers) + d.Set(names.AttrSecurityGroupIDs, ep.SecurityGroupIds) if aws.ToString(ep.SelfServicePortalUrl) != "" { d.Set("self_service_portal", awstypes.SelfServicePortalEnabled) } else { diff --git a/internal/service/ec2/vpnclient_route.go b/internal/service/ec2/vpnclient_route.go index 5a359ec8f715..c1223f114dfc 100644 --- a/internal/service/ec2/vpnclient_route.go +++ b/internal/service/ec2/vpnclient_route.go @@ -92,7 +92,7 @@ func resourceClientVPNRouteCreate(ctx context.Context, d *schema.ResourceData, m input.Description = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateClientVpnRoute(ctx, input) }, errCodeInvalidClientVPNActiveAssociationNotFound) diff --git a/internal/service/ec2/vpnsite_gateway.go b/internal/service/ec2/vpnsite_gateway.go index 89f959af034c..3a06aca9f0c0 100644 --- a/internal/service/ec2/vpnsite_gateway.go +++ b/internal/service/ec2/vpnsite_gateway.go @@ -174,7 +174,7 @@ func resourceVPNGatewayDelete(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteVpnGateway(ctx, &ec2.DeleteVpnGatewayInput{ VpnGatewayId: aws.String(d.Id()), }) @@ -201,7 +201,7 @@ func attachVPNGatewayToVPC(ctx context.Context, conn *ec2.Client, vpnGatewayID, VpnGatewayId: aws.String(vpnGatewayID), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func(ctx context.Context) (any, error) { return conn.AttachVpnGateway(ctx, &input) }, errCodeInvalidVPNGatewayIDNotFound) diff --git a/internal/service/ecr/repository.go b/internal/service/ecr/repository.go index f48e064dbed4..c06422e47c57 100644 --- a/internal/service/ecr/repository.go +++ b/internal/service/ecr/repository.go @@ -5,15 +5,20 @@ package ecr import ( "context" + "fmt" "log" + "strings" "time" + "github.com/YakDriver/regexache" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ecr" "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" @@ -41,6 +46,8 @@ func resourceRepository() *schema.Resource { Delete: schema.DefaultTimeout(20 * time.Minute), }, + CustomizeDiff: validateImageTagMutabilityExclusionFilterUsage, + Schema: map[string]*schema.Schema{ names.AttrARN: { Type: schema.TypeString, @@ -93,6 +100,32 @@ func resourceRepository() *schema.Resource { Default: types.ImageTagMutabilityMutable, ValidateDiagFunc: enum.Validate[types.ImageTagMutability](), }, + "image_tag_mutability_exclusion_filter": { + Type: schema.TypeList, + Optional: true, + MaxItems: 5, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + names.AttrFilter: { + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validation.AllDiag( + validation.ToDiagFunc(validation.StringLenBetween(1, 128)), + validation.ToDiagFunc(validation.StringMatch( + regexache.MustCompile(`^[a-zA-Z0-9._*-]+$`), + "must contain only letters, numbers, and special characters (._*-)", + )), + validateImageTagMutabilityExclusionFilter(), + ), + }, + "filter_type": { + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: enum.Validate[types.ImageTagMutabilityExclusionFilterType](), + }, + }, + }, + }, names.AttrName: { Type: schema.TypeString, Required: true, @@ -131,6 +164,10 @@ func resourceRepositoryCreate(ctx context.Context, d *schema.ResourceData, meta } } + if v, ok := d.GetOk("image_tag_mutability_exclusion_filter"); ok && len(v.([]any)) > 0 { + input.ImageTagMutabilityExclusionFilters = expandImageTagMutabilityExclusionFilters(v.([]any)) + } + output, err := conn.CreateRepository(ctx, input) // Some partitions (e.g. ISO) may not support tag-on-create. @@ -189,6 +226,9 @@ func resourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta an return sdkdiag.AppendErrorf(diags, "setting image_scanning_configuration: %s", err) } d.Set("image_tag_mutability", repository.ImageTagMutability) + if err := d.Set("image_tag_mutability_exclusion_filter", flattenImageTagMutabilityExclusionFilters(repository.ImageTagMutabilityExclusionFilters)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting image_tag_mutability_exclusion_filter: %s", err) + } d.Set(names.AttrName, repository.RepositoryName) d.Set("registry_id", repository.RegistryId) d.Set("repository_url", repository.RepositoryUri) @@ -200,13 +240,17 @@ func resourceRepositoryUpdate(ctx context.Context, d *schema.ResourceData, meta var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ECRClient(ctx) - if d.HasChange("image_tag_mutability") { + if d.HasChanges("image_tag_mutability", "image_tag_mutability_exclusion_filter") { input := &ecr.PutImageTagMutabilityInput{ ImageTagMutability: types.ImageTagMutability((d.Get("image_tag_mutability").(string))), RegistryId: aws.String(d.Get("registry_id").(string)), RepositoryName: aws.String(d.Id()), } + if v, ok := d.GetOk("image_tag_mutability_exclusion_filter"); ok && len(v.([]any)) > 0 { + input.ImageTagMutabilityExclusionFilters = expandImageTagMutabilityExclusionFilters(v.([]any)) + } + _, err := conn.PutImageTagMutability(ctx, input) if err != nil { @@ -343,3 +387,67 @@ func flattenRepositoryEncryptionConfiguration(ec *types.EncryptionConfiguration) config, } } + +func expandImageTagMutabilityExclusionFilters(data []any) []types.ImageTagMutabilityExclusionFilter { + if len(data) == 0 { + return nil + } + + var filters []types.ImageTagMutabilityExclusionFilter + for _, v := range data { + tfMap := v.(map[string]any) + filter := types.ImageTagMutabilityExclusionFilter{ + Filter: aws.String(tfMap[names.AttrFilter].(string)), + FilterType: types.ImageTagMutabilityExclusionFilterType(tfMap["filter_type"].(string)), + } + filters = append(filters, filter) + } + + return filters +} + +func flattenImageTagMutabilityExclusionFilters(filters []types.ImageTagMutabilityExclusionFilter) []any { + if len(filters) == 0 { + return nil + } + + var tfList []any + for _, filter := range filters { + tfMap := map[string]any{ + names.AttrFilter: aws.ToString(filter.Filter), + "filter_type": string(filter.FilterType), + } + tfList = append(tfList, tfMap) + } + + return tfList +} + +func validateImageTagMutabilityExclusionFilter() schema.SchemaValidateDiagFunc { + return func(v any, path cty.Path) diag.Diagnostics { + var diags diag.Diagnostics + value := v.(string) + + wildcardCount := strings.Count(value, "*") + if wildcardCount > 2 { + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Invalid filter pattern", + Detail: "Image tag mutability exclusion filter can contain a maximum of 2 wildcards (*)", + }) + } + + return diags + } +} + +func validateImageTagMutabilityExclusionFilterUsage(_ context.Context, d *schema.ResourceDiff, meta any) error { + mutability := d.Get("image_tag_mutability").(string) + filters := d.Get("image_tag_mutability_exclusion_filter").([]any) + + if len(filters) > 0 && mutability != string(types.ImageTagMutabilityImmutableWithExclusion) && mutability != string(types.ImageTagMutabilityMutableWithExclusion) { + return fmt.Errorf("image_tag_mutability_exclusion_filter can only be used when image_tag_mutability is set to IMMUTABLE_WITH_EXCLUSION or MUTABLE_WITH_EXCLUSION") + } + + return nil +} diff --git a/internal/service/ecr/repository_creation_template.go b/internal/service/ecr/repository_creation_template.go index e720b08bd987..6f206b0753f7 100644 --- a/internal/service/ecr/repository_creation_template.go +++ b/internal/service/ecr/repository_creation_template.go @@ -86,6 +86,32 @@ func resourceRepositoryCreationTemplate() *schema.Resource { Default: types.ImageTagMutabilityMutable, ValidateDiagFunc: enum.Validate[types.ImageTagMutability](), }, + "image_tag_mutability_exclusion_filter": { + Type: schema.TypeList, + Optional: true, + MaxItems: 5, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + names.AttrFilter: { + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validation.AllDiag( + validation.ToDiagFunc(validation.StringLenBetween(1, 128)), + validation.ToDiagFunc(validation.StringMatch( + regexache.MustCompile(`^[a-zA-Z0-9._*-]+$`), + "must contain only letters, numbers, and special characters (._*-)", + )), + validateImageTagMutabilityExclusionFilter(), + ), + }, + "filter_type": { + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: enum.Validate[types.ImageTagMutabilityExclusionFilterType](), + }, + }, + }, + }, "lifecycle_policy": { Type: schema.TypeString, Optional: true, @@ -141,6 +167,10 @@ func resourceRepositoryCreationTemplateCreate(ctx context.Context, d *schema.Res input.Description = aws.String(v.(string)) } + if v, ok := d.GetOk("image_tag_mutability_exclusion_filter"); ok && len(v.([]any)) > 0 && v.([]any)[0] != nil { + input.ImageTagMutabilityExclusionFilters = expandImageTagMutabilityExclusionFilters(v.([]any)) + } + if v, ok := d.GetOk("lifecycle_policy"); ok { policy, err := structure.NormalizeJsonString(v.(string)) if err != nil { @@ -198,6 +228,10 @@ func resourceRepositoryCreationTemplateRead(ctx context.Context, d *schema.Resou } d.Set("image_tag_mutability", rct.ImageTagMutability) + if err := d.Set("image_tag_mutability_exclusion_filter", flattenImageTagMutabilityExclusionFilters(rct.ImageTagMutabilityExclusionFilters)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting image_tag_mutability_exclusion_filter: %s", err) + } + if _, err := equivalentLifecyclePolicyJSON(d.Get("lifecycle_policy").(string), aws.ToString(rct.LifecyclePolicy)); err != nil { return sdkdiag.AppendFromErr(diags, err) } @@ -258,6 +292,12 @@ func resourceRepositoryCreationTemplateUpdate(ctx context.Context, d *schema.Res input.ImageTagMutability = types.ImageTagMutability((d.Get("image_tag_mutability").(string))) } + if d.HasChange("image_tag_mutability_exclusion_filter") { + // To use image_tag_mutability_exclusion_filter, image_tag_mutability must be set + input.ImageTagMutability = types.ImageTagMutability((d.Get("image_tag_mutability").(string))) + input.ImageTagMutabilityExclusionFilters = expandImageTagMutabilityExclusionFilters(d.Get("image_tag_mutability_exclusion_filter").([]any)) + } + if d.HasChange("lifecycle_policy") { policy, err := structure.NormalizeJsonString(d.Get("lifecycle_policy").(string)) if err != nil { diff --git a/internal/service/ecr/repository_creation_template_data_source.go b/internal/service/ecr/repository_creation_template_data_source.go index c7abfc1124c4..efd933252529 100644 --- a/internal/service/ecr/repository_creation_template_data_source.go +++ b/internal/service/ecr/repository_creation_template_data_source.go @@ -59,6 +59,22 @@ func dataSourceRepositoryCreationTemplate() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "image_tag_mutability_exclusion_filter": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + names.AttrFilter: { + Type: schema.TypeString, + Computed: true, + }, + "filter_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "lifecycle_policy": { Type: schema.TypeString, Computed: true, @@ -106,6 +122,9 @@ func dataSourceRepositoryCreationTemplateRead(ctx context.Context, d *schema.Res return sdkdiag.AppendErrorf(diags, "setting encryption_configuration: %s", err) } d.Set("image_tag_mutability", rct.ImageTagMutability) + if err := d.Set("image_tag_mutability_exclusion_filter", flattenImageTagMutabilityExclusionFilters(rct.ImageTagMutabilityExclusionFilters)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting image_tag_mutability_exclusion_filter: %s", err) + } policy, err := structure.NormalizeJsonString(aws.ToString(rct.LifecyclePolicy)) if err != nil { diff --git a/internal/service/ecr/repository_creation_template_data_source_test.go b/internal/service/ecr/repository_creation_template_data_source_test.go index c404088f4a0f..e95c5678aa3e 100644 --- a/internal/service/ecr/repository_creation_template_data_source_test.go +++ b/internal/service/ecr/repository_creation_template_data_source_test.go @@ -66,6 +66,31 @@ func TestAccECRRepositoryCreationTemplateDataSource_root(t *testing.T) { }) } +func TestAccECRRepositoryCreationTemplateDataSource_mutabilityWithExclusion(t *testing.T) { + ctx := acctest.Context(t) + repositoryPrefix := "tf-test-" + sdkacctest.RandString(8) + dataSource := "data.aws_ecr_repository_creation_template.root" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccRepositoryCreationTemplateDataSourceConfig_mutabilityWithExclusion(repositoryPrefix, "latest*", "prod-*"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability", string(types.ImageTagMutabilityMutableWithExclusion)), + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability_exclusion_filter.#", "2"), + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability_exclusion_filter.0.filter", "latest*"), + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability_exclusion_filter.0.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability_exclusion_filter.1.filter", "prod-*"), + resource.TestCheckResourceAttr(dataSource, "image_tag_mutability_exclusion_filter.1.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + ), + }, + }, + }) +} + func testAccRepositoryCreationTemplateDataSourceConfig_basic(repositoryPrefix string) string { return fmt.Sprintf(` resource "aws_ecr_repository_creation_template" "test" { @@ -101,3 +126,35 @@ data "aws_ecr_repository_creation_template" "root" { } ` } + +func testAccRepositoryCreationTemplateDataSourceConfig_mutabilityWithExclusion(repositoryPrefix, filter1, filter2 string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository_creation_template" "test" { + prefix = %[1]q + + applied_for = [ + "PULL_THROUGH_CACHE", + "REPLICATION", + ] + + resource_tags = { + Foo = "Bar" + } + + image_tag_mutability = "MUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = %[2]q + filter_type = "WILDCARD" + } + + image_tag_mutability_exclusion_filter { + filter = %[3]q + filter_type = "WILDCARD" + } +} +data "aws_ecr_repository_creation_template" "root" { + prefix = aws_ecr_repository_creation_template.test.prefix +} +`, repositoryPrefix, filter1, filter2) +} diff --git a/internal/service/ecr/repository_creation_template_test.go b/internal/service/ecr/repository_creation_template_test.go index e9480a258e5b..bfb633d49edf 100644 --- a/internal/service/ecr/repository_creation_template_test.go +++ b/internal/service/ecr/repository_creation_template_test.go @@ -197,6 +197,50 @@ func TestAccECRRepositoryCreationTemplate_root(t *testing.T) { }) } +func TestAccECRRepositoryCreationTemplate_mutabilityWithExclusion(t *testing.T) { + ctx := acctest.Context(t) + repositoryPrefix := "tf-test-" + sdkacctest.RandString(8) + resourceName := "aws_ecr_repository_creation_template.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryCreationTemplateDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryCreationTemplateConfig_mutabilityWithExclusion(repositoryPrefix, "latest*", "prod-*"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRepositoryCreationTemplateExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability", string(types.ImageTagMutabilityMutableWithExclusion)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "latest*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.1.filter", "prod-*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.1.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccRepositoryCreationTemplateConfig_mutabilityWithExclusion(repositoryPrefix, "prod-*", "latest*"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRepositoryCreationTemplateExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability", string(types.ImageTagMutabilityMutableWithExclusion)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "prod-*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.1.filter", "latest*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.1.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + ), + }, + }, + }) +} + func testAccCheckRepositoryCreationTemplateDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).ECRClient(ctx) @@ -435,3 +479,32 @@ resource "aws_ecr_repository_creation_template" "root" { } ` } + +func testAccRepositoryCreationTemplateConfig_mutabilityWithExclusion(repositoryPrefix, filter1, filter2 string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository_creation_template" "test" { + prefix = %[1]q + + applied_for = [ + "PULL_THROUGH_CACHE", + "REPLICATION", + ] + + resource_tags = { + Foo = "Bar" + } + + image_tag_mutability = "MUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = %[2]q + filter_type = "WILDCARD" + } + + image_tag_mutability_exclusion_filter { + filter = %[3]q + filter_type = "WILDCARD" + } +} +`, repositoryPrefix, filter1, filter2) +} diff --git a/internal/service/ecr/repository_data_source.go b/internal/service/ecr/repository_data_source.go index 542890418099..e18ebf7ee708 100644 --- a/internal/service/ecr/repository_data_source.go +++ b/internal/service/ecr/repository_data_source.go @@ -61,6 +61,22 @@ func dataSourceRepository() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "image_tag_mutability_exclusion_filter": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + names.AttrFilter: { + Type: schema.TypeString, + Computed: true, + }, + "filter_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "most_recent_image_tags": { Type: schema.TypeList, Computed: true, @@ -113,6 +129,9 @@ func dataSourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta return sdkdiag.AppendErrorf(diags, "setting image_scanning_configuration: %s", err) } d.Set("image_tag_mutability", repository.ImageTagMutability) + if err := d.Set("image_tag_mutability_exclusion_filter", flattenImageTagMutabilityExclusionFilters(repository.ImageTagMutabilityExclusionFilters)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting image_tag_mutability_exclusion_filter: %s", err) + } d.Set(names.AttrName, repository.RepositoryName) d.Set("registry_id", repository.RegistryId) d.Set("repository_url", repository.RepositoryUri) diff --git a/internal/service/ecr/repository_data_source_test.go b/internal/service/ecr/repository_data_source_test.go index 6dc0690aac60..636130f3122c 100644 --- a/internal/service/ecr/repository_data_source_test.go +++ b/internal/service/ecr/repository_data_source_test.go @@ -71,6 +71,29 @@ func TestAccECRRepositoryDataSource_encryption(t *testing.T) { }) } +func TestAccECRRepositoryDataSource_mutabilityWithExclusion(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecr_repository.test" + dataSourceName := "data.aws_ecr_repository.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccRepositoryDataSourceConfig_mutabilityWithExclusion(rName, "test*"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "image_tag_mutability_exclusion_filter.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "image_tag_mutability_exclusion_filter.0.filter", dataSourceName, "image_tag_mutability_exclusion_filter.0.filter"), + resource.TestCheckResourceAttrPair(resourceName, "image_tag_mutability_exclusion_filter.0.filter_type", dataSourceName, "image_tag_mutability_exclusion_filter.0.filter_type"), + ), + }, + }, + }) +} + func TestAccECRRepositoryDataSource_nonExistent(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ @@ -130,3 +153,20 @@ data "aws_ecr_repository" "test" { } `, rName) } + +func testAccRepositoryDataSourceConfig_mutabilityWithExclusion(rName, filter string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository" "test" { + name = %[1]q + image_tag_mutability = "MUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = %[2]q + filter_type = "WILDCARD" + } +} +data "aws_ecr_repository" "test" { + name = aws_ecr_repository.test.name +} +`, rName, filter) +} diff --git a/internal/service/ecr/repository_test.go b/internal/service/ecr/repository_test.go index e0f9b66b24ac..39ad38995831 100644 --- a/internal/service/ecr/repository_test.go +++ b/internal/service/ecr/repository_test.go @@ -6,6 +6,7 @@ package ecr_test import ( "context" "fmt" + "strings" "testing" "github.com/YakDriver/regexache" @@ -156,6 +157,128 @@ func TestAccECRRepository_immutability(t *testing.T) { }) } +func TestAccECRRepository_immutabilityWithExclusion(t *testing.T) { + ctx := acctest.Context(t) + var v types.Repository + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecr_repository.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryConfig_immutabilityWithExclusion(rName, "latest*"), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability", string(types.ImageTagMutabilityImmutableWithExclusion)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "latest*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccRepositoryConfig_immutabilityWithExclusion(rName, "dev-*"), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "dev-*"), + ), + }, + }, + }) +} + +func TestAccECRRepository_mutabilityWithExclusion(t *testing.T) { + ctx := acctest.Context(t) + var v types.Repository + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecr_repository.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryConfig_mutabilityWithExclusion(rName, "prod-*"), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability", string(types.ImageTagMutabilityMutableWithExclusion)), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "prod-*"), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter_type", string(types.ImageTagMutabilityExclusionFilterTypeWildcard)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccRepositoryConfig_mutabilityWithExclusion(rName, "release-*"), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "image_tag_mutability_exclusion_filter.0.filter", "release-*"), + ), + }, + }, + }) +} + +func TestAccECRRepository_immutabilityWithExclusion_validation(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryConfig_immutabilityWithExclusion(rName, "invalid!@#$"), + ExpectError: regexache.MustCompile(`must contain only letters, numbers, and special characters`), + }, + { + Config: testAccRepositoryConfig_immutabilityWithExclusion(rName, "a*b*c*d"), + ExpectError: regexache.MustCompile(`Image tag mutability exclusion filter can contain a maximum of 2 wildcards`), + }, + { + Config: testAccRepositoryConfig_immutabilityWithExclusion(rName, strings.Repeat("a", 129)), + ExpectError: regexache.MustCompile(`expected length of.*to be in the range.*128`), + }, + }, + }) +} + +func TestAccECRRepository_immutabilityWithExclusion_crossValidation(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECRServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryConfig_immutabilityWithExclusionInvalid(rName), + ExpectError: regexache.MustCompile(`image_tag_mutability_exclusion_filter can only be used when image_tag_mutability is set to IMMUTABLE_WITH_EXCLUSION`), + }, + }, + }) +} + func TestAccECRRepository_Image_scanning(t *testing.T) { ctx := acctest.Context(t) var v1, v2 types.Repository @@ -448,6 +571,48 @@ resource "aws_ecr_repository" "test" { `, rName) } +func testAccRepositoryConfig_immutabilityWithExclusion(rName, filter string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository" "test" { + name = %[1]q + image_tag_mutability = "IMMUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = %[2]q + filter_type = "WILDCARD" + } +} +`, rName, filter) +} + +func testAccRepositoryConfig_mutabilityWithExclusion(rName, filter string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository" "test" { + name = %[1]q + image_tag_mutability = "MUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = %[2]q + filter_type = "WILDCARD" + } +} +`, rName, filter) +} + +func testAccRepositoryConfig_immutabilityWithExclusionInvalid(rName string) string { + return fmt.Sprintf(` +resource "aws_ecr_repository" "test" { + name = %[1]q + image_tag_mutability = "MUTABLE" + + image_tag_mutability_exclusion_filter { + filter = "latest*" + filter_type = "WILDCARD" + } +} +`, rName) +} + func testAccRepositoryConfig_imageScanningConfiguration(rName string, scanOnPush bool) string { return fmt.Sprintf(` resource "aws_ecr_repository" "test" { diff --git a/internal/service/ecr/service_endpoint_resolver_gen.go b/internal/service/ecr/service_endpoint_resolver_gen.go index 6972fecf3f7c..86e077b7736c 100644 --- a/internal/service/ecr/service_endpoint_resolver_gen.go +++ b/internal/service/ecr/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ecr.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ecr endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ecr endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index f875c789ca76..2e7bdf8d8edb 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ecrpublic/service_endpoint_resolver_gen.go b/internal/service/ecrpublic/service_endpoint_resolver_gen.go index cd4451fc6e12..df5d5da5ce95 100644 --- a/internal/service/ecrpublic/service_endpoint_resolver_gen.go +++ b/internal/service/ecrpublic/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ecrpublic.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ecrpublic endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ecrpublic endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index 44dd1050270a..66c80a6e716c 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ecs/capacity_provider.go b/internal/service/ecs/capacity_provider.go index dd7b0cce8635..dbb9fcd05eb8 100644 --- a/internal/service/ecs/capacity_provider.go +++ b/internal/service/ecs/capacity_provider.go @@ -206,7 +206,7 @@ func resourceCapacityProviderUpdate(ctx context.Context, d *schema.ResourceData, const ( timeout = 10 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.UpdateInProgressException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.UpdateInProgressException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateCapacityProvider(ctx, input) }) diff --git a/internal/service/ecs/capacity_provider_identity_gen_test.go b/internal/service/ecs/capacity_provider_identity_gen_test.go index 7d8875cae982..1ebb2d8f482f 100644 --- a/internal/service/ecs/capacity_provider_identity_gen_test.go +++ b/internal/service/ecs/capacity_provider_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccECSCapacityProvider_Identity_Basic(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -113,7 +113,7 @@ func TestAccECSCapacityProvider_Identity_RegionOverride(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -235,7 +235,7 @@ func TestAccECSCapacityProvider_Identity_ExistingResource(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ecs/service.go b/internal/service/ecs/service.go index ed3c97dae318..a4812019b7c8 100644 --- a/internal/service/ecs/service.go +++ b/internal/service/ecs/service.go @@ -1471,6 +1471,7 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) return sdkdiag.AppendErrorf(diags, "reading ECS Service (%s): %s", d.Id(), err) } + d.Set(names.AttrARN, service.ServiceArn) d.Set("availability_zone_rebalancing", service.AvailabilityZoneRebalancing) if err := d.Set(names.AttrCapacityProviderStrategy, flattenCapacityProviderStrategyItems(service.CapacityProviderStrategy)); err != nil { return sdkdiag.AppendErrorf(diags, "setting capacity_provider_strategy: %s", err) @@ -1556,6 +1557,8 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) if err := d.Set("service_connect_configuration", flattenServiceConnectConfiguration(v)); err != nil { return sdkdiag.AppendErrorf(diags, "setting service_connect_configuration: %s", err) } + } else { + d.Set("service_connect_configuration", nil) } if v := deployment.VolumeConfigurations; len(v) > 0 { if err := d.Set("volume_configuration", flattenServiceVolumeConfigurations(ctx, v)); err != nil { diff --git a/internal/service/ecs/service_endpoint_resolver_gen.go b/internal/service/ecs/service_endpoint_resolver_gen.go index f880ad4df381..2830773ef1df 100644 --- a/internal/service/ecs/service_endpoint_resolver_gen.go +++ b/internal/service/ecs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ecs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ecs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ecs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 376b9d531759..e44938277abc 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index 4105c8d7c3a8..ef4cb09011f8 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -12,6 +12,7 @@ import ( "github.com/YakDriver/regexache" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ecs" awstypes "github.com/aws/aws-sdk-go-v2/service/ecs/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-testing/compare" @@ -2260,6 +2261,37 @@ func TestAccECSService_ServiceConnect_remove(t *testing.T) { }) } +// Regression for https://github.com/hashicorp/terraform-provider-aws/issues/42818 +func TestAccECSService_ServiceConnect_outOfBandRemoval(t *testing.T) { + ctx := acctest.Context(t) + var service awstypes.Service + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecs_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccServiceConfig_serviceConnectBasic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + testAccCheckServiceDisableServiceConnect(ctx, &service), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: testAccServiceConfig_serviceConnectBasic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_connect_configuration.0.enabled", acctest.CtTrue), + ), + }, + }, + }) +} + func TestAccECSService_Tags_basic(t *testing.T) { ctx := acctest.Context(t) var service awstypes.Service @@ -2334,6 +2366,136 @@ func TestAccECSService_Tags_managed(t *testing.T) { }) } +func TestAccECSService_Tags_UpgradeFromV5_100_0(t *testing.T) { + ctx := acctest.Context(t) + var service awstypes.Service + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecs_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECSServiceID), + CheckDestroy: testAccCheckServiceDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "5.100.0", + }, + }, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + // Just only upgrading to the latest provider version + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags2(rName, acctest.CtKey1, acctest.CtValue1Updated, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "2"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1Updated), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + }, + }) +} + +func TestAccECSService_Tags_UpgradeFromV5_100_0ThroughV6_08_0(t *testing.T) { + ctx := acctest.Context(t) + var service awstypes.Service + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_ecs_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ECSServiceID), + CheckDestroy: testAccCheckServiceDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "5.100.0", + }, + }, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "6.8.0", + }, + }, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + // Just only upgrading to the latest provider version + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags2(rName, acctest.CtKey1, acctest.CtValue1Updated, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "2"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1Updated), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccServiceConfig_tags1(rName, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceExists(ctx, resourceName, &service), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + }, + }) +} + func TestAccECSService_Tags_propagate(t *testing.T) { ctx := acctest.Context(t) var first, second, third awstypes.Service @@ -2485,9 +2647,10 @@ func testAccCheckServiceExists(ctx context.Context, name string, service *awstyp conn := acctest.Provider.Meta().(*conns.AWSClient).ECSClient(ctx) + var output *awstypes.Service err := retry.RetryContext(ctx, 1*time.Minute, func() *retry.RetryError { var err error - service, err = tfecs.FindServiceNoTagsByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["cluster"]) + output, err = tfecs.FindServiceNoTagsByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["cluster"]) if tfresource.NotFound(err) { return retry.RetryableError(err) @@ -2500,6 +2663,29 @@ func testAccCheckServiceExists(ctx context.Context, name string, service *awstyp return nil }) + if err != nil { + return err + } + + *service = *output + + return nil + } +} + +func testAccCheckServiceDisableServiceConnect(ctx context.Context, service *awstypes.Service) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).ECSClient(ctx) + + input := &ecs.UpdateServiceInput{ + Cluster: service.ClusterArn, + Service: service.ServiceName, + ServiceConnectConfiguration: &awstypes.ServiceConnectConfiguration{ + Enabled: false, + }, + } + + _, err := conn.UpdateService(ctx, input) return err } } diff --git a/internal/service/efs/service_endpoint_resolver_gen.go b/internal/service/efs/service_endpoint_resolver_gen.go index b93f94c9ed2f..737f31c3a4ed 100644 --- a/internal/service/efs/service_endpoint_resolver_gen.go +++ b/internal/service/efs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params efs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up efs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up efs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index ecd652f495bb..596aae6d49c3 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/eks/cluster.go b/internal/service/eks/cluster.go index 8a7d28be915f..ebe7b37b9365 100644 --- a/internal/service/eks/cluster.go +++ b/internal/service/eks/cluster.go @@ -168,6 +168,11 @@ func resourceCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, + names.AttrDeletionProtection: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, "enabled_cluster_log_types": { Type: schema.TypeSet, Optional: true, @@ -511,7 +516,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).EKSClient(ctx) name := d.Get(names.AttrName).(string) - input := &eks.CreateClusterInput{ + input := eks.CreateClusterInput{ BootstrapSelfManagedAddons: aws.Bool(d.Get("bootstrap_self_managed_addons").(bool)), EncryptionConfig: expandEncryptionConfig(d.Get("encryption_config").([]any)), Logging: expandLogging(d.Get("enabled_cluster_log_types").(*schema.Set)), @@ -521,12 +526,16 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any Tags: getTagsIn(ctx), } + if v, ok := d.GetOk("access_config"); ok { + input.AccessConfig = expandCreateAccessConfigRequest(v.([]any)) + } + if v, ok := d.GetOk("compute_config"); ok { input.ComputeConfig = expandComputeConfigRequest(v.([]any)) } - if v, ok := d.GetOk("access_config"); ok { - input.AccessConfig = expandCreateAccessConfigRequest(v.([]any)) + if v, ok := d.GetOk(names.AttrDeletionProtection); ok { + input.DeletionProtection = aws.Bool(v.(bool)) } if v, ok := d.GetOk("kubernetes_network_config"); ok { @@ -559,7 +568,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any outputRaw, err := tfresource.RetryWhen(ctx, propagationTimeout, func() (any, error) { - return conn.CreateCluster(ctx, input) + return conn.CreateCluster(ctx, &input) }, func(err error) (bool, error) { // InvalidParameterException: roleArn, arn:aws:iam::123456789012:role/XXX, does not exist @@ -643,6 +652,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) return sdkdiag.AppendErrorf(diags, "setting compute_config: %s", err) } d.Set(names.AttrCreatedAt, cluster.CreatedAt.Format(time.RFC3339)) + d.Set(names.AttrDeletionProtection, cluster.DeletionProtection) if err := d.Set("enabled_cluster_log_types", flattenLogging(cluster.Logging)); err != nil { return sdkdiag.AppendErrorf(diags, "setting enabled_cluster_log_types: %s", err) } @@ -692,7 +702,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any // Do any version update first. if d.HasChange(names.AttrVersion) { - input := &eks.UpdateClusterVersionInput{ + input := eks.UpdateClusterVersionInput{ Name: aws.String(d.Id()), Version: aws.String(d.Get(names.AttrVersion).(string)), } @@ -701,7 +711,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any input.Force = v.(bool) } - output, err := conn.UpdateClusterVersion(ctx, input) + output, err := conn.UpdateClusterVersion(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) version: %s", d.Id(), err) @@ -716,12 +726,12 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any if d.HasChange("access_config") { if v, ok := d.GetOk("access_config"); ok { - input := &eks.UpdateClusterConfigInput{ + input := eks.UpdateClusterConfigInput{ AccessConfig: expandUpdateAccessConfigRequest(v.([]any)), Name: aws.String(d.Id()), } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) access configuration: %s", d.Id(), err) @@ -741,15 +751,14 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any computeConfig := expandComputeConfigRequest(d.Get("compute_config").([]any)) kubernetesNetworkConfig := expandKubernetesNetworkConfigRequest(d.Get("kubernetes_network_config").([]any)) storageConfig := expandStorageConfigRequest(d.Get("storage_config").([]any)) - - input := &eks.UpdateClusterConfigInput{ - Name: aws.String(d.Id()), + input := eks.UpdateClusterConfigInput{ ComputeConfig: computeConfig, KubernetesNetworkConfig: kubernetesNetworkConfig, + Name: aws.String(d.Id()), StorageConfig: storageConfig, } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) compute config: %s", d.Id(), err) @@ -762,16 +771,20 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any } } - if d.HasChange("encryption_config") { - o, n := d.GetChange("encryption_config") + if d.HasChange(names.AttrDeletionProtection) { + if err := updateClusterDeletionProtection(ctx, conn, d.Id(), d.Get(names.AttrDeletionProtection).(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { + return sdkdiag.AppendFromErr(diags, err) + } + } - if len(o.([]any)) == 0 && len(n.([]any)) == 1 { - input := &eks.AssociateEncryptionConfigInput{ + if d.HasChange("encryption_config") { + if o, n := d.GetChange("encryption_config"); len(o.([]any)) == 0 && len(n.([]any)) == 1 { + input := eks.AssociateEncryptionConfigInput{ ClusterName: aws.String(d.Id()), EncryptionConfig: expandEncryptionConfig(d.Get("encryption_config").([]any)), } - output, err := conn.AssociateEncryptionConfig(ctx, input) + output, err := conn.AssociateEncryptionConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "associating EKS Cluster (%s) encryption config: %s", d.Id(), err) @@ -786,12 +799,12 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChange("enabled_cluster_log_types") { - input := &eks.UpdateClusterConfigInput{ + input := eks.UpdateClusterConfigInput{ Logging: expandLogging(d.Get("enabled_cluster_log_types").(*schema.Set)), Name: aws.String(d.Id()), } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) logging: %s", d.Id(), err) @@ -805,12 +818,12 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChange("upgrade_policy") { - input := &eks.UpdateClusterConfigInput{ + input := eks.UpdateClusterConfigInput{ Name: aws.String(d.Id()), UpgradePolicy: expandUpgradePolicy(d.Get("upgrade_policy").([]any)), } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) upgrade policy: %s", d.Id(), err) @@ -824,7 +837,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChanges("vpc_config.0.endpoint_private_access", "vpc_config.0.endpoint_public_access", "vpc_config.0.public_access_cidrs") { - config := &types.VpcConfigRequest{ + config := types.VpcConfigRequest{ EndpointPrivateAccess: aws.Bool(d.Get("vpc_config.0.endpoint_private_access").(bool)), EndpointPublicAccess: aws.Bool(d.Get("vpc_config.0.endpoint_public_access").(bool)), } @@ -833,39 +846,39 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any config.PublicAccessCidrs = flex.ExpandStringValueSet(v.(*schema.Set)) } - if err := updateVPCConfig(ctx, conn, d.Id(), config, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := updateClusterVPCConfig(ctx, conn, d.Id(), &config, d.Timeout(schema.TimeoutUpdate)); err != nil { return sdkdiag.AppendFromErr(diags, err) } } // API only allows one type of update at at time. if d.HasChange("vpc_config.0.subnet_ids") { - config := &types.VpcConfigRequest{ + config := types.VpcConfigRequest{ SubnetIds: flex.ExpandStringValueSet(d.Get("vpc_config.0.subnet_ids").(*schema.Set)), } - if err := updateVPCConfig(ctx, conn, d.Id(), config, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := updateClusterVPCConfig(ctx, conn, d.Id(), &config, d.Timeout(schema.TimeoutUpdate)); err != nil { return sdkdiag.AppendFromErr(diags, err) } } if d.HasChange("vpc_config.0.security_group_ids") { - config := &types.VpcConfigRequest{ + config := types.VpcConfigRequest{ SecurityGroupIds: flex.ExpandStringValueSet(d.Get("vpc_config.0.security_group_ids").(*schema.Set)), } - if err := updateVPCConfig(ctx, conn, d.Id(), config, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := updateClusterVPCConfig(ctx, conn, d.Id(), &config, d.Timeout(schema.TimeoutUpdate)); err != nil { return sdkdiag.AppendFromErr(diags, err) } } if d.HasChange("zonal_shift_config") { - input := &eks.UpdateClusterConfigInput{ + input := eks.UpdateClusterConfigInput{ Name: aws.String(d.Id()), ZonalShiftConfig: expandZonalShiftConfig(d.Get("zonal_shift_config").([]any)), } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating EKS Cluster (%s) zonal shift config: %s", d.Id(), err) @@ -886,20 +899,19 @@ func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).EKSClient(ctx) - input := &eks.DeleteClusterInput{ - Name: aws.String(d.Id()), - } - // If a cluster is scaling up due to load a delete request will fail // This is a temporary workaround until EKS supports multiple parallel mutating operations const ( timeout = 60 * time.Minute ) log.Printf("[DEBUG] Deleting EKS Cluster: %s", d.Id()) + input := eks.DeleteClusterInput{ + Name: aws.String(d.Id()), + } err := tfresource.Retry(ctx, timeout, func() *retry.RetryError { var err error - _, err = conn.DeleteCluster(ctx, input) + _, err = conn.DeleteCluster(ctx, &input) if errs.IsAErrorMessageContains[*types.ResourceInUseException](err, "in progress") { return retry.RetryableError(err) @@ -913,7 +925,7 @@ func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta any }, tfresource.WithDelayRand(1*time.Minute), tfresource.WithPollInterval(30*time.Second)) if tfresource.TimedOut(err) { - _, err = conn.DeleteCluster(ctx, input) + _, err = conn.DeleteCluster(ctx, &input) } if errs.IsA[*types.ResourceNotFoundException](err) { @@ -938,10 +950,14 @@ func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta any } func findClusterByName(ctx context.Context, conn *eks.Client, name string) (*types.Cluster, error) { - input := &eks.DescribeClusterInput{ + input := eks.DescribeClusterInput{ Name: aws.String(name), } + return findCluster(ctx, conn, &input) +} + +func findCluster(ctx context.Context, conn *eks.Client, input *eks.DescribeClusterInput) (*types.Cluster, error) { output, err := conn.DescribeCluster(ctx, input) // Sometimes the EKS API returns the ResourceNotFound error in this form: @@ -964,33 +980,58 @@ func findClusterByName(ctx context.Context, conn *eks.Client, name string) (*typ return output.Cluster, nil } -func updateVPCConfig(ctx context.Context, conn *eks.Client, name string, vpcConfig *types.VpcConfigRequest, timeout time.Duration) error { - input := &eks.UpdateClusterConfigInput{ +func updateClusterDeletionProtection(ctx context.Context, conn *eks.Client, name string, deletionProtection bool, timeout time.Duration) error { + input := eks.UpdateClusterConfigInput{ + DeletionProtection: aws.Bool(deletionProtection), + Name: aws.String(name), + } + + output, err := conn.UpdateClusterConfig(ctx, &input) + + if err != nil { + return fmt.Errorf("updating EKS Cluster (%s) deletion protection (%t): %w", name, deletionProtection, err) + } + + updateID := aws.ToString(output.Update.Id) + + if _, err := waitClusterUpdateSuccessful(ctx, conn, name, updateID, timeout); err != nil { + return fmt.Errorf("waiting for EKS Cluster (%s) deletion protection update (%s): %w", name, updateID, err) + } + + return nil +} + +func updateClusterVPCConfig(ctx context.Context, conn *eks.Client, name string, vpcConfig *types.VpcConfigRequest, timeout time.Duration) error { + input := eks.UpdateClusterConfigInput{ Name: aws.String(name), ResourcesVpcConfig: vpcConfig, } - output, err := conn.UpdateClusterConfig(ctx, input) + output, err := conn.UpdateClusterConfig(ctx, &input) if err != nil { - return fmt.Errorf("updating EKS Cluster (%s) VPC configuration: %s", name, err) + return fmt.Errorf("updating EKS Cluster (%s) VPC configuration: %w", name, err) } updateID := aws.ToString(output.Update.Id) if _, err := waitClusterUpdateSuccessful(ctx, conn, name, updateID, timeout); err != nil { - return fmt.Errorf("waiting for EKS Cluster (%s) VPC configuration update (%s): %s", name, updateID, err) + return fmt.Errorf("waiting for EKS Cluster (%s) VPC configuration update (%s): %w", name, updateID, err) } return nil } -func findClusterUpdateByTwoPartKey(ctx context.Context, conn *eks.Client, name, id string) (*types.Update, error) { - input := &eks.DescribeUpdateInput{ +func findUpdateByTwoPartKey(ctx context.Context, conn *eks.Client, name, id string) (*types.Update, error) { + input := eks.DescribeUpdateInput{ Name: aws.String(name), UpdateId: aws.String(id), } + return findUpdate(ctx, conn, &input) +} + +func findUpdate(ctx context.Context, conn *eks.Client, input *eks.DescribeUpdateInput) (*types.Update, error) { output, err := conn.DescribeUpdate(ctx, input) if errs.IsA[*types.ResourceNotFoundException](err) { @@ -1027,9 +1068,9 @@ func statusCluster(ctx context.Context, conn *eks.Client, name string) retry.Sta } } -func statusClusterUpdate(ctx context.Context, conn *eks.Client, name, id string) retry.StateRefreshFunc { +func statusUpdate(ctx context.Context, conn *eks.Client, name, id string) retry.StateRefreshFunc { return func() (any, string, error) { - output, err := findClusterUpdateByTwoPartKey(ctx, conn, name, id) + output, err := findUpdateByTwoPartKey(ctx, conn, name, id) if tfresource.NotFound(err) { return nil, "", nil @@ -1085,7 +1126,7 @@ func waitClusterUpdateSuccessful(ctx context.Context, conn *eks.Client, name, id stateConf := &retry.StateChangeConf{ Pending: enum.Slice(types.UpdateStatusInProgress), Target: enum.Slice(types.UpdateStatusSuccessful), - Refresh: statusClusterUpdate(ctx, conn, name, id), + Refresh: statusUpdate(ctx, conn, name, id), Timeout: timeout, } diff --git a/internal/service/eks/cluster_data_source.go b/internal/service/eks/cluster_data_source.go index c5db44de1e73..d49aeb66e3c3 100644 --- a/internal/service/eks/cluster_data_source.go +++ b/internal/service/eks/cluster_data_source.go @@ -16,6 +16,7 @@ import ( ) // @SDKDataSource("aws_eks_cluster", name="Cluster") +// @Tags func dataSourceCluster() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourceClusterRead, @@ -84,6 +85,10 @@ func dataSourceCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, + names.AttrDeletionProtection: { + Type: schema.TypeBool, + Computed: true, + }, "enabled_cluster_log_types": { Type: schema.TypeSet, Computed: true, @@ -321,9 +326,7 @@ func dataSourceCluster() *schema.Resource { func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).EKSClient(ctx) - ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig(ctx) name := d.Get(names.AttrName).(string) cluster, err := findClusterByName(ctx, conn, name) @@ -348,6 +351,7 @@ func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any return sdkdiag.AppendErrorf(diags, "setting compute_config: %s", err) } d.Set(names.AttrCreatedAt, cluster.CreatedAt.Format(time.RFC3339)) + d.Set(names.AttrDeletionProtection, cluster.DeletionProtection) if err := d.Set("enabled_cluster_log_types", flattenLogging(cluster.Logging)); err != nil { return sdkdiag.AppendErrorf(diags, "setting enabled_cluster_log_types: %s", err) } @@ -382,9 +386,7 @@ func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any return sdkdiag.AppendErrorf(diags, "setting zonal_shift_config: %s", err) } - if err := d.Set(names.AttrTags, keyValueTags(ctx, cluster.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) - } + setTagsOut(ctx, cluster.Tags) return diags } diff --git a/internal/service/eks/cluster_data_source_test.go b/internal/service/eks/cluster_data_source_test.go index 66aec92b5ddb..0ae617b1b543 100644 --- a/internal/service/eks/cluster_data_source_test.go +++ b/internal/service/eks/cluster_data_source_test.go @@ -35,6 +35,7 @@ func TestAccEKSClusterDataSource_basic(t *testing.T) { resource.TestCheckNoResourceAttr(dataSourceResourceName, "cluster_id"), resource.TestCheckResourceAttr(resourceName, "compute_config.#", "0"), resource.TestCheckResourceAttrPair(resourceName, names.AttrCreatedAt, dataSourceResourceName, names.AttrCreatedAt), + resource.TestCheckResourceAttrPair(resourceName, names.AttrDeletionProtection, dataSourceResourceName, names.AttrDeletionProtection), resource.TestCheckResourceAttr(dataSourceResourceName, "enabled_cluster_log_types.#", "2"), resource.TestCheckTypeSetElemAttr(dataSourceResourceName, "enabled_cluster_log_types.*", "api"), resource.TestCheckTypeSetElemAttr(dataSourceResourceName, "enabled_cluster_log_types.*", "audit"), diff --git a/internal/service/eks/cluster_test.go b/internal/service/eks/cluster_test.go index 13b2310e8bba..8729b702cc7a 100644 --- a/internal/service/eks/cluster_test.go +++ b/internal/service/eks/cluster_test.go @@ -16,8 +16,11 @@ import ( "github.com/aws/aws-sdk-go-v2/service/eks/types" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" @@ -59,6 +62,7 @@ func TestAccEKSCluster_basic(t *testing.T) { resource.TestCheckNoResourceAttr(resourceName, "cluster_id"), resource.TestCheckResourceAttr(resourceName, "compute_config.#", "0"), acctest.CheckResourceAttrRFC3339(resourceName, names.AttrCreatedAt), + resource.TestCheckResourceAttr(resourceName, names.AttrDeletionProtection, acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "enabled_cluster_log_types.#", "0"), resource.TestCheckResourceAttr(resourceName, "encryption_config.#", "0"), resource.TestMatchResourceAttr(resourceName, names.AttrEndpoint, regexache.MustCompile(`^https://`)), @@ -1427,6 +1431,56 @@ func TestAccEKSCluster_zonalShiftConfig(t *testing.T) { }) } +func TestAccEKSCluster_deletionProtection(t *testing.T) { + ctx := acctest.Context(t) + var cluster types.Cluster + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_eks_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EKSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterConfig_deletionProtection(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &cluster), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrDeletionProtection), knownvalue.Bool(true)), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"bootstrap_self_managed_addons"}, + }, + { + Config: testAccClusterConfig_deletionProtection(rName, false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &cluster), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrDeletionProtection), knownvalue.Bool(false)), + }, + }, + }, + }) +} + func testAccCheckClusterExists(ctx context.Context, n string, v *types.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -2366,3 +2420,20 @@ resource "aws_eks_cluster" "test" { } `, rName, enabled)) } + +func testAccClusterConfig_deletionProtection(rName string, deletionProtection bool) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` +resource "aws_eks_cluster" "test" { + name = %[1]q + role_arn = aws_iam_role.cluster.arn + + vpc_config { + subnet_ids = aws_subnet.test[*].id + } + + deletion_protection = %[2]t + + depends_on = [aws_iam_role_policy_attachment.cluster_AmazonEKSClusterPolicy] +} +`, rName, deletionProtection)) +} diff --git a/internal/service/eks/service_endpoint_resolver_gen.go b/internal/service/eks/service_endpoint_resolver_gen.go index d215dccbe68a..372cebcfaa0f 100644 --- a/internal/service/eks/service_endpoint_resolver_gen.go +++ b/internal/service/eks/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params eks.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up eks endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up eks endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index 5d220a622583..4d125b13c040 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/eks/service_package_gen.go b/internal/service/eks/service_package_gen.go index d6cfeed8635c..c459528558aa 100644 --- a/internal/service/eks/service_package_gen.go +++ b/internal/service/eks/service_package_gen.go @@ -78,6 +78,7 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*inttypes.Service Factory: dataSourceCluster, TypeName: "aws_eks_cluster", Name: "Cluster", + Tags: unique.Make(inttypes.ServicePackageResourceTags{}), Region: unique.Make(inttypes.ResourceRegionDefault()), }, { diff --git a/internal/service/eks/sweep.go b/internal/service/eks/sweep.go index f3730517dc37..ee8e9f5cf260 100644 --- a/internal/service/eks/sweep.go +++ b/internal/service/eks/sweep.go @@ -6,10 +6,11 @@ package eks import ( "fmt" "log" + "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/eks" - "github.com/aws/aws-sdk-go-v2/service/eks/types" + awstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/errs" @@ -91,7 +92,7 @@ func sweepAddons(region string) error { // There are EKS clusters that are listed (and are in the AWS Console) but can't be found. // ¯\_(ツ)_/¯ - if errs.IsA[*types.ResourceNotFoundException](err) { + if errs.IsA[*awstypes.ResourceNotFoundException](err) { break } @@ -144,6 +145,21 @@ func sweepClusters(region string) error { } for _, v := range page.Clusters { + const ( + timeout = 15 * time.Minute + ) + err := updateClusterDeletionProtection(ctx, conn, v, false, timeout) + + // There are EKS clusters that are listed (and are in the AWS Console) but can't be found. + // ¯\_(ツ)_/¯ + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + continue + } + + if err != nil { + log.Printf("[WARN] Setting EKS Cluster %s DeletionProtection=false: %s", v, err) + } + r := resourceCluster() d := r.Data(nil) d.SetId(v) @@ -201,7 +217,7 @@ func sweepFargateProfiles(region string) error { // There are EKS clusters that are listed (and are in the AWS Console) but can't be found. // ¯\_(ツ)_/¯ - if errs.IsA[*types.ResourceNotFoundException](err) { + if errs.IsA[*awstypes.ResourceNotFoundException](err) { break } @@ -270,7 +286,7 @@ func sweepIdentityProvidersConfig(region string) error { // There are EKS clusters that are listed (and are in the AWS Console) but can't be found. // ¯\_(ツ)_/¯ - if errs.IsA[*types.ResourceNotFoundException](err) { + if errs.IsA[*awstypes.ResourceNotFoundException](err) { break } @@ -339,7 +355,7 @@ func sweepNodeGroups(region string) error { // There are EKS clusters that are listed (and are in the AWS Console) but can't be found. // ¯\_(ツ)_/¯ - if errs.IsA[*types.ResourceNotFoundException](err) { + if errs.IsA[*awstypes.ResourceNotFoundException](err) { break } diff --git a/internal/service/elasticache/global_replication_group.go b/internal/service/elasticache/global_replication_group.go index b2e805f88134..24b50aca3be4 100644 --- a/internal/service/elasticache/global_replication_group.go +++ b/internal/service/elasticache/global_replication_group.go @@ -610,7 +610,7 @@ func deleteGlobalReplicationGroup(ctx context.Context, conn *elasticache.Client, RetainPrimaryReplicationGroup: aws.Bool(true), } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidGlobalReplicationGroupStateFault](ctx, readyTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidGlobalReplicationGroupStateFault](ctx, readyTimeout, func(ctx context.Context) (any, error) { return conn.DeleteGlobalReplicationGroup(ctx, input) }) diff --git a/internal/service/elasticache/parameter_group.go b/internal/service/elasticache/parameter_group.go index 6111d7314859..a13e4addce92 100644 --- a/internal/service/elasticache/parameter_group.go +++ b/internal/service/elasticache/parameter_group.go @@ -293,7 +293,7 @@ func deleteParameterGroup(ctx context.Context, conn *elasticache.Client, name st const ( timeout = 3 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidCacheParameterGroupStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidCacheParameterGroupStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteCacheParameterGroup(ctx, &elasticache.DeleteCacheParameterGroupInput{ CacheParameterGroupName: aws.String(name), }) diff --git a/internal/service/elasticache/replication_group.go b/internal/service/elasticache/replication_group.go index ae9ab41ca949..65658025e898 100644 --- a/internal/service/elasticache/replication_group.go +++ b/internal/service/elasticache/replication_group.go @@ -1082,7 +1082,7 @@ func resourceReplicationGroupDelete(ctx context.Context, d *schema.ResourceData, timeout = 10 * time.Minute // 10 minutes should give any creating/deleting cache clusters or snapshots time to complete. ) log.Printf("[INFO] Deleting ElastiCache Replication Group: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidReplicationGroupStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidReplicationGroupStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteReplicationGroup(ctx, input) }) @@ -1114,7 +1114,7 @@ func disassociateReplicationGroup(ctx context.Context, conn *elasticache.Client, ReplicationGroupRegion: aws.String(region), } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidGlobalReplicationGroupStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidGlobalReplicationGroupStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DisassociateGlobalReplicationGroup(ctx, input) }) diff --git a/internal/service/elasticache/serverless_cache.go b/internal/service/elasticache/serverless_cache.go index 2660b645b23c..3f02c04bb47b 100644 --- a/internal/service/elasticache/serverless_cache.go +++ b/internal/service/elasticache/serverless_cache.go @@ -405,7 +405,7 @@ func (r *serverlessCacheResource) Delete(ctx context.Context, request resource.D FinalSnapshotName: nil, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func(ctx context.Context) (any, error) { return conn.DeleteServerlessCache(ctx, input) }, errCodeDependencyViolation) diff --git a/internal/service/elasticache/service_endpoint_resolver_gen.go b/internal/service/elasticache/service_endpoint_resolver_gen.go index 0107c53b19f2..771c7affed1b 100644 --- a/internal/service/elasticache/service_endpoint_resolver_gen.go +++ b/internal/service/elasticache/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elasticache.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elasticache endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elasticache endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index 423d00fa9f7b..e0d2e0ed9ea0 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elasticache/subnet_group.go b/internal/service/elasticache/subnet_group.go index d9fe8d98dba3..e733ba52e0f4 100644 --- a/internal/service/elasticache/subnet_group.go +++ b/internal/service/elasticache/subnet_group.go @@ -178,7 +178,7 @@ func resourceSubnetGroupDelete(ctx context.Context, d *schema.ResourceData, meta conn := meta.(*conns.AWSClient).ElastiCacheClient(ctx) log.Printf("[DEBUG] Deleting ElastiCache Subnet Group: %s", d.Id()) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func(ctx context.Context) (any, error) { return conn.DeleteCacheSubnetGroup(ctx, &elasticache.DeleteCacheSubnetGroupInput{ CacheSubnetGroupName: aws.String(d.Id()), }) diff --git a/internal/service/elasticache/user_group_association.go b/internal/service/elasticache/user_group_association.go index bf322c7807e2..3c2244ce3431 100644 --- a/internal/service/elasticache/user_group_association.go +++ b/internal/service/elasticache/user_group_association.go @@ -72,7 +72,7 @@ func resourceUserGroupAssociationCreate(ctx context.Context, d *schema.ResourceD UserIdsToAdd: []string{userID}, } - if _, err := tfresource.RetryWhenIsA[*awstypes.InvalidUserGroupStateFault](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + if _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidUserGroupStateFault](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.ModifyUserGroup(ctx, input) }); err != nil { return sdkdiag.AppendErrorf(diags, "creating ElastiCache User Group Association (%s): %s", id, err) @@ -126,7 +126,7 @@ func resourceUserGroupAssociationDelete(ctx context.Context, d *schema.ResourceD userGroupID, userID := parts[0], parts[1] log.Printf("[INFO] Deleting ElastiCache User Group Association: %s", d.Id()) - _, err = tfresource.RetryWhenIsA[*awstypes.InvalidUserGroupStateFault](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.InvalidUserGroupStateFault](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.ModifyUserGroup(ctx, &elasticache.ModifyUserGroupInput{ UserGroupId: aws.String(userGroupID), UserIdsToRemove: []string{userID}, diff --git a/internal/service/elasticbeanstalk/service_endpoint_resolver_gen.go b/internal/service/elasticbeanstalk/service_endpoint_resolver_gen.go index 5d2f46016fab..72ff1e92221e 100644 --- a/internal/service/elasticbeanstalk/service_endpoint_resolver_gen.go +++ b/internal/service/elasticbeanstalk/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elasticbeanstalk }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elasticbeanstalk endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elasticbeanstalk endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index 48386baf9f63..dff0e84a0d46 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elasticsearch/service_endpoint_resolver_gen.go b/internal/service/elasticsearch/service_endpoint_resolver_gen.go index 91b9cc230e39..05ab3e9da32e 100644 --- a/internal/service/elasticsearch/service_endpoint_resolver_gen.go +++ b/internal/service/elasticsearch/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elasticsearchser }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elasticsearchservice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elasticsearchservice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index bc1e2e5ee445..7d0cc7fab10f 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elastictranscoder/service_endpoint_resolver_gen.go b/internal/service/elastictranscoder/service_endpoint_resolver_gen.go index 71db42be00dd..419f022a9b1e 100644 --- a/internal/service/elastictranscoder/service_endpoint_resolver_gen.go +++ b/internal/service/elastictranscoder/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elastictranscode }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elastictranscoder endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elastictranscoder endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 54e8886d3bc9..8cff00b6b376 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elb/attachment.go b/internal/service/elb/attachment.go index 70360dc61cd3..394a39399823 100644 --- a/internal/service/elb/attachment.go +++ b/internal/service/elb/attachment.go @@ -58,7 +58,7 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 10 * time.Minute ) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.RegisterInstancesWithLoadBalancer(ctx, input) }, errCodeInvalidTarget) diff --git a/internal/service/elb/load_balancer.go b/internal/service/elb/load_balancer.go index ba6ce5ceeab9..ccbe81e8b8c4 100644 --- a/internal/service/elb/load_balancer.go +++ b/internal/service/elb/load_balancer.go @@ -304,7 +304,7 @@ func resourceLoadBalancerCreate(ctx context.Context, d *schema.ResourceData, met input.Subnets = flex.ExpandStringValueSet(v.(*schema.Set)) } - _, err = tfresource.RetryWhenIsA[*awstypes.CertificateNotFoundException](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.CertificateNotFoundException](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateLoadBalancer(ctx, input) }) diff --git a/internal/service/elb/service_endpoint_resolver_gen.go b/internal/service/elb/service_endpoint_resolver_gen.go index 4e13fe085f51..c11861da52d5 100644 --- a/internal/service/elb/service_endpoint_resolver_gen.go +++ b/internal/service/elb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elasticloadbalan }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elasticloadbalancing endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elasticloadbalancing endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index 75ac36554e0b..d47362aaa972 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elbv2/listener.go b/internal/service/elbv2/listener.go index b63d24f615ff..d8e20f9233a3 100644 --- a/internal/service/elbv2/listener.go +++ b/internal/service/elbv2/listener.go @@ -765,7 +765,7 @@ func resourceListenerUpdate(ctx context.Context, d *schema.ResourceData, meta an input.SslPolicy = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*awstypes.CertificateNotFoundException](ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.CertificateNotFoundException](ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.ModifyListener(ctx, input) }) @@ -1036,7 +1036,7 @@ func (m listenerAttributeMap) flatten(d *schema.ResourceData, apiObjects []awsty } func retryListenerCreate(ctx context.Context, conn *elasticloadbalancingv2.Client, input *elasticloadbalancingv2.CreateListenerInput, timeout time.Duration) (*elasticloadbalancingv2.CreateListenerOutput, error) { - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.CertificateNotFoundException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.CertificateNotFoundException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateListener(ctx, input) }) diff --git a/internal/service/elbv2/listener_certificate.go b/internal/service/elbv2/listener_certificate.go index e93fb57c16cb..4f64bee58ac8 100644 --- a/internal/service/elbv2/listener_certificate.go +++ b/internal/service/elbv2/listener_certificate.go @@ -67,7 +67,7 @@ func resourceListenerCertificateCreate(ctx context.Context, d *schema.ResourceDa ListenerArn: aws.String(listenerARN), } - _, err := tfresource.RetryWhenIsA[*awstypes.CertificateNotFoundException](ctx, iamPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.CertificateNotFoundException](ctx, iamPropagationTimeout, func(ctx context.Context) (any, error) { return conn.AddListenerCertificates(ctx, input) }) diff --git a/internal/service/elbv2/listener_data_source_tags_gen_test.go b/internal/service/elbv2/listener_data_source_tags_gen_test.go index 293f2afadb48..a26bad7bc195 100644 --- a/internal/service/elbv2/listener_data_source_tags_gen_test.go +++ b/internal/service/elbv2/listener_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccELBV2ListenerDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccELBV2ListenerDataSource_tags(t *testing.T) { func TestAccELBV2ListenerDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccELBV2ListenerDataSource_tags_NullMap(t *testing.T) { func TestAccELBV2ListenerDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccELBV2ListenerDataSource_tags_EmptyMap(t *testing.T) { func TestAccELBV2ListenerDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccELBV2ListenerDataSource_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccELBV2ListenerDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccELBV2ListenerDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccELBV2ListenerDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/listener_identity_gen_test.go b/internal/service/elbv2/listener_identity_gen_test.go index 389ec01e5e2d..6917e6dada8b 100644 --- a/internal/service/elbv2/listener_identity_gen_test.go +++ b/internal/service/elbv2/listener_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccELBV2Listener_Identity_Basic(t *testing.T) { resourceName := "aws_lb_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccELBV2Listener_Identity_RegionOverride(t *testing.T) { resourceName := "aws_lb_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -253,7 +253,7 @@ func TestAccELBV2Listener_Identity_ExistingResource(t *testing.T) { resourceName := "aws_lb_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/elbv2/listener_rule.go b/internal/service/elbv2/listener_rule.go index e83bdf22627b..9f26aca54656 100644 --- a/internal/service/elbv2/listener_rule.go +++ b/internal/service/elbv2/listener_rule.go @@ -729,7 +729,7 @@ func retryListenerRuleCreate(ctx context.Context, conn *elasticloadbalancingv2.C const ( timeout = 5 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.PriorityInUseException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.PriorityInUseException](ctx, timeout, func(ctx context.Context) (any, error) { priority, err := highestListenerRulePriority(ctx, conn, listenerARN) if err != nil { return nil, err diff --git a/internal/service/elbv2/listener_rule_data_source_tags_gen_test.go b/internal/service/elbv2/listener_rule_data_source_tags_gen_test.go index 81c81be003ae..f0f33431e45b 100644 --- a/internal/service/elbv2/listener_rule_data_source_tags_gen_test.go +++ b/internal/service/elbv2/listener_rule_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccELBV2ListenerRuleDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccELBV2ListenerRuleDataSource_tags(t *testing.T) { func TestAccELBV2ListenerRuleDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccELBV2ListenerRuleDataSource_tags_NullMap(t *testing.T) { func TestAccELBV2ListenerRuleDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccELBV2ListenerRuleDataSource_tags_EmptyMap(t *testing.T) { func TestAccELBV2ListenerRuleDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccELBV2ListenerRuleDataSource_tags_DefaultTags_nonOverlapping(t *testi func TestAccELBV2ListenerRuleDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccELBV2ListenerRuleDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccELBV2ListenerRuleDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/listener_rule_identity_gen_test.go b/internal/service/elbv2/listener_rule_identity_gen_test.go index a18f442ec95a..e6d544ae8b09 100644 --- a/internal/service/elbv2/listener_rule_identity_gen_test.go +++ b/internal/service/elbv2/listener_rule_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccELBV2ListenerRule_Identity_Basic(t *testing.T) { resourceName := "aws_lb_listener_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccELBV2ListenerRule_Identity_RegionOverride(t *testing.T) { resourceName := "aws_lb_listener_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -243,7 +243,7 @@ func TestAccELBV2ListenerRule_Identity_ExistingResource(t *testing.T) { resourceName := "aws_lb_listener_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/elbv2/listener_rule_tags_gen_test.go b/internal/service/elbv2/listener_rule_tags_gen_test.go index 6e025fffe809..096b888ba999 100644 --- a/internal/service/elbv2/listener_rule_tags_gen_test.go +++ b/internal/service/elbv2/listener_rule_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccELBV2ListenerRule_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccELBV2ListenerRule_tags(t *testing.T) { func TestAccELBV2ListenerRule_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccELBV2ListenerRule_tags_null(t *testing.T) { func TestAccELBV2ListenerRule_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccELBV2ListenerRule_tags_EmptyMap(t *testing.T) { func TestAccELBV2ListenerRule_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccELBV2ListenerRule_tags_AddOnUpdate(t *testing.T) { func TestAccELBV2ListenerRule_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccELBV2ListenerRule_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccELBV2ListenerRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccELBV2ListenerRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2ListenerRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccELBV2ListenerRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2ListenerRule_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccELBV2ListenerRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccELBV2ListenerRule_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_overlapping(t *testing.T) { func TestAccELBV2ListenerRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccELBV2ListenerRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccELBV2ListenerRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccELBV2ListenerRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccELBV2ListenerRule_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccELBV2ListenerRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccELBV2ListenerRule_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccELBV2ListenerRule_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccELBV2ListenerRule_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccELBV2ListenerRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccELBV2ListenerRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2ListenerRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccELBV2ListenerRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2ListenerRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccELBV2ListenerRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccELBV2ListenerRule_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Rule resourceName := "aws_lb_listener_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/listener_tags_gen_test.go b/internal/service/elbv2/listener_tags_gen_test.go index 3d5faa8ee156..2ff29152d0de 100644 --- a/internal/service/elbv2/listener_tags_gen_test.go +++ b/internal/service/elbv2/listener_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccELBV2Listener_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccELBV2Listener_tags(t *testing.T) { func TestAccELBV2Listener_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccELBV2Listener_tags_null(t *testing.T) { func TestAccELBV2Listener_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccELBV2Listener_tags_EmptyMap(t *testing.T) { func TestAccELBV2Listener_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccELBV2Listener_tags_AddOnUpdate(t *testing.T) { func TestAccELBV2Listener_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccELBV2Listener_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccELBV2Listener_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccELBV2Listener_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2Listener_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccELBV2Listener_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccELBV2Listener_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccELBV2Listener_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccELBV2Listener_tags_DefaultTags_overlapping(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccELBV2Listener_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccELBV2Listener_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccELBV2Listener_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccELBV2Listener_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccELBV2Listener_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccELBV2Listener_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccELBV2Listener_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccELBV2Listener_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccELBV2Listener_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccELBV2Listener_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccELBV2Listener_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccELBV2Listener_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2Listener_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccELBV2Listener_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2Listener_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccELBV2Listener_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccELBV2Listener_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Listener resourceName := "aws_lb_listener.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/load_balancer_data_source_tags_gen_test.go b/internal/service/elbv2/load_balancer_data_source_tags_gen_test.go index b778f6fcdcb6..2badaf98faf7 100644 --- a/internal/service/elbv2/load_balancer_data_source_tags_gen_test.go +++ b/internal/service/elbv2/load_balancer_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccELBV2LoadBalancerDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccELBV2LoadBalancerDataSource_tags(t *testing.T) { func TestAccELBV2LoadBalancerDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccELBV2LoadBalancerDataSource_tags_NullMap(t *testing.T) { func TestAccELBV2LoadBalancerDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccELBV2LoadBalancerDataSource_tags_EmptyMap(t *testing.T) { func TestAccELBV2LoadBalancerDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccELBV2LoadBalancerDataSource_tags_DefaultTags_nonOverlapping(t *testi func TestAccELBV2LoadBalancerDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccELBV2LoadBalancerDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccELBV2LoadBalancerDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/load_balancer_identity_gen_test.go b/internal/service/elbv2/load_balancer_identity_gen_test.go index cca9aa98d565..385f59de65e2 100644 --- a/internal/service/elbv2/load_balancer_identity_gen_test.go +++ b/internal/service/elbv2/load_balancer_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccELBV2LoadBalancer_Identity_Basic(t *testing.T) { resourceName := "aws_lb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccELBV2LoadBalancer_Identity_RegionOverride(t *testing.T) { resourceName := "aws_lb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccELBV2LoadBalancer_Identity_ExistingResource(t *testing.T) { resourceName := "aws_lb.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/elbv2/load_balancer_tags_gen_test.go b/internal/service/elbv2/load_balancer_tags_gen_test.go index ef4d564bb693..6db23afc916d 100644 --- a/internal/service/elbv2/load_balancer_tags_gen_test.go +++ b/internal/service/elbv2/load_balancer_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccELBV2LoadBalancer_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccELBV2LoadBalancer_tags(t *testing.T) { func TestAccELBV2LoadBalancer_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccELBV2LoadBalancer_tags_null(t *testing.T) { func TestAccELBV2LoadBalancer_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccELBV2LoadBalancer_tags_EmptyMap(t *testing.T) { func TestAccELBV2LoadBalancer_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccELBV2LoadBalancer_tags_AddOnUpdate(t *testing.T) { func TestAccELBV2LoadBalancer_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccELBV2LoadBalancer_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccELBV2LoadBalancer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccELBV2LoadBalancer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2LoadBalancer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccELBV2LoadBalancer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2LoadBalancer_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccELBV2LoadBalancer_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccELBV2LoadBalancer_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_overlapping(t *testing.T) { func TestAccELBV2LoadBalancer_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccELBV2LoadBalancer_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccELBV2LoadBalancer_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccELBV2LoadBalancer_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccELBV2LoadBalancer_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccELBV2LoadBalancer_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccELBV2LoadBalancer_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccELBV2LoadBalancer_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccELBV2LoadBalancer_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccELBV2LoadBalancer_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccELBV2LoadBalancer_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2LoadBalancer_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccELBV2LoadBalancer_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2LoadBalancer_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccELBV2LoadBalancer_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccELBV2LoadBalancer_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.LoadBalancer resourceName := "aws_lb.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/service_endpoint_resolver_gen.go b/internal/service/elbv2/service_endpoint_resolver_gen.go index aef72ee0d25e..c59a5bea6b83 100644 --- a/internal/service/elbv2/service_endpoint_resolver_gen.go +++ b/internal/service/elbv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params elasticloadbalan }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up elasticloadbalancingv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up elasticloadbalancingv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 63199ce5fba4..ea274b8452b1 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/elbv2/target_group_attachment.go b/internal/service/elbv2/target_group_attachment.go index ff95ecf365fd..2cb45a2ad2e9 100644 --- a/internal/service/elbv2/target_group_attachment.go +++ b/internal/service/elbv2/target_group_attachment.go @@ -79,7 +79,7 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 10 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidTargetException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidTargetException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.RegisterTargets(ctx, input) }) diff --git a/internal/service/elbv2/target_group_data_source_tags_gen_test.go b/internal/service/elbv2/target_group_data_source_tags_gen_test.go index a1f806f55dda..2ef2c120cedd 100644 --- a/internal/service/elbv2/target_group_data_source_tags_gen_test.go +++ b/internal/service/elbv2/target_group_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { func TestAccELBV2TargetGroupDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccELBV2TargetGroupDataSource_tags_NullMap(t *testing.T) { func TestAccELBV2TargetGroupDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccELBV2TargetGroupDataSource_tags_EmptyMap(t *testing.T) { func TestAccELBV2TargetGroupDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccELBV2TargetGroupDataSource_tags_DefaultTags_nonOverlapping(t *testin func TestAccELBV2TargetGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccELBV2TargetGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *tes func TestAccELBV2TargetGroupDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/target_group_identity_gen_test.go b/internal/service/elbv2/target_group_identity_gen_test.go index 1f6cc8117254..a60236081192 100644 --- a/internal/service/elbv2/target_group_identity_gen_test.go +++ b/internal/service/elbv2/target_group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccELBV2TargetGroup_Identity_Basic(t *testing.T) { resourceName := "aws_lb_target_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -115,7 +115,7 @@ func TestAccELBV2TargetGroup_Identity_RegionOverride(t *testing.T) { resourceName := "aws_lb_target_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -243,7 +243,7 @@ func TestAccELBV2TargetGroup_Identity_ExistingResource(t *testing.T) { resourceName := "aws_lb_target_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/elbv2/target_group_tags_gen_test.go b/internal/service/elbv2/target_group_tags_gen_test.go index 017ca1bb0656..b01c2780afb6 100644 --- a/internal/service/elbv2/target_group_tags_gen_test.go +++ b/internal/service/elbv2/target_group_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccELBV2TargetGroup_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccELBV2TargetGroup_tags(t *testing.T) { func TestAccELBV2TargetGroup_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccELBV2TargetGroup_tags_null(t *testing.T) { func TestAccELBV2TargetGroup_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccELBV2TargetGroup_tags_EmptyMap(t *testing.T) { func TestAccELBV2TargetGroup_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccELBV2TargetGroup_tags_AddOnUpdate(t *testing.T) { func TestAccELBV2TargetGroup_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccELBV2TargetGroup_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccELBV2TargetGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccELBV2TargetGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2TargetGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccELBV2TargetGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2TargetGroup_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccELBV2TargetGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccELBV2TargetGroup_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_overlapping(t *testing.T) { func TestAccELBV2TargetGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccELBV2TargetGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccELBV2TargetGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccELBV2TargetGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccELBV2TargetGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccELBV2TargetGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccELBV2TargetGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccELBV2TargetGroup_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccELBV2TargetGroup_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccELBV2TargetGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccELBV2TargetGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2TargetGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccELBV2TargetGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2TargetGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccELBV2TargetGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccELBV2TargetGroup_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TargetGroup resourceName := "aws_lb_target_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/elbv2/trust_store_identity_gen_test.go b/internal/service/elbv2/trust_store_identity_gen_test.go index bdb185776958..3e33de1a0c81 100644 --- a/internal/service/elbv2/trust_store_identity_gen_test.go +++ b/internal/service/elbv2/trust_store_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccELBV2TrustStore_Identity_Basic(t *testing.T) { resourceName := "aws_lb_trust_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccELBV2TrustStore_Identity_RegionOverride(t *testing.T) { resourceName := "aws_lb_trust_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -253,7 +253,7 @@ func TestAccELBV2TrustStore_Identity_ExistingResource(t *testing.T) { resourceName := "aws_lb_trust_store.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/elbv2/trust_store_tags_gen_test.go b/internal/service/elbv2/trust_store_tags_gen_test.go index 308f26eeb091..bfba0c37dd97 100644 --- a/internal/service/elbv2/trust_store_tags_gen_test.go +++ b/internal/service/elbv2/trust_store_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccELBV2TrustStore_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccELBV2TrustStore_tags(t *testing.T) { func TestAccELBV2TrustStore_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccELBV2TrustStore_tags_null(t *testing.T) { func TestAccELBV2TrustStore_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccELBV2TrustStore_tags_EmptyMap(t *testing.T) { func TestAccELBV2TrustStore_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccELBV2TrustStore_tags_AddOnUpdate(t *testing.T) { func TestAccELBV2TrustStore_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccELBV2TrustStore_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccELBV2TrustStore_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccELBV2TrustStore_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2TrustStore_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccELBV2TrustStore_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2TrustStore_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccELBV2TrustStore_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccELBV2TrustStore_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_overlapping(t *testing.T) { func TestAccELBV2TrustStore_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccELBV2TrustStore_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccELBV2TrustStore_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccELBV2TrustStore_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccELBV2TrustStore_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_nullOverlappingResourceTag(t *testi func TestAccELBV2TrustStore_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccELBV2TrustStore_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func TestAccELBV2TrustStore_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccELBV2TrustStore_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccELBV2TrustStore_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccELBV2TrustStore_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccELBV2TrustStore_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccELBV2TrustStore_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccELBV2TrustStore_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccELBV2TrustStore_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccELBV2TrustStore_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.TrustStore resourceName := "aws_lb_trust_store.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/emr/cluster_test.go b/internal/service/emr/cluster_test.go index e3c3d920cee8..2761c164ca60 100644 --- a/internal/service/emr/cluster_test.go +++ b/internal/service/emr/cluster_test.go @@ -1293,56 +1293,6 @@ func TestAccEMRCluster_keepJob(t *testing.T) { }) } -func TestAccEMRCluster_visibleToAllUsers(t *testing.T) { - ctx := acctest.Context(t) - var cluster awstypes.Cluster - - resourceName := "aws_emr_cluster.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.EMRServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", acctest.CtTrue), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccClusterConfig_visibleToAllUsersUpdated(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", acctest.CtFalse), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - func TestAccEMRCluster_s3Logging(t *testing.T) { ctx := acctest.Context(t) var cluster awstypes.Cluster @@ -3664,61 +3614,6 @@ resource "aws_emr_cluster" "test" { `, rName, keepJob)) } -func testAccClusterConfig_visibleToAllUsersUpdated(rName string) string { - return acctest.ConfigCompose( - testAccClusterConfig_baseVPC(rName, false), - testAccClusterConfig_baseIAMServiceRole(rName), - testAccClusterConfig_baseIAMInstanceProfile(rName), - testAccClusterConfig_baseIAMAutoScalingRole(rName), - fmt.Sprintf(` -data "aws_partition" "current" {} - -resource "aws_emr_cluster" "test" { - name = %[1]q - release_label = "emr-4.6.0" - applications = ["Spark"] - - ec2_attributes { - subnet_id = aws_subnet.test.id - emr_managed_master_security_group = aws_security_group.test.id - emr_managed_slave_security_group = aws_security_group.test.id - instance_profile = aws_iam_instance_profile.emr_instance_profile.arn - } - - master_instance_group { - instance_type = "c4.large" - } - - core_instance_group { - instance_count = 1 - instance_type = "c4.large" - } - - tags = { - role = "rolename" - dns_zone = "env_zone" - env = "env" - name = "name-env" - } - - keep_job_flow_alive_when_no_steps = true - visible_to_all_users = false - - configurations = "test-fixtures/emr_configurations.json" - - depends_on = [ - aws_route_table_association.test, - aws_iam_role_policy_attachment.emr_service, - aws_iam_role_policy_attachment.emr_instance_profile, - aws_iam_role_policy_attachment.emr_autoscaling_role, - ] - - service_role = aws_iam_role.emr_service.arn - autoscaling_role = aws_iam_role.emr_autoscaling_role.arn -} -`, rName)) -} - func testAccClusterConfig_s3Logging(rName string) string { return acctest.ConfigCompose( testAccClusterConfig_baseVPC(rName, false), diff --git a/internal/service/emr/service_endpoint_resolver_gen.go b/internal/service/emr/service_endpoint_resolver_gen.go index 843bfa64b188..4544e986be8f 100644 --- a/internal/service/emr/service_endpoint_resolver_gen.go +++ b/internal/service/emr/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params emr.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up emr endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up emr endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index fde41e3a8e04..639fef8506ae 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/emrcontainers/service_endpoint_resolver_gen.go b/internal/service/emrcontainers/service_endpoint_resolver_gen.go index 3e8dbe529d8e..884d6f9a3b51 100644 --- a/internal/service/emrcontainers/service_endpoint_resolver_gen.go +++ b/internal/service/emrcontainers/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params emrcontainers.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up emrcontainers endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up emrcontainers endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index c70ff2c7c17a..50892d8759df 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/emrserverless/service_endpoint_resolver_gen.go b/internal/service/emrserverless/service_endpoint_resolver_gen.go index b0171333e239..46b49e0af8b3 100644 --- a/internal/service/emrserverless/service_endpoint_resolver_gen.go +++ b/internal/service/emrserverless/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params emrserverless.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up emrserverless endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up emrserverless endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index 76f584825dc6..239e483080b8 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/events/endpoint.go b/internal/service/events/endpoint.go index efeeabab37e2..61e256162675 100644 --- a/internal/service/events/endpoint.go +++ b/internal/service/events/endpoint.go @@ -167,7 +167,7 @@ func resourceEndpointCreate(ctx context.Context, d *schema.ResourceData, meta an input.RoleArn = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateEndpoint(ctx, input) }, errCodeValidationException, "cannot be assumed by principal") diff --git a/internal/service/events/generate.go b/internal/service/events/generate.go index 859b9818afde..61fecb3cb47b 100644 --- a/internal/service/events/generate.go +++ b/internal/service/events/generate.go @@ -4,6 +4,7 @@ //go:generate go run ../../generate/listpages/main.go -ListOps=ListApiDestinations,ListArchives,ListConnections,ListEventBuses,ListEventSources,ListRules,ListTargetsByRule //go:generate go run ../../generate/tags/main.go -ListTags -ListTagsInIDElem=ResourceARN -ServiceTagsSlice -TagInIDElem=ResourceARN -UpdateTags -CreateTags //go:generate go run ../../generate/servicepackage/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package events diff --git a/internal/service/events/rule.go b/internal/service/events/rule.go index ab027507797f..efd98c596229 100644 --- a/internal/service/events/rule.go +++ b/internal/service/events/rule.go @@ -33,6 +33,9 @@ import ( // @SDKResource("aws_cloudwatch_event_rule", name="Rule") // @Tags(identifierAttribute="arn") +// @IdentityAttribute("name") +// @Testing(preIdentityVersion="v6.7.0") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/eventbridge;eventbridge.DescribeRuleOutput") func resourceRule() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceRuleCreate, @@ -40,10 +43,6 @@ func resourceRule() *schema.Resource { UpdateWithoutTimeout: resourceRuleUpdate, DeleteWithoutTimeout: resourceRuleDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, StateUpgraders: []schema.StateUpgrader{ { @@ -300,7 +299,7 @@ func resourceRuleDelete(ctx context.Context, d *schema.ResourceData, meta any) d timeout = 5 * time.Minute ) log.Printf("[DEBUG] Deleting EventBridge Rule: %s", d.Id()) - _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, timeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteRule(ctx, input) }, errCodeValidationException, "Rule can't be deleted since it has targets") @@ -316,7 +315,7 @@ func resourceRuleDelete(ctx context.Context, d *schema.ResourceData, meta any) d } func retryPutRule(ctx context.Context, conn *eventbridge.Client, input *eventbridge.PutRuleInput) (string, error) { - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.PutRule(ctx, input) }, errCodeValidationException, "cannot be assumed by principal") diff --git a/internal/service/events/rule_identity_gen_test.go b/internal/service/events/rule_identity_gen_test.go new file mode 100644 index 000000000000..804026fdcaac --- /dev/null +++ b/internal/service/events/rule_identity_gen_test.go @@ -0,0 +1,251 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package events_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/eventbridge" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccEventsRule_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v eventbridge.DescribeRuleOutput + resourceName := "aws_cloudwatch_event_rule.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EventsServiceID), + CheckDestroy: testAccCheckRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRuleExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccEventsRule_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_cloudwatch_event_rule.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EventsServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccEventsRule_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v eventbridge.DescribeRuleOutput + resourceName := "aws_cloudwatch_event_rule.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EventsServiceID), + CheckDestroy: testAccCheckRuleDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRuleExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Rule/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + }, + }) +} diff --git a/internal/service/events/service_endpoint_resolver_gen.go b/internal/service/events/service_endpoint_resolver_gen.go index cc56d8d1edd2..40bb04a36242 100644 --- a/internal/service/events/service_endpoint_resolver_gen.go +++ b/internal/service/events/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params eventbridge.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up eventbridge endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up eventbridge endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index e59fed1a4d41..23cadc5a298b 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/events/service_package_gen.go b/internal/service/events/service_package_gen.go index 507963e9a56d..ada7dc3fa050 100644 --- a/internal/service/events/service_package_gen.go +++ b/internal/service/events/service_package_gen.go @@ -110,7 +110,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Tags: unique.Make(inttypes.ServicePackageResourceTags{ IdentifierAttribute: names.AttrARN, }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity(names.AttrName), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceTarget, diff --git a/internal/service/events/testdata/Rule/basic/main_gen.tf b/internal/service/events/testdata/Rule/basic/main_gen.tf new file mode 100644 index 000000000000..eb4efbf1045e --- /dev/null +++ b/internal/service/events/testdata/Rule/basic/main_gen.tf @@ -0,0 +1,13 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_event_rule" "test" { + name = var.rName + schedule_expression = "rate(1 hour)" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/events/testdata/Rule/basic_v6.7.0/main_gen.tf b/internal/service/events/testdata/Rule/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..acdd22dc8c42 --- /dev/null +++ b/internal/service/events/testdata/Rule/basic_v6.7.0/main_gen.tf @@ -0,0 +1,23 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_event_rule" "test" { + name = var.rName + schedule_expression = "rate(1 hour)" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/events/testdata/Rule/region_override/main_gen.tf b/internal/service/events/testdata/Rule/region_override/main_gen.tf new file mode 100644 index 000000000000..bd34d4d86196 --- /dev/null +++ b/internal/service/events/testdata/Rule/region_override/main_gen.tf @@ -0,0 +1,21 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_cloudwatch_event_rule" "test" { + region = var.region + + name = var.rName + schedule_expression = "rate(1 hour)" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/events/testdata/tmpl/rule_tags.gtpl b/internal/service/events/testdata/tmpl/rule_tags.gtpl new file mode 100644 index 000000000000..de7064c5419f --- /dev/null +++ b/internal/service/events/testdata/tmpl/rule_tags.gtpl @@ -0,0 +1,6 @@ +resource "aws_cloudwatch_event_rule" "test" { +{{- template "region" }} + name = var.rName + schedule_expression = "rate(1 hour)" +{{- template "tags" }} +} diff --git a/internal/service/evidently/service_endpoint_resolver_gen.go b/internal/service/evidently/service_endpoint_resolver_gen.go index efe21cf9bf57..8d6e1ea99011 100644 --- a/internal/service/evidently/service_endpoint_resolver_gen.go +++ b/internal/service/evidently/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params evidently.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up evidently endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up evidently endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index 6e07735dcaa2..8627774293b1 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/evs/service_endpoint_resolver_gen.go b/internal/service/evs/service_endpoint_resolver_gen.go index 76c972cc60a5..e8b90109066b 100644 --- a/internal/service/evs/service_endpoint_resolver_gen.go +++ b/internal/service/evs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params evs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up evs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up evs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/evs/service_endpoints_gen_test.go b/internal/service/evs/service_endpoints_gen_test.go index a91c5455a20c..742da57609e6 100644 --- a/internal/service/evs/service_endpoints_gen_test.go +++ b/internal/service/evs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/finspace/kx_volume.go b/internal/service/finspace/kx_volume.go index 64234ca88835..5b24a999a2ec 100644 --- a/internal/service/finspace/kx_volume.go +++ b/internal/service/finspace/kx_volume.go @@ -243,7 +243,7 @@ func resourceKxVolumeRead(ctx context.Context, d *schema.ResourceData, meta any) d.Set(names.AttrDescription, out.Description) d.Set("created_timestamp", out.CreatedTimestamp.String()) d.Set("last_modified_timestamp", out.LastModifiedTimestamp.String()) - d.Set(names.AttrAvailabilityZones, aws.StringSlice(out.AvailabilityZoneIds)) + d.Set(names.AttrAvailabilityZones, out.AvailabilityZoneIds) if err := d.Set("nas1_configuration", flattenNas1Configuration(out.Nas1Configuration)); err != nil { return create.AppendDiagError(diags, names.FinSpace, create.ErrActionSetting, ResNameKxVolume, d.Id(), err) diff --git a/internal/service/finspace/service_endpoint_resolver_gen.go b/internal/service/finspace/service_endpoint_resolver_gen.go index 1080bd32b970..a190cd2a7fdd 100644 --- a/internal/service/finspace/service_endpoint_resolver_gen.go +++ b/internal/service/finspace/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params finspace.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up finspace endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up finspace endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index 9ddc47c151e4..dba751ffd761 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 99b3bd02440e..0443e77dd5ea 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -858,6 +858,12 @@ func resourceDeliveryStream() *schema.Resource { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "append_only": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "buffering_interval": { Type: schema.TypeInt, Optional: true, @@ -2543,6 +2549,10 @@ func expandIcebergDestinationConfiguration(tfMap map[string]any) *types.IcebergD S3Configuration: expandS3DestinationConfiguration(tfMap["s3_configuration"].([]any)), } + if v, ok := tfMap["append_only"].(bool); ok && v { + apiObject.AppendOnly = aws.Bool(v) + } + if _, ok := tfMap["cloudwatch_logging_options"]; ok { apiObject.CloudWatchLoggingOptions = expandCloudWatchLoggingOptions(tfMap) } @@ -2576,6 +2586,10 @@ func expandIcebergDestinationUpdate(tfMap map[string]any) *types.IcebergDestinat RoleARN: aws.String(roleARN), } + if v, ok := tfMap["append_only"].(bool); ok && v { + apiObject.AppendOnly = aws.Bool(v) + } + if catalogARN, ok := tfMap["catalog_arn"].(string); ok { apiObject.CatalogConfiguration = &types.CatalogConfiguration{ CatalogARN: aws.String(catalogARN), @@ -4243,6 +4257,7 @@ func flattenIcebergDestinationDescription(apiObject *types.IcebergDestinationDes } tfMap := map[string]any{ + "append_only": aws.ToBool(apiObject.AppendOnly), "catalog_arn": aws.ToString(apiObject.CatalogConfiguration.CatalogARN), "s3_configuration": flattenS3DestinationDescription(apiObject.S3DestinationDescription), names.AttrRoleARN: aws.ToString(apiObject.RoleARN), diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index e0528bd75171..f880078bd0cd 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -16,6 +16,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/lambda" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" @@ -1054,6 +1055,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3_readFromTimestamp(t *testing.T) { } func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { + // In main test account: // "InvalidArgumentException: Role ... is not authorized to perform: glue:GetTable for the given table or the table does not exist." acctest.Skip(t, "Unresolvable Glue permission issue") @@ -1076,6 +1078,7 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.role_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.bucket_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.role_arn"), + resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.append_only", acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_interval", "300"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_size", "5"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.cloudwatch_logging_options.#", "1"), @@ -1090,6 +1093,11 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.retry_options.#", "0"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.s3_backup_mode", "FailedDataOnly"), ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, }, { ResourceName: resourceName, @@ -1104,6 +1112,7 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.role_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.bucket_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.role_arn"), + resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.append_only", acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_interval", "900"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_size", "100"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.cloudwatch_logging_options.#", "1"), @@ -1117,6 +1126,11 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.processing_configuration.0.enabled", acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.s3_backup_mode.#", "0"), ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, }, { Config: testAccDeliveryStream_icebergUpdatesMetadataProcessor(rName), @@ -1126,6 +1140,7 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.role_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.bucket_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.role_arn"), + resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.append_only", acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_interval", "300"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_size", "5"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.cloudwatch_logging_options.#", "1"), @@ -1152,6 +1167,11 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.retry_options.#", "0"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.s3_backup_mode", "FailedDataOnly"), ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, }, { Config: testAccDeliveryStream_icebergUpdatesLambdaProcessor(rName), @@ -1160,6 +1180,7 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.role_arn"), resource.TestCheckResourceAttrSet(resourceName, "iceberg_configuration.0.s3_configuration.0.bucket_arn"), + resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.append_only", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_interval", "300"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.buffering_size", "5"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.cloudwatch_logging_options.#", "1"), @@ -1183,6 +1204,64 @@ func TestAccFirehoseDeliveryStream_icebergUpdates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.retry_options.#", "0"), resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.s3_backup_mode.#", "0"), ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), // Changes to destination_table_configuration and append_only + }, + }, + }, + }, + }) +} + +func TestAccFirehoseDeliveryStream_icebergUpgradeV6_7_0(t *testing.T) { + // In main test account: + // "InvalidArgumentException: Role ... is not authorized to perform: glue:GetTable for the given table or the table does not exist." + acctest.Skip(t, "Unresolvable Glue permission issue") + + ctx := acctest.Context(t) + var stream types.DeliveryStreamDescription + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_kinesis_firehose_delivery_stream.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.FirehoseServiceID), + CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "6.7.0", + }, + }, + Config: testAccDeliveryStream_iceberg(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), + resource.TestCheckNoResourceAttr(resourceName, "iceberg_configuration.0.append_only"), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccDeliveryStream_iceberg(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), + resource.TestCheckResourceAttr(resourceName, "iceberg_configuration.0.append_only", acctest.CtFalse), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, }, }, }) @@ -4284,6 +4363,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn s3_backup_mode = "FailedDataOnly" catalog_arn = "arn:${data.aws_partition.current.partition}:glue:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:catalog" + append_only = true s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn diff --git a/internal/service/firehose/service_endpoint_resolver_gen.go b/internal/service/firehose/service_endpoint_resolver_gen.go index 87ec0ff2b925..1ec4e83c7dc0 100644 --- a/internal/service/firehose/service_endpoint_resolver_gen.go +++ b/internal/service/firehose/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params firehose.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up firehose endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up firehose endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index 59f9b0eca523..a5e5a5925cd0 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/fis/service_endpoint_resolver_gen.go b/internal/service/fis/service_endpoint_resolver_gen.go index c989684206d9..4fd579bf8bae 100644 --- a/internal/service/fis/service_endpoint_resolver_gen.go +++ b/internal/service/fis/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params fis.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up fis endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up fis endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index 0f8d323b12be..988e8557ed24 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/fms/policy.go b/internal/service/fms/policy.go index 30738fd23bff..bb7d9abeb619 100644 --- a/internal/service/fms/policy.go +++ b/internal/service/fms/policy.go @@ -334,7 +334,7 @@ func resourcePolicyCreate(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 1 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InternalErrorException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InternalErrorException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.PutPolicy(ctx, input) }) @@ -412,7 +412,7 @@ func resourcePolicyUpdate(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 1 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InternalErrorException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InternalErrorException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.PutPolicy(ctx, input) }) diff --git a/internal/service/fms/policy_tags_gen_test.go b/internal/service/fms/policy_tags_gen_test.go index 0fc70613262f..818779db6075 100644 --- a/internal/service/fms/policy_tags_gen_test.go +++ b/internal/service/fms/policy_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccFMSPolicy_tagsSerial(t *testing.T) { func testAccFMSPolicy_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -239,6 +240,7 @@ func testAccFMSPolicy_tags(t *testing.T) { func testAccFMSPolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -308,6 +310,7 @@ func testAccFMSPolicy_tags_null(t *testing.T) { func testAccFMSPolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -373,6 +376,7 @@ func testAccFMSPolicy_tags_EmptyMap(t *testing.T) { func testAccFMSPolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -456,6 +460,7 @@ func testAccFMSPolicy_tags_AddOnUpdate(t *testing.T) { func testAccFMSPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -550,6 +555,7 @@ func testAccFMSPolicy_tags_EmptyTag_OnCreate(t *testing.T) { func testAccFMSPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -692,6 +698,7 @@ func testAccFMSPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccFMSPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -783,6 +790,7 @@ func testAccFMSPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -975,6 +983,7 @@ func testAccFMSPolicy_tags_DefaultTags_providerOnly(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1143,6 +1152,7 @@ func testAccFMSPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1327,6 +1337,7 @@ func testAccFMSPolicy_tags_DefaultTags_overlapping(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1419,6 +1430,7 @@ func testAccFMSPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1510,6 +1522,7 @@ func testAccFMSPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1577,6 +1590,7 @@ func testAccFMSPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1636,6 +1650,7 @@ func testAccFMSPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccFMSPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1700,6 +1715,7 @@ func testAccFMSPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func testAccFMSPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1764,6 +1780,7 @@ func testAccFMSPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. func testAccFMSPolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1821,6 +1838,7 @@ func testAccFMSPolicy_tags_ComputedTag_OnCreate(t *testing.T) { func testAccFMSPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1920,6 +1938,7 @@ func testAccFMSPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccFMSPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2009,6 +2028,7 @@ func testAccFMSPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccFMSPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2170,6 +2190,7 @@ func testAccFMSPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccFMSPolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_fms_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/fms/resource_set_tags_gen_test.go b/internal/service/fms/resource_set_tags_gen_test.go index 2359a54301ef..58971f3d45e3 100644 --- a/internal/service/fms/resource_set_tags_gen_test.go +++ b/internal/service/fms/resource_set_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccFMSResourceSet_tagsSerial(t *testing.T) { func testAccFMSResourceSet_tags(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccFMSResourceSet_tags(t *testing.T) { func testAccFMSResourceSet_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -291,6 +293,7 @@ func testAccFMSResourceSet_tags_null(t *testing.T) { func testAccFMSResourceSet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -341,6 +344,7 @@ func testAccFMSResourceSet_tags_EmptyMap(t *testing.T) { func testAccFMSResourceSet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -421,6 +425,7 @@ func testAccFMSResourceSet_tags_AddOnUpdate(t *testing.T) { func testAccFMSResourceSet_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -511,6 +516,7 @@ func testAccFMSResourceSet_tags_EmptyTag_OnCreate(t *testing.T) { func testAccFMSResourceSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -650,6 +656,7 @@ func testAccFMSResourceSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccFMSResourceSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -740,6 +747,7 @@ func testAccFMSResourceSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -921,6 +929,7 @@ func testAccFMSResourceSet_tags_DefaultTags_providerOnly(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1081,6 +1090,7 @@ func testAccFMSResourceSet_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1257,6 +1267,7 @@ func testAccFMSResourceSet_tags_DefaultTags_overlapping(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1347,6 +1358,7 @@ func testAccFMSResourceSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1436,6 +1448,7 @@ func testAccFMSResourceSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1502,6 +1515,7 @@ func testAccFMSResourceSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1560,6 +1574,7 @@ func testAccFMSResourceSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccFMSResourceSet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1629,6 +1644,7 @@ func testAccFMSResourceSet_tags_DefaultTags_nullOverlappingResourceTag(t *testin func testAccFMSResourceSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1700,6 +1716,7 @@ func testAccFMSResourceSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func testAccFMSResourceSet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1755,6 +1772,7 @@ func testAccFMSResourceSet_tags_ComputedTag_OnCreate(t *testing.T) { func testAccFMSResourceSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1852,6 +1870,7 @@ func testAccFMSResourceSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccFMSResourceSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1939,6 +1958,7 @@ func testAccFMSResourceSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccFMSResourceSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2101,6 +2121,7 @@ func testAccFMSResourceSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccFMSResourceSet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v fms.GetResourceSetOutput resourceName := "aws_fms_resource_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/fms/service_endpoint_resolver_gen.go b/internal/service/fms/service_endpoint_resolver_gen.go index 39ff48b9224b..3d4467814e4c 100644 --- a/internal/service/fms/service_endpoint_resolver_gen.go +++ b/internal/service/fms/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params fms.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up fms endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up fms endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index 3b461b6f7488..fd1bfff38dad 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/fsx/lustre_file_system.go b/internal/service/fsx/lustre_file_system.go index a2b617a4bf83..fb23b3514ce3 100644 --- a/internal/service/fsx/lustre_file_system.go +++ b/internal/service/fsx/lustre_file_system.go @@ -108,9 +108,8 @@ func resourceLustreFileSystem() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ names.AttrSize: { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validation.IntBetween(32, 131072), + Type: schema.TypeInt, + Optional: true, }, "sizing_mode": { Type: schema.TypeString, @@ -343,6 +342,7 @@ func resourceLustreFileSystem() *schema.Resource { CustomizeDiff: customdiff.Sequence( resourceLustreFileSystemStorageCapacityCustomizeDiff, resourceLustreFileSystemMetadataConfigCustomizeDiff, + resourceLustreFileSystemDataReadCacheConfigurationCustomizeDiff, ), } } @@ -405,6 +405,34 @@ func resourceLustreFileSystemMetadataConfigCustomizeDiff(_ context.Context, d *s return nil } +func resourceLustreFileSystemDataReadCacheConfigurationCustomizeDiff(_ context.Context, d *schema.ResourceDiff, meta any) error { + if v, ok := d.Get(names.AttrStorageType).(string); ok && v == string(awstypes.StorageTypeIntelligentTiering) { + var throughputCapacity int + if v, ok := d.Get("throughput_capacity").(int); ok && v != 0 { + throughputCapacity = v + } else { + return fmt.Errorf("Validation Error: ThroughputCapacity is a required parameter for Lustre file systems with StorageType %s", awstypes.StorageTypeIntelligentTiering) + } + + if v, ok := d.Get("data_read_cache_configuration").([]any); ok && len(v) > 0 && v[0] != nil { + config := v[0].(map[string]any) + + if sizingMode, ok := config["sizing_mode"].(string); ok && sizingMode == string(awstypes.LustreReadCacheSizingModeUserProvisioned) { + if size, ok := config[names.AttrSize].(int); ok && size > 0 { + factor := throughputCapacity / 4000 + minSize := 32 * factor + maxSize := 131072 * factor + if size < minSize || size > maxSize { + return fmt.Errorf("File systems with throughput capacity of %d MB/s support a minimum read cache size of %d GiB and maximum read cache size of %d GiB", throughputCapacity, minSize, maxSize) + } + } + } + } + } + + return nil +} + func resourceLustreFileSystemCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).FSxClient(ctx) diff --git a/internal/service/fsx/lustre_file_system_test.go b/internal/service/fsx/lustre_file_system_test.go index f1f80f79d18d..4a40c8ad07c7 100644 --- a/internal/service/fsx/lustre_file_system_test.go +++ b/internal/service/fsx/lustre_file_system_test.go @@ -883,7 +883,15 @@ func TestAccFSxLustreFileSystem_intelligentTiering(t *testing.T) { CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccLustreFileSystemConfig_intelligentTiering(rName), + Config: testAccLustreFileSystemConfig_intelligentTiering(rName, 4000, 31), + ExpectError: regexache.MustCompile("File systems with throughput capacity of 4000 MB/s support a minimum read cache size of 32 GiB and maximum read cache size of 131072 GiB"), + }, + { + Config: testAccLustreFileSystemConfig_intelligentTiering(rName, 8000, 32), + ExpectError: regexache.MustCompile("File systems with throughput capacity of 8000 MB/s support a minimum read cache size of 64 GiB and maximum read cache size of 262144 GiB"), + }, + { + Config: testAccLustreFileSystemConfig_intelligentTiering(rName, 4000, 32), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckLustreFileSystemExists(ctx, resourceName, &filesystem), acctest.MatchResourceAttrRegionalARN(ctx, resourceName, names.AttrARN, "fsx", regexache.MustCompile(`file-system/fs-.+`)), @@ -2089,17 +2097,17 @@ resource "aws_fsx_lustre_file_system" "test" { `, rName, efaEnabled)) } -func testAccLustreFileSystemConfig_intelligentTiering(rName string) string { - return acctest.ConfigCompose(testAccLustreFileSystemConfig_base(rName), ` +func testAccLustreFileSystemConfig_intelligentTiering(rName string, throughputCapacity, cacheSize int) string { + return acctest.ConfigCompose(testAccLustreFileSystemConfig_base(rName), fmt.Sprintf(` resource "aws_fsx_lustre_file_system" "test" { subnet_ids = aws_subnet.test[*].id deployment_type = "PERSISTENT_2" storage_type = "INTELLIGENT_TIERING" - throughput_capacity = 4000 + throughput_capacity = %[1]d data_read_cache_configuration { sizing_mode = "USER_PROVISIONED" - size = 32 + size = %[2]d } metadata_configuration { @@ -2108,5 +2116,5 @@ resource "aws_fsx_lustre_file_system" "test" { } } -`) +`, throughputCapacity, cacheSize)) } diff --git a/internal/service/fsx/service_endpoint_resolver_gen.go b/internal/service/fsx/service_endpoint_resolver_gen.go index 338435f922e3..3c762a598d6b 100644 --- a/internal/service/fsx/service_endpoint_resolver_gen.go +++ b/internal/service/fsx/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params fsx.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up fsx endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up fsx endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index e0848affd4d4..984bfd75ef0d 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/gamelift/service_endpoint_resolver_gen.go b/internal/service/gamelift/service_endpoint_resolver_gen.go index 010d1fb56e91..f2c61ef65454 100644 --- a/internal/service/gamelift/service_endpoint_resolver_gen.go +++ b/internal/service/gamelift/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params gamelift.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up gamelift endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up gamelift endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index f1b926358be2..7d152940070a 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/glacier/service_endpoint_resolver_gen.go b/internal/service/glacier/service_endpoint_resolver_gen.go index 6021ec97f2b9..42ac4a5ed347 100644 --- a/internal/service/glacier/service_endpoint_resolver_gen.go +++ b/internal/service/glacier/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params glacier.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up glacier endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up glacier endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index 782c005f78f4..616d9e1430fa 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/globalaccelerator/accelerator_identity_gen_test.go b/internal/service/globalaccelerator/accelerator_identity_gen_test.go index 48ab0c2ffe5a..f6e6d01787cd 100644 --- a/internal/service/globalaccelerator/accelerator_identity_gen_test.go +++ b/internal/service/globalaccelerator/accelerator_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccGlobalAcceleratorAccelerator_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_accelerator.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccGlobalAcceleratorAccelerator_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccGlobalAcceleratorAccelerator_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_accelerator.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/cross_account_attachment.go b/internal/service/globalaccelerator/cross_account_attachment.go index 453a88984b3f..43e64296f664 100644 --- a/internal/service/globalaccelerator/cross_account_attachment.go +++ b/internal/service/globalaccelerator/cross_account_attachment.go @@ -34,6 +34,7 @@ import ( // @Tags(identifierAttribute="arn") // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types;awstypes;awstypes.Attachment") +// @Testing(preIdentityVersion="v5.100.0") func newCrossAccountAttachmentResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &crossAccountAttachmentResource{} diff --git a/internal/service/globalaccelerator/cross_account_attachment_identity_gen_test.go b/internal/service/globalaccelerator/cross_account_attachment_identity_gen_test.go index fa3febbc71f8..917b61339872 100644 --- a/internal/service/globalaccelerator/cross_account_attachment_identity_gen_test.go +++ b/internal/service/globalaccelerator/cross_account_attachment_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlobalAcceleratorCrossAccountAttachment_Identity_Basic(t *testing.T) resourceName := "aws_globalaccelerator_cross_account_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +110,7 @@ func TestAccGlobalAcceleratorCrossAccountAttachment_Identity_ExistingResource(t resourceName := "aws_globalaccelerator_cross_account_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/custom_routing_accelerator_identity_gen_test.go b/internal/service/globalaccelerator/custom_routing_accelerator_identity_gen_test.go index 7c9837cf1e1b..bbd23cbc3895 100644 --- a/internal/service/globalaccelerator/custom_routing_accelerator_identity_gen_test.go +++ b/internal/service/globalaccelerator/custom_routing_accelerator_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccGlobalAcceleratorCustomRoutingAccelerator_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_custom_routing_accelerator.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccGlobalAcceleratorCustomRoutingAccelerator_Identity_Basic(t *testing. // Resource Identity was added after v6.3.0 func TestAccGlobalAcceleratorCustomRoutingAccelerator_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_custom_routing_accelerator.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/custom_routing_endpoint_group_identity_gen_test.go b/internal/service/globalaccelerator/custom_routing_endpoint_group_identity_gen_test.go index fa4a77b1af13..5b15d05a02b9 100644 --- a/internal/service/globalaccelerator/custom_routing_endpoint_group_identity_gen_test.go +++ b/internal/service/globalaccelerator/custom_routing_endpoint_group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlobalAcceleratorCustomRoutingEndpointGroup_Identity_Basic(t *testin resourceName := "aws_globalaccelerator_custom_routing_endpoint_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccGlobalAcceleratorCustomRoutingEndpointGroup_Identity_ExistingResourc resourceName := "aws_globalaccelerator_custom_routing_endpoint_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/custom_routing_listener_identity_gen_test.go b/internal/service/globalaccelerator/custom_routing_listener_identity_gen_test.go index 5baa4ab70742..32fe5dda9c8e 100644 --- a/internal/service/globalaccelerator/custom_routing_listener_identity_gen_test.go +++ b/internal/service/globalaccelerator/custom_routing_listener_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlobalAcceleratorCustomRoutingListener_Identity_Basic(t *testing.T) resourceName := "aws_globalaccelerator_custom_routing_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccGlobalAcceleratorCustomRoutingListener_Identity_ExistingResource(t * resourceName := "aws_globalaccelerator_custom_routing_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/endpoint_group_identity_gen_test.go b/internal/service/globalaccelerator/endpoint_group_identity_gen_test.go index 6ec7bd472411..b8372021ee74 100644 --- a/internal/service/globalaccelerator/endpoint_group_identity_gen_test.go +++ b/internal/service/globalaccelerator/endpoint_group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlobalAcceleratorEndpointGroup_Identity_Basic(t *testing.T) { resourceName := "aws_globalaccelerator_endpoint_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccGlobalAcceleratorEndpointGroup_Identity_ExistingResource(t *testing. resourceName := "aws_globalaccelerator_endpoint_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/listener_identity_gen_test.go b/internal/service/globalaccelerator/listener_identity_gen_test.go index d78f92cba4d5..643794d4af8d 100644 --- a/internal/service/globalaccelerator/listener_identity_gen_test.go +++ b/internal/service/globalaccelerator/listener_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccGlobalAcceleratorListener_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccGlobalAcceleratorListener_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.4.0 func TestAccGlobalAcceleratorListener_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_globalaccelerator_listener.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/globalaccelerator/service_endpoint_resolver_gen.go b/internal/service/globalaccelerator/service_endpoint_resolver_gen.go index 78b19acb29d9..e5c5d5b3377d 100644 --- a/internal/service/globalaccelerator/service_endpoint_resolver_gen.go +++ b/internal/service/globalaccelerator/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params globalaccelerato }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up globalaccelerator endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up globalaccelerator endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index 932e5933d87a..d487be2c1e43 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/glue/registry_identity_gen_test.go b/internal/service/glue/registry_identity_gen_test.go index 0f540bfd7647..93a44b5ab0bb 100644 --- a/internal/service/glue/registry_identity_gen_test.go +++ b/internal/service/glue/registry_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlueRegistry_Identity_Basic(t *testing.T) { resourceName := "aws_glue_registry.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccGlueRegistry_Identity_RegionOverride(t *testing.T) { resourceName := "aws_glue_registry.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccGlueRegistry_Identity_ExistingResource(t *testing.T) { resourceName := "aws_glue_registry.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/glue/resource_policy_identity_gen_test.go b/internal/service/glue/resource_policy_identity_gen_test.go index df8c4ee44418..93fa0bb81dc4 100644 --- a/internal/service/glue/resource_policy_identity_gen_test.go +++ b/internal/service/glue/resource_policy_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccGlueResourcePolicy_IdentitySerial(t *testing.T) { func testAccGlueResourcePolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_glue_resource_policy.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,7 +107,7 @@ func testAccGlueResourcePolicy_Identity_RegionOverride(t *testing.T) { resourceName := "aws_glue_resource_policy.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -213,9 +214,10 @@ func testAccGlueResourcePolicy_Identity_RegionOverride(t *testing.T) { func testAccGlueResourcePolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_glue_resource_policy.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/glue/schema_identity_gen_test.go b/internal/service/glue/schema_identity_gen_test.go index b6c93357757d..3e8e677ac621 100644 --- a/internal/service/glue/schema_identity_gen_test.go +++ b/internal/service/glue/schema_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccGlueSchema_Identity_Basic(t *testing.T) { resourceName := "aws_glue_schema.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccGlueSchema_Identity_RegionOverride(t *testing.T) { resourceName := "aws_glue_schema.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccGlueSchema_Identity_ExistingResource(t *testing.T) { resourceName := "aws_glue_schema.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/glue/service_endpoint_resolver_gen.go b/internal/service/glue/service_endpoint_resolver_gen.go index 20203f46d1e7..e65a4a1260fd 100644 --- a/internal/service/glue/service_endpoint_resolver_gen.go +++ b/internal/service/glue/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params glue.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up glue endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up glue endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index c5feed9188fd..3746205cf590 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/grafana/service_endpoint_resolver_gen.go b/internal/service/grafana/service_endpoint_resolver_gen.go index 60eb52badad1..3db2db1ea369 100644 --- a/internal/service/grafana/service_endpoint_resolver_gen.go +++ b/internal/service/grafana/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params grafana.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up grafana endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up grafana endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index f37d5d933383..6e84f7ad1018 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/greengrass/service_endpoint_resolver_gen.go b/internal/service/greengrass/service_endpoint_resolver_gen.go index 0f2ecaba4598..e4bae3fdd2c9 100644 --- a/internal/service/greengrass/service_endpoint_resolver_gen.go +++ b/internal/service/greengrass/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params greengrass.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up greengrass endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up greengrass endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index ea1e708c0f24..0b62ac2adb1c 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/groundstation/service_endpoint_resolver_gen.go b/internal/service/groundstation/service_endpoint_resolver_gen.go index c4f9330cf6ad..0d697f5e6977 100644 --- a/internal/service/groundstation/service_endpoint_resolver_gen.go +++ b/internal/service/groundstation/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params groundstation.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up groundstation endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up groundstation endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index 148c561a797c..8d00b9c05164 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/guardduty/detector_data_source_tags_gen_test.go b/internal/service/guardduty/detector_data_source_tags_gen_test.go index f601a2d65e87..a40dcaeec217 100644 --- a/internal/service/guardduty/detector_data_source_tags_gen_test.go +++ b/internal/service/guardduty/detector_data_source_tags_gen_test.go @@ -36,6 +36,7 @@ func testAccGuardDutyDetectorDataSource_tagsSerial(t *testing.T) { func testAccGuardDutyDetectorDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -62,6 +63,7 @@ func testAccGuardDutyDetectorDataSource_tags(t *testing.T) { func testAccGuardDutyDetectorDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -84,6 +86,7 @@ func testAccGuardDutyDetectorDataSource_tags_NullMap(t *testing.T) { func testAccGuardDutyDetectorDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -106,6 +109,7 @@ func testAccGuardDutyDetectorDataSource_tags_EmptyMap(t *testing.T) { func testAccGuardDutyDetectorDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -136,6 +140,7 @@ func testAccGuardDutyDetectorDataSource_tags_DefaultTags_nonOverlapping(t *testi func testAccGuardDutyDetectorDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -172,6 +177,7 @@ func testAccGuardDutyDetectorDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func testAccGuardDutyDetectorDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ diff --git a/internal/service/guardduty/detector_tags_gen_test.go b/internal/service/guardduty/detector_tags_gen_test.go index ed1522df7b32..e860148ab961 100644 --- a/internal/service/guardduty/detector_tags_gen_test.go +++ b/internal/service/guardduty/detector_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccGuardDutyDetector_tagsSerial(t *testing.T) { func testAccGuardDutyDetector_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -221,6 +222,7 @@ func testAccGuardDutyDetector_tags(t *testing.T) { func testAccGuardDutyDetector_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -286,6 +288,7 @@ func testAccGuardDutyDetector_tags_null(t *testing.T) { func testAccGuardDutyDetector_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -347,6 +350,7 @@ func testAccGuardDutyDetector_tags_EmptyMap(t *testing.T) { func testAccGuardDutyDetector_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -426,6 +430,7 @@ func testAccGuardDutyDetector_tags_AddOnUpdate(t *testing.T) { func testAccGuardDutyDetector_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -512,6 +517,7 @@ func testAccGuardDutyDetector_tags_EmptyTag_OnCreate(t *testing.T) { func testAccGuardDutyDetector_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -645,6 +651,7 @@ func testAccGuardDutyDetector_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyDetector_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -732,6 +739,7 @@ func testAccGuardDutyDetector_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyDetector_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -906,6 +914,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_providerOnly(t *testing.T) { func testAccGuardDutyDetector_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1061,6 +1070,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccGuardDutyDetector_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1232,6 +1242,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_overlapping(t *testing.T) { func testAccGuardDutyDetector_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1320,6 +1331,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_updateToProviderOnly(t *testing.T func testAccGuardDutyDetector_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1407,6 +1419,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_updateToResourceOnly(t *testing.T func testAccGuardDutyDetector_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1471,6 +1484,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccGuardDutyDetector_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1527,6 +1541,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func testAccGuardDutyDetector_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1588,6 +1603,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_nullOverlappingResourceTag(t *tes func testAccGuardDutyDetector_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1649,6 +1665,7 @@ func testAccGuardDutyDetector_tags_DefaultTags_nullNonOverlappingResourceTag(t * func testAccGuardDutyDetector_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1703,6 +1720,7 @@ func testAccGuardDutyDetector_tags_ComputedTag_OnCreate(t *testing.T) { func testAccGuardDutyDetector_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1798,6 +1816,7 @@ func testAccGuardDutyDetector_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyDetector_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -1883,6 +1902,7 @@ func testAccGuardDutyDetector_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyDetector_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ @@ -2043,6 +2063,7 @@ func testAccGuardDutyDetector_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccGuardDutyDetector_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_detector.test" acctest.Test(ctx, t, resource.TestCase{ diff --git a/internal/service/guardduty/filter_tags_gen_test.go b/internal/service/guardduty/filter_tags_gen_test.go index ce4de196b65b..aa067aa8b019 100644 --- a/internal/service/guardduty/filter_tags_gen_test.go +++ b/internal/service/guardduty/filter_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccGuardDutyFilter_tagsSerial(t *testing.T) { func testAccGuardDutyFilter_tags(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -223,6 +224,7 @@ func testAccGuardDutyFilter_tags(t *testing.T) { func testAccGuardDutyFilter_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -289,6 +291,7 @@ func testAccGuardDutyFilter_tags_null(t *testing.T) { func testAccGuardDutyFilter_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -351,6 +354,7 @@ func testAccGuardDutyFilter_tags_EmptyMap(t *testing.T) { func testAccGuardDutyFilter_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -431,6 +435,7 @@ func testAccGuardDutyFilter_tags_AddOnUpdate(t *testing.T) { func testAccGuardDutyFilter_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -518,6 +523,7 @@ func testAccGuardDutyFilter_tags_EmptyTag_OnCreate(t *testing.T) { func testAccGuardDutyFilter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -652,6 +658,7 @@ func testAccGuardDutyFilter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyFilter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -740,6 +747,7 @@ func testAccGuardDutyFilter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyFilter_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -915,6 +923,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_providerOnly(t *testing.T) { func testAccGuardDutyFilter_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1071,6 +1080,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccGuardDutyFilter_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1243,6 +1253,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_overlapping(t *testing.T) { func testAccGuardDutyFilter_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1332,6 +1343,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_updateToProviderOnly(t *testing.T) func testAccGuardDutyFilter_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1420,6 +1432,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_updateToResourceOnly(t *testing.T) func testAccGuardDutyFilter_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1485,6 +1498,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccGuardDutyFilter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1542,6 +1556,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func testAccGuardDutyFilter_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1604,6 +1619,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_nullOverlappingResourceTag(t *testi func testAccGuardDutyFilter_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1666,6 +1682,7 @@ func testAccGuardDutyFilter_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func testAccGuardDutyFilter_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1721,6 +1738,7 @@ func testAccGuardDutyFilter_tags_ComputedTag_OnCreate(t *testing.T) { func testAccGuardDutyFilter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1817,6 +1835,7 @@ func testAccGuardDutyFilter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyFilter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -1903,6 +1922,7 @@ func testAccGuardDutyFilter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyFilter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" @@ -2064,6 +2084,7 @@ func testAccGuardDutyFilter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccGuardDutyFilter_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetFilterOutput resourceName := "aws_guardduty_filter.test" diff --git a/internal/service/guardduty/ipset_tags_gen_test.go b/internal/service/guardduty/ipset_tags_gen_test.go index fb9004ccfb47..b677689653e2 100644 --- a/internal/service/guardduty/ipset_tags_gen_test.go +++ b/internal/service/guardduty/ipset_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccGuardDutyIPSet_tagsSerial(t *testing.T) { func testAccGuardDutyIPSet_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -230,6 +231,7 @@ func testAccGuardDutyIPSet_tags(t *testing.T) { func testAccGuardDutyIPSet_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -299,6 +301,7 @@ func testAccGuardDutyIPSet_tags_null(t *testing.T) { func testAccGuardDutyIPSet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -364,6 +367,7 @@ func testAccGuardDutyIPSet_tags_EmptyMap(t *testing.T) { func testAccGuardDutyIPSet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccGuardDutyIPSet_tags_AddOnUpdate(t *testing.T) { func testAccGuardDutyIPSet_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccGuardDutyIPSet_tags_EmptyTag_OnCreate(t *testing.T) { func testAccGuardDutyIPSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccGuardDutyIPSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyIPSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -768,6 +775,7 @@ func testAccGuardDutyIPSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -951,6 +959,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_providerOnly(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1113,6 +1122,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1291,6 +1301,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_overlapping(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1383,6 +1394,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1474,6 +1486,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1614,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func testAccGuardDutyIPSet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1664,6 +1679,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_nullOverlappingResourceTag(t *testin func testAccGuardDutyIPSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1728,6 +1744,7 @@ func testAccGuardDutyIPSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func testAccGuardDutyIPSet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1785,6 +1802,7 @@ func testAccGuardDutyIPSet_tags_ComputedTag_OnCreate(t *testing.T) { func testAccGuardDutyIPSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1884,6 +1902,7 @@ func testAccGuardDutyIPSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyIPSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1973,6 +1992,7 @@ func testAccGuardDutyIPSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccGuardDutyIPSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2137,6 +2157,7 @@ func testAccGuardDutyIPSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccGuardDutyIPSet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_ipset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/guardduty/malware_protection_plan_tags_gen_test.go b/internal/service/guardduty/malware_protection_plan_tags_gen_test.go index 1aa89ebe9243..6f9d2dbdfc52 100644 --- a/internal/service/guardduty/malware_protection_plan_tags_gen_test.go +++ b/internal/service/guardduty/malware_protection_plan_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccGuardDutyMalwareProtectionPlan_tags(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -203,6 +204,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags(t *testing.T) { func TestAccGuardDutyMalwareProtectionPlan_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -268,6 +270,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_null(t *testing.T) { func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -321,6 +324,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyMap(t *testing.T) { func TestAccGuardDutyMalwareProtectionPlan_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -404,6 +408,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_AddOnUpdate(t *testing.T) { func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -497,6 +502,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnCreate(t *testing.T) func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -639,6 +645,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnUpdate_Add(t *testing func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -732,6 +739,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_EmptyTag_OnUpdate_Replace(t *tes func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -916,6 +924,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_providerOnly(t *test func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1079,6 +1088,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nonOverlapping(t *te func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1258,6 +1268,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_overlapping(t *testi func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1351,6 +1362,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_updateToProviderOnly func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1443,6 +1455,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_updateToResourceOnly func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1512,6 +1525,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_emptyResourceTag(t * func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1573,6 +1587,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_emptyProviderOnlyTag func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1645,6 +1660,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nullOverlappingResou func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1719,6 +1735,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_DefaultTags_nullNonOverlappingRe func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1777,6 +1794,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnCreate(t *testing. func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1877,6 +1895,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnUpdate_Add(t *test func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1967,6 +1986,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_ComputedTag_OnUpdate_Replace(t * func TestAccGuardDutyMalwareProtectionPlan_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2132,6 +2152,7 @@ func TestAccGuardDutyMalwareProtectionPlan_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccGuardDutyMalwareProtectionPlan_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v guardduty.GetMalwareProtectionPlanOutput resourceName := "aws_guardduty_malware_protection_plan.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/guardduty/service_endpoint_resolver_gen.go b/internal/service/guardduty/service_endpoint_resolver_gen.go index bdd75b5dcfd3..a0f5ea99c799 100644 --- a/internal/service/guardduty/service_endpoint_resolver_gen.go +++ b/internal/service/guardduty/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params guardduty.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up guardduty endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up guardduty endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 81cf36dd2974..abe1bf0b68cd 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/guardduty/threatintelset_tags_gen_test.go b/internal/service/guardduty/threatintelset_tags_gen_test.go index d56a0b81d979..e549916a7e48 100644 --- a/internal/service/guardduty/threatintelset_tags_gen_test.go +++ b/internal/service/guardduty/threatintelset_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccGuardDutyThreatIntelSet_tagsSerial(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -230,6 +231,7 @@ func testAccGuardDutyThreatIntelSet_tags(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -299,6 +301,7 @@ func testAccGuardDutyThreatIntelSet_tags_null(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -364,6 +367,7 @@ func testAccGuardDutyThreatIntelSet_tags_EmptyMap(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -447,6 +451,7 @@ func testAccGuardDutyThreatIntelSet_tags_AddOnUpdate(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -538,6 +543,7 @@ func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnCreate(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -677,6 +683,7 @@ func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -768,6 +775,7 @@ func testAccGuardDutyThreatIntelSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func testAccGuardDutyThreatIntelSet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -951,6 +959,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_providerOnly(t *testing.T) func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1113,6 +1122,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nonOverlapping(t *testing.T func testAccGuardDutyThreatIntelSet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1291,6 +1301,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_overlapping(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1383,6 +1394,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_updateToProviderOnly(t *tes func testAccGuardDutyThreatIntelSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1474,6 +1486,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_updateToResourceOnly(t *tes func testAccGuardDutyThreatIntelSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1541,6 +1554,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_emptyResourceTag(t *testing func testAccGuardDutyThreatIntelSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1614,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_emptyProviderOnlyTag(t *tes func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1664,6 +1679,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nullOverlappingResourceTag( func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1728,6 +1744,7 @@ func testAccGuardDutyThreatIntelSet_tags_DefaultTags_nullNonOverlappingResourceT func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1785,6 +1802,7 @@ func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnCreate(t *testing.T) { func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1884,6 +1902,7 @@ func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1973,6 +1992,7 @@ func testAccGuardDutyThreatIntelSet_tags_ComputedTag_OnUpdate_Replace(t *testing func testAccGuardDutyThreatIntelSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2137,6 +2157,7 @@ func testAccGuardDutyThreatIntelSet_tags_IgnoreTags_Overlap_DefaultTag(t *testin func testAccGuardDutyThreatIntelSet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_guardduty_threatintelset.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/healthlake/service_endpoint_resolver_gen.go b/internal/service/healthlake/service_endpoint_resolver_gen.go index a7335e5de93b..c85b026a24f3 100644 --- a/internal/service/healthlake/service_endpoint_resolver_gen.go +++ b/internal/service/healthlake/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params healthlake.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up healthlake endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up healthlake endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index 267700a43dec..54311bac8d27 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/iam/group_policy_attachment.go b/internal/service/iam/group_policy_attachment.go index 9a1b7f38ce6d..cf6a25bb7eb9 100644 --- a/internal/service/iam/group_policy_attachment.go +++ b/internal/service/iam/group_policy_attachment.go @@ -124,7 +124,7 @@ func resourceGroupPolicyAttachmentImport(ctx context.Context, d *schema.Resource func attachPolicyToGroup(ctx context.Context, conn *iam.Client, group, policyARN string) error { var errConcurrentModificationException *awstypes.ConcurrentModificationException - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.AttachGroupPolicy(ctx, &iam.AttachGroupPolicyInput{ GroupName: aws.String(group), PolicyArn: aws.String(policyARN), @@ -140,7 +140,7 @@ func attachPolicyToGroup(ctx context.Context, conn *iam.Client, group, policyARN func detachPolicyFromGroup(ctx context.Context, conn *iam.Client, group, policyARN string) error { var errConcurrentModificationException *awstypes.ConcurrentModificationException - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.DetachGroupPolicy(ctx, &iam.DetachGroupPolicyInput{ GroupName: aws.String(group), PolicyArn: aws.String(policyARN), diff --git a/internal/service/iam/instance_profile_tags_gen_test.go b/internal/service/iam/instance_profile_tags_gen_test.go index c98450ae142c..ec291071dfb9 100644 --- a/internal/service/iam/instance_profile_tags_gen_test.go +++ b/internal/service/iam/instance_profile_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMInstanceProfile_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { func TestAccIAMInstanceProfile_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccIAMInstanceProfile_tags_null(t *testing.T) { func TestAccIAMInstanceProfile_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccIAMInstanceProfile_tags_EmptyMap(t *testing.T) { func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccIAMInstanceProfile_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccIAMInstanceProfile_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccIAMInstanceProfile_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMInstanceProfile_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccIAMInstanceProfile_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMInstanceProfile_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccIAMInstanceProfile_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMInstanceProfile_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccIAMInstanceProfile_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccIAMInstanceProfile_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.InstanceProfile resourceName := "aws_iam_instance_profile.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/openid_connect_provider_data_source_tags_gen_test.go b/internal/service/iam/openid_connect_provider_data_source_tags_gen_test.go index c0fcd8abbb88..74bced62d9cd 100644 --- a/internal/service/iam/openid_connect_provider_data_source_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccIAMOIDCProviderDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccIAMOIDCProviderDataSource_tags(t *testing.T) { func TestAccIAMOIDCProviderDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccIAMOIDCProviderDataSource_tags_NullMap(t *testing.T) { func TestAccIAMOIDCProviderDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccIAMOIDCProviderDataSource_tags_EmptyMap(t *testing.T) { func TestAccIAMOIDCProviderDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccIAMOIDCProviderDataSource_tags_DefaultTags_nonOverlapping(t *testing func TestAccIAMOIDCProviderDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccIAMOIDCProviderDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccIAMOIDCProviderDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/openid_connect_provider_identity_gen_test.go b/internal/service/iam/openid_connect_provider_identity_gen_test.go index 410dd03ae8b1..8e492c10f232 100644 --- a/internal/service/iam/openid_connect_provider_identity_gen_test.go +++ b/internal/service/iam/openid_connect_provider_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccIAMOpenIDConnectProvider_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccIAMOpenIDConnectProvider_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.4.0 func TestAccIAMOpenIDConnectProvider_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/openid_connect_provider_tags_gen_test.go b/internal/service/iam/openid_connect_provider_tags_gen_test.go index e6d0ace79c8f..294540031dfe 100644 --- a/internal/service/iam/openid_connect_provider_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyMap(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyProviderOnlyTag(t *te func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccIAMOpenIDConnectProvider_tags_ComputedTag_OnUpdate_Replace(t *testin func TestAccIAMOpenIDConnectProvider_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccIAMOpenIDConnectProvider_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccIAMOpenIDConnectProvider_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_openid_connect_provider.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/policy_data_source_tags_gen_test.go b/internal/service/iam/policy_data_source_tags_gen_test.go index 601755251958..1561ecbd5a6f 100644 --- a/internal/service/iam/policy_data_source_tags_gen_test.go +++ b/internal/service/iam/policy_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccIAMPolicyDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccIAMPolicyDataSource_tags(t *testing.T) { func TestAccIAMPolicyDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccIAMPolicyDataSource_tags_NullMap(t *testing.T) { func TestAccIAMPolicyDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccIAMPolicyDataSource_tags_EmptyMap(t *testing.T) { func TestAccIAMPolicyDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccIAMPolicyDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMPolicyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccIAMPolicyDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccIAMPolicyDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/policy_identity_gen_test.go b/internal/service/iam/policy_identity_gen_test.go index 60a9b0ae79fe..1c29b095fdc8 100644 --- a/internal/service/iam/policy_identity_gen_test.go +++ b/internal/service/iam/policy_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccIAMPolicy_Identity_Basic(t *testing.T) { resourceName := "aws_iam_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccIAMPolicy_Identity_ExistingResource(t *testing.T) { resourceName := "aws_iam_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/policy_tags_gen_test.go b/internal/service/iam/policy_tags_gen_test.go index 8ac7903cac80..a8f76f9731a9 100644 --- a/internal/service/iam/policy_tags_gen_test.go +++ b/internal/service/iam/policy_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMPolicy_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { func TestAccIAMPolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccIAMPolicy_tags_null(t *testing.T) { func TestAccIAMPolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccIAMPolicy_tags_EmptyMap(t *testing.T) { func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. func TestAccIAMPolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccIAMPolicy_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccIAMPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccIAMPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccIAMPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccIAMPolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Policy resourceName := "aws_iam_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/role.go b/internal/service/iam/role.go index c00d5b6bf593..6dc2e073ffb7 100644 --- a/internal/service/iam/role.go +++ b/internal/service/iam/role.go @@ -562,7 +562,7 @@ func deleteRole(ctx context.Context, conn *iam.Client, roleName string, forceDet RoleName: aws.String(roleName), } - _, err := tfresource.RetryWhenIsA[*awstypes.DeleteConflictException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.DeleteConflictException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteRole(ctx, input) }) diff --git a/internal/service/iam/role_data_source_tags_gen_test.go b/internal/service/iam/role_data_source_tags_gen_test.go index 1afa2c420d75..ccac54781cc7 100644 --- a/internal/service/iam/role_data_source_tags_gen_test.go +++ b/internal/service/iam/role_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccIAMRoleDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccIAMRoleDataSource_tags(t *testing.T) { func TestAccIAMRoleDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccIAMRoleDataSource_tags_NullMap(t *testing.T) { func TestAccIAMRoleDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccIAMRoleDataSource_tags_EmptyMap(t *testing.T) { func TestAccIAMRoleDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccIAMRoleDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMRoleDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccIAMRoleDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccIAMRoleDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/role_identity_gen_test.go b/internal/service/iam/role_identity_gen_test.go index 4e513947fc81..5505787b31b0 100644 --- a/internal/service/iam/role_identity_gen_test.go +++ b/internal/service/iam/role_identity_gen_test.go @@ -28,7 +28,7 @@ func TestAccIAMRole_Identity_Basic(t *testing.T) { resourceName := "aws_iam_role.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccIAMRole_Identity_ExistingResource(t *testing.T) { resourceName := "aws_iam_role.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/role_policy_attachment.go b/internal/service/iam/role_policy_attachment.go index 2882f3c06514..550c90889194 100644 --- a/internal/service/iam/role_policy_attachment.go +++ b/internal/service/iam/role_policy_attachment.go @@ -107,7 +107,7 @@ func resourceRolePolicyAttachmentDelete(ctx context.Context, d *schema.ResourceD func attachPolicyToRole(ctx context.Context, conn *iam.Client, role, policyARN string) error { var errConcurrentModificationException *awstypes.ConcurrentModificationException - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.AttachRolePolicy(ctx, &iam.AttachRolePolicyInput{ PolicyArn: aws.String(policyARN), RoleName: aws.String(role), @@ -123,7 +123,7 @@ func attachPolicyToRole(ctx context.Context, conn *iam.Client, role, policyARN s func detachPolicyFromRole(ctx context.Context, conn *iam.Client, role, policyARN string) error { var errConcurrentModificationException *awstypes.ConcurrentModificationException - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.DetachRolePolicy(ctx, &iam.DetachRolePolicyInput{ PolicyArn: aws.String(policyARN), RoleName: aws.String(role), diff --git a/internal/service/iam/role_policy_attachment_identity_gen_test.go b/internal/service/iam/role_policy_attachment_identity_gen_test.go index 11e5ba1faa5d..e04cf7a4c204 100644 --- a/internal/service/iam/role_policy_attachment_identity_gen_test.go +++ b/internal/service/iam/role_policy_attachment_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccIAMRolePolicyAttachment_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_role_policy_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,10 +107,11 @@ func TestAccIAMRolePolicyAttachment_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.0.0 func TestAccIAMRolePolicyAttachment_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_role_policy_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/role_policy_identity_gen_test.go b/internal/service/iam/role_policy_identity_gen_test.go index e4a447e42143..cfddf4b9fb4a 100644 --- a/internal/service/iam/role_policy_identity_gen_test.go +++ b/internal/service/iam/role_policy_identity_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMRolePolicy_Identity_Basic(t *testing.T) { resourceName := "aws_iam_role_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -113,7 +113,7 @@ func TestAccIAMRolePolicy_Identity_ExistingResource(t *testing.T) { resourceName := "aws_iam_role_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/role_tags_gen_test.go b/internal/service/iam/role_tags_gen_test.go index 1c965501dd67..b638fc651d8c 100644 --- a/internal/service/iam/role_tags_gen_test.go +++ b/internal/service/iam/role_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMRole_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccIAMRole_tags(t *testing.T) { func TestAccIAMRole_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccIAMRole_tags_null(t *testing.T) { func TestAccIAMRole_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccIAMRole_tags_EmptyMap(t *testing.T) { func TestAccIAMRole_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccIAMRole_tags_AddOnUpdate(t *testing.T) { func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccIAMRole_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) func TestAccIAMRole_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccIAMRole_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMRole_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccIAMRole_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMRole_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccIAMRole_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMRole_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccIAMRole_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccIAMRole_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Role resourceName := "aws_iam_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/saml_provider_identity_gen_test.go b/internal/service/iam/saml_provider_identity_gen_test.go index e597d0f0cdea..07ad78b3c34c 100644 --- a/internal/service/iam/saml_provider_identity_gen_test.go +++ b/internal/service/iam/saml_provider_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccIAMSAMLProvider_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_saml_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccIAMSAMLProvider_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.4.0 func TestAccIAMSAMLProvider_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_saml_provider.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/server_certificate_tags_gen_test.go b/internal/service/iam/server_certificate_tags_gen_test.go index fdfe2ddeb355..08444892a743 100644 --- a/internal/service/iam/server_certificate_tags_gen_test.go +++ b/internal/service/iam/server_certificate_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMServerCertificate_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -234,6 +235,7 @@ func TestAccIAMServerCertificate_tags(t *testing.T) { func TestAccIAMServerCertificate_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -313,6 +315,7 @@ func TestAccIAMServerCertificate_tags_null(t *testing.T) { func TestAccIAMServerCertificate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -388,6 +391,7 @@ func TestAccIAMServerCertificate_tags_EmptyMap(t *testing.T) { func TestAccIAMServerCertificate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -481,6 +485,7 @@ func TestAccIAMServerCertificate_tags_AddOnUpdate(t *testing.T) { func TestAccIAMServerCertificate_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -588,6 +593,7 @@ func TestAccIAMServerCertificate_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMServerCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -745,6 +751,7 @@ func TestAccIAMServerCertificate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMServerCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -846,6 +853,7 @@ func TestAccIAMServerCertificate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMServerCertificate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1061,6 +1069,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMServerCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1247,6 +1256,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMServerCertificate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1449,6 +1459,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMServerCertificate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1551,6 +1562,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccIAMServerCertificate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1652,6 +1664,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccIAMServerCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1740,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccIAMServerCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1794,6 +1808,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccIAMServerCertificate_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1866,6 +1881,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccIAMServerCertificate_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1938,6 +1954,7 @@ func TestAccIAMServerCertificate_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccIAMServerCertificate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2003,6 +2020,7 @@ func TestAccIAMServerCertificate_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMServerCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2112,6 +2130,7 @@ func TestAccIAMServerCertificate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMServerCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2211,6 +2230,7 @@ func TestAccIAMServerCertificate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccIAMServerCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2381,6 +2401,7 @@ func TestAccIAMServerCertificate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccIAMServerCertificate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.ServerCertificate resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/service_endpoint_resolver_gen.go b/internal/service/iam/service_endpoint_resolver_gen.go index 6f76401c5fd4..cbfdc9cc73f2 100644 --- a/internal/service/iam/service_endpoint_resolver_gen.go +++ b/internal/service/iam/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params iam.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up iam endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up iam endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 43f67b7d01d8..c9bc65a934f8 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -659,7 +659,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/iam/service_linked_role.go b/internal/service/iam/service_linked_role.go index bd9a26a1020e..b25a94ea2a22 100644 --- a/internal/service/iam/service_linked_role.go +++ b/internal/service/iam/service_linked_role.go @@ -105,7 +105,7 @@ func resourceServiceLinkedRoleCreate(ctx context.Context, d *schema.ResourceData input.Description = aws.String(v.(string)) } - output, err := tfresource.RetryGWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (*iam.CreateServiceLinkedRoleOutput, error) { + output, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (*iam.CreateServiceLinkedRoleOutput, error) { return conn.CreateServiceLinkedRole(ctx, input) }, "AccessDenied") if err != nil { diff --git a/internal/service/iam/service_linked_role_identity_gen_test.go b/internal/service/iam/service_linked_role_identity_gen_test.go index e301af165bbf..ece8a47cc4a3 100644 --- a/internal/service/iam/service_linked_role_identity_gen_test.go +++ b/internal/service/iam/service_linked_role_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccIAMServiceLinkedRole_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -103,10 +104,11 @@ func TestAccIAMServiceLinkedRole_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.4.0 func TestAccIAMServiceLinkedRole_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iam/service_linked_role_tags_gen_test.go b/internal/service/iam/service_linked_role_tags_gen_test.go index 171001980c24..883c05ed3018 100644 --- a/internal/service/iam/service_linked_role_tags_gen_test.go +++ b/internal/service/iam/service_linked_role_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccIAMServiceLinkedRole_tags_null(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyMap(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccIAMServiceLinkedRole_tags_AddOnUpdate(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccIAMServiceLinkedRole_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccIAMServiceLinkedRole_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccIAMServiceLinkedRole_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccIAMServiceLinkedRole_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iam_service_linked_role.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/user_data_source_tags_gen_test.go b/internal/service/iam/user_data_source_tags_gen_test.go index 4118acf84eca..837f5cdb6c9d 100644 --- a/internal/service/iam/user_data_source_tags_gen_test.go +++ b/internal/service/iam/user_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccIAMUserDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccIAMUserDataSource_tags(t *testing.T) { func TestAccIAMUserDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccIAMUserDataSource_tags_NullMap(t *testing.T) { func TestAccIAMUserDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccIAMUserDataSource_tags_EmptyMap(t *testing.T) { func TestAccIAMUserDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccIAMUserDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMUserDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccIAMUserDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccIAMUserDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/user_policy_attachment.go b/internal/service/iam/user_policy_attachment.go index cbd3d02e3e8f..7ac83c6d4a43 100644 --- a/internal/service/iam/user_policy_attachment.go +++ b/internal/service/iam/user_policy_attachment.go @@ -122,7 +122,7 @@ func resourceUserPolicyAttachmentImport(ctx context.Context, d *schema.ResourceD } func attachPolicyToUser(ctx context.Context, conn *iam.Client, user, policyARN string) error { - _, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.AttachUserPolicy(ctx, &iam.AttachUserPolicyInput{ PolicyArn: aws.String(policyARN), UserName: aws.String(user), @@ -137,7 +137,7 @@ func attachPolicyToUser(ctx context.Context, conn *iam.Client, user, policyARN s } func detachPolicyFromUser(ctx context.Context, conn *iam.Client, user, policyARN string) error { - _, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModificationException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModificationException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.DetachUserPolicy(ctx, &iam.DetachUserPolicyInput{ PolicyArn: aws.String(policyARN), UserName: aws.String(user), diff --git a/internal/service/iam/user_tags_gen_test.go b/internal/service/iam/user_tags_gen_test.go index e5d653976df3..13b0cb375e70 100644 --- a/internal/service/iam/user_tags_gen_test.go +++ b/internal/service/iam/user_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMUser_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccIAMUser_tags(t *testing.T) { func TestAccIAMUser_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccIAMUser_tags_null(t *testing.T) { func TestAccIAMUser_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccIAMUser_tags_EmptyMap(t *testing.T) { func TestAccIAMUser_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccIAMUser_tags_AddOnUpdate(t *testing.T) { func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMUser_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccIAMUser_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) func TestAccIAMUser_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccIAMUser_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMUser_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccIAMUser_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMUser_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccIAMUser_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMUser_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccIAMUser_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccIAMUser_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.User resourceName := "aws_iam_user.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/iam/virtual_mfa_device_tags_gen_test.go b/internal/service/iam/virtual_mfa_device_tags_gen_test.go index b9dedb467a5c..784925700181 100644 --- a/internal/service/iam/virtual_mfa_device_tags_gen_test.go +++ b/internal/service/iam/virtual_mfa_device_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccIAMVirtualMFADevice_tags_null(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyMap(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccIAMVirtualMFADevice_tags_AddOnUpdate(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyProviderOnlyTag(t *testing func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *t func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccIAMVirtualMFADevice_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccIAMVirtualMFADevice_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccIAMVirtualMFADevice_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccIAMVirtualMFADevice_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.VirtualMFADevice resourceName := "aws_iam_virtual_mfa_device.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/identitystore/service_endpoint_resolver_gen.go b/internal/service/identitystore/service_endpoint_resolver_gen.go index 6571c9d8f6e6..9ba29fa5d83c 100644 --- a/internal/service/identitystore/service_endpoint_resolver_gen.go +++ b/internal/service/identitystore/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params identitystore.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up identitystore endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up identitystore endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index b06c2894a73e..0dd1b774d2d2 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/imagebuilder/container_recipe_identity_gen_test.go b/internal/service/imagebuilder/container_recipe_identity_gen_test.go index e9ae3851a92c..319b7e87ddb0 100644 --- a/internal/service/imagebuilder/container_recipe_identity_gen_test.go +++ b/internal/service/imagebuilder/container_recipe_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderContainerRecipe_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_container_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderContainerRecipe_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderContainerRecipe_Identity_RegionOverride(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccImageBuilderContainerRecipe_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_container_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/distribution_configuration.go b/internal/service/imagebuilder/distribution_configuration.go index a5b012742c75..8008d986113f 100644 --- a/internal/service/imagebuilder/distribution_configuration.go +++ b/internal/service/imagebuilder/distribution_configuration.go @@ -896,7 +896,7 @@ func flattenAMIDistributionConfiguration(apiObject *awstypes.AmiDistributionConf } if v := apiObject.TargetAccountIds; v != nil { - tfMap["target_account_ids"] = aws.StringSlice(v) + tfMap["target_account_ids"] = v } return tfMap @@ -910,7 +910,7 @@ func flattenContainerDistributionConfiguration(apiObject *awstypes.ContainerDist tfMap := map[string]any{} if v := apiObject.ContainerTags; v != nil { - tfMap["container_tags"] = aws.StringSlice(v) + tfMap["container_tags"] = v } if v := apiObject.Description; v != nil { @@ -958,7 +958,7 @@ func flattenDistribution(apiObject awstypes.Distribution) map[string]any { } if v := apiObject.LicenseConfigurationArns; v != nil { - tfMap["license_configuration_arns"] = aws.StringSlice(v) + tfMap["license_configuration_arns"] = v } if v := apiObject.Region; v != nil { @@ -998,19 +998,19 @@ func flattenLaunchPermissionConfiguration(apiObject *awstypes.LaunchPermissionCo tfMap := map[string]any{} if v := apiObject.OrganizationArns; v != nil { - tfMap["organization_arns"] = aws.StringSlice(v) + tfMap["organization_arns"] = v } if v := apiObject.OrganizationalUnitArns; v != nil { - tfMap["organizational_unit_arns"] = aws.StringSlice(v) + tfMap["organizational_unit_arns"] = v } if v := apiObject.UserGroups; v != nil { - tfMap["user_groups"] = aws.StringSlice(v) + tfMap["user_groups"] = v } if v := apiObject.UserIds; v != nil { - tfMap["user_ids"] = aws.StringSlice(v) + tfMap["user_ids"] = v } return tfMap diff --git a/internal/service/imagebuilder/distribution_configuration_identity_gen_test.go b/internal/service/imagebuilder/distribution_configuration_identity_gen_test.go index 95ee91c43053..67ff45d69ba3 100644 --- a/internal/service/imagebuilder/distribution_configuration_identity_gen_test.go +++ b/internal/service/imagebuilder/distribution_configuration_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderDistributionConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_distribution_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderDistributionConfiguration_Identity_RegionOverride(t *tes resourceName := "aws_imagebuilder_distribution_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderDistributionConfiguration_Identity_RegionOverride(t *tes // Resource Identity was added after v6.3.0 func TestAccImageBuilderDistributionConfiguration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_distribution_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/image.go b/internal/service/imagebuilder/image.go index 524d745fde55..2effd9f080dd 100644 --- a/internal/service/imagebuilder/image.go +++ b/internal/service/imagebuilder/image.go @@ -557,7 +557,7 @@ func flattenContainer(apiObject awstypes.Container) map[string]any { tfMap := map[string]any{} if v := apiObject.ImageUris; v != nil { - tfMap["image_uris"] = aws.StringSlice(v) + tfMap["image_uris"] = v } if v := apiObject.Region; v != nil { diff --git a/internal/service/imagebuilder/image_identity_gen_test.go b/internal/service/imagebuilder/image_identity_gen_test.go index aee71ef82b2f..edca39903fbf 100644 --- a/internal/service/imagebuilder/image_identity_gen_test.go +++ b/internal/service/imagebuilder/image_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderImage_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderImage_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_image.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderImage_Identity_RegionOverride(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccImageBuilderImage_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/image_pipeline.go b/internal/service/imagebuilder/image_pipeline.go index c33ee3dd4da6..cdf9379af185 100644 --- a/internal/service/imagebuilder/image_pipeline.go +++ b/internal/service/imagebuilder/image_pipeline.go @@ -590,7 +590,7 @@ func flattenECRConfiguration(apiObject *awstypes.EcrConfiguration) map[string]an } if v := apiObject.ContainerTags; v != nil { - tfMap["container_tags"] = aws.StringSlice(v) + tfMap["container_tags"] = v } return tfMap diff --git a/internal/service/imagebuilder/image_pipeline_identity_gen_test.go b/internal/service/imagebuilder/image_pipeline_identity_gen_test.go index 515c7ee66b00..9f8f902d09ba 100644 --- a/internal/service/imagebuilder/image_pipeline_identity_gen_test.go +++ b/internal/service/imagebuilder/image_pipeline_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderImagePipeline_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image_pipeline.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderImagePipeline_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderImagePipeline_Identity_RegionOverride(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccImageBuilderImagePipeline_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image_pipeline.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/image_recipe_identity_gen_test.go b/internal/service/imagebuilder/image_recipe_identity_gen_test.go index e34ab1087835..5e5b127cf536 100644 --- a/internal/service/imagebuilder/image_recipe_identity_gen_test.go +++ b/internal/service/imagebuilder/image_recipe_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderImageRecipe_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderImageRecipe_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderImageRecipe_Identity_RegionOverride(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccImageBuilderImageRecipe_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_image_recipe.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/image_test.go b/internal/service/imagebuilder/image_test.go index 7185d2fb493e..6a3430b2f12a 100644 --- a/internal/service/imagebuilder/image_test.go +++ b/internal/service/imagebuilder/image_test.go @@ -733,29 +733,102 @@ resource "aws_iam_role" "test_execute" { name = join("-", [%[1]q, "execute"]) } -data "aws_iam_policy" "AWSServiceRoleForImageBuilder" { - arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/aws-service-role/AWSServiceRoleForImageBuilder" -} - -resource "aws_iam_policy" "test_execute_service_policy" { - name = join("-", [%[1]q, "execute-service"]) - policy = data.aws_iam_policy.AWSServiceRoleForImageBuilder.policy -} - -resource "aws_iam_role_policy_attachment" "test_execute_service" { - policy_arn = aws_iam_policy.test_execute_service_policy.arn - role = aws_iam_role.test_execute.name -} - resource "aws_iam_policy" "test_execute" { name = join("-", [%[1]q, "execute"]) policy = jsonencode({ Version = "2012-10-17" - Statement = [{ - Action = "ssm:SendCommand" - Effect = "Allow" - Resource = "arn:${data.aws_partition.current.partition}:ssm:${data.aws_region.current.id}::document/AWS-UpdateSSMAgent" - }] + Statement = [ + { + Sid = "EC2Lifecycle" + Effect = "Allow" + Action = [ + "ec2:CreateImage", + "ec2:CreateTags", + "ec2:DescribeInstances", + "ec2:DescribeImages", + "ec2:DescribeTags", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstanceTypeOfferings", + "ec2:RunInstances", + "ec2:StopInstances", + "ec2:TerminateInstances" + ] + Resource = "*" + }, + { + Sid = "SSMExecution" + Effect = "Allow" + Action = [ + "ssm:AddTagsToResource", + "ssm:CreateAssociation", + "ssm:DeleteAssociation", + "ssm:DescribeAssociationExecutions", + "ssm:DescribeDocument", + "ssm:DescribeInstanceAssociationsStatus", + "ssm:DescribeInstanceInformation", + "ssm:GetAutomationExecution", + "ssm:GetCommandInvocation", + "ssm:GetDocument", + "ssm:ListCommands", + "ssm:ListCommandInvocations", + "ssm:ListInventoryEntries", + "ssm:SendAutomationSignal", + "ssm:SendCommand", + "ssm:StopAutomationExecution" + ] + Resource = "*" + }, + { + Sid = "ImageBuilderCore" + Effect = "Allow" + Action = [ + "imagebuilder:GetComponent", + "imagebuilder:GetImage", + "imagebuilder:GetImageRecipe", + "imagebuilder:ListComponents", + "imagebuilder:ListImageBuildVersions", + "imagebuilder:ListImagePackages", + "imagebuilder:ListImagePipelineImages", + "imagebuilder:ListImageRecipes" + ] + Resource = "*" + }, + { + Sid = "ImageScanFindings" + Effect = "Allow" + Action = [ + "inspector2:BatchGet*", + "inspector2:Get*", + "inspector2:List*" + ] + Resource = "*" + }, + { + Sid = "CloudWatchLogging" + Effect = "Allow" + Action = [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ] + Resource = "*" + }, + { + Sid = "PassRole" + Effect = "Allow" + Action = "iam:PassRole" + Resource = "*" + Condition = { + StringEquals = { + "iam:PassedToService" = [ + "ec2.amazonaws.com", + "ec2.amazonaws.com.cn", + "vmie.amazonaws.com" + ] + } + } + } + ] }) } @@ -785,8 +858,7 @@ resource "aws_imagebuilder_image" "test" { } depends_on = [ - aws_iam_role_policy_attachment.test_execute, - aws_iam_role_policy_attachment.test_execute_service + aws_iam_role_policy_attachment.test_execute ] } `, rName), diff --git a/internal/service/imagebuilder/infrastructure_configuration_identity_gen_test.go b/internal/service/imagebuilder/infrastructure_configuration_identity_gen_test.go index 49f50320bd46..eeeece9f0b1f 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_identity_gen_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderInfrastructureConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_infrastructure_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderInfrastructureConfiguration_Identity_RegionOverride(t *t resourceName := "aws_imagebuilder_infrastructure_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderInfrastructureConfiguration_Identity_RegionOverride(t *t // Resource Identity was added after v6.3.0 func TestAccImageBuilderInfrastructureConfiguration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_infrastructure_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/lifecycle_policy.go b/internal/service/imagebuilder/lifecycle_policy.go index 037e9eb4fda0..91ae121021e3 100644 --- a/internal/service/imagebuilder/lifecycle_policy.go +++ b/internal/service/imagebuilder/lifecycle_policy.go @@ -38,6 +38,7 @@ import ( // @Tags(identifierAttribute="arn") // @ArnIdentity(identityDuplicateAttributes="id") // @ArnFormat("lifecycle-policy/{name}") +// @Testing(preIdentityVersion="v5.100.0") func newLifecyclePolicyResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &lifecyclePolicyResource{}, nil } @@ -311,7 +312,7 @@ func (r *lifecyclePolicyResource) Create(ctx context.Context, request resource.C input.ClientToken = aws.String(sdkid.UniqueId()) input.Tags = getTagsIn(ctx) - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateLifecyclePolicy(ctx, input) }, errCodeInvalidParameterValueException, "The provided role does not exist or does not have sufficient permissions") @@ -413,7 +414,7 @@ func (r *lifecyclePolicyResource) Update(ctx context.Context, request resource.U // Additional fields. input.ClientToken = aws.String(sdkid.UniqueId()) - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateLifecyclePolicy(ctx, input) }, errCodeInvalidParameterValueException, "The provided role does not exist or does not have sufficient permissions") diff --git a/internal/service/imagebuilder/lifecycle_policy_identity_gen_test.go b/internal/service/imagebuilder/lifecycle_policy_identity_gen_test.go index 3cd205999df8..33d2f716901b 100644 --- a/internal/service/imagebuilder/lifecycle_policy_identity_gen_test.go +++ b/internal/service/imagebuilder/lifecycle_policy_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderLifecyclePolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_lifecycle_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +111,7 @@ func TestAccImageBuilderLifecyclePolicy_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_lifecycle_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -227,10 +228,11 @@ func TestAccImageBuilderLifecyclePolicy_Identity_RegionOverride(t *testing.T) { func TestAccImageBuilderLifecyclePolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_lifecycle_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/imagebuilder/service_endpoint_resolver_gen.go b/internal/service/imagebuilder/service_endpoint_resolver_gen.go index cbc53be0e4d6..36ac8e6603b1 100644 --- a/internal/service/imagebuilder/service_endpoint_resolver_gen.go +++ b/internal/service/imagebuilder/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params imagebuilder.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up imagebuilder endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up imagebuilder endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index 79e8b654872c..e292d7a86f9f 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/imagebuilder/workflow_identity_gen_test.go b/internal/service/imagebuilder/workflow_identity_gen_test.go index e571995e7e32..b3b51476c8d3 100644 --- a/internal/service/imagebuilder/workflow_identity_gen_test.go +++ b/internal/service/imagebuilder/workflow_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccImageBuilderWorkflow_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_workflow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -109,7 +110,7 @@ func TestAccImageBuilderWorkflow_Identity_RegionOverride(t *testing.T) { resourceName := "aws_imagebuilder_workflow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -226,10 +227,11 @@ func TestAccImageBuilderWorkflow_Identity_RegionOverride(t *testing.T) { // Resource Identity was added after v6.3.0 func TestAccImageBuilderWorkflow_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_imagebuilder_workflow.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/inspector/assessment_target_identity_gen_test.go b/internal/service/inspector/assessment_target_identity_gen_test.go index a5cf8a67a9fe..99adb2b5aa00 100644 --- a/internal/service/inspector/assessment_target_identity_gen_test.go +++ b/internal/service/inspector/assessment_target_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccInspectorAssessmentTarget_Identity_Basic(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccInspectorAssessmentTarget_Identity_RegionOverride(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccInspectorAssessmentTarget_Identity_ExistingResource(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/inspector/assessment_template_identity_gen_test.go b/internal/service/inspector/assessment_template_identity_gen_test.go index 9aef30eac0dc..bb0a2113141a 100644 --- a/internal/service/inspector/assessment_template_identity_gen_test.go +++ b/internal/service/inspector/assessment_template_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccInspectorAssessmentTemplate_Identity_Basic(t *testing.T) { resourceName := "aws_inspector_assessment_template.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccInspectorAssessmentTemplate_Identity_RegionOverride(t *testing.T) { resourceName := "aws_inspector_assessment_template.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccInspectorAssessmentTemplate_Identity_ExistingResource(t *testing.T) resourceName := "aws_inspector_assessment_template.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/inspector/resource_group_identity_gen_test.go b/internal/service/inspector/resource_group_identity_gen_test.go index 0a9683dc505e..e2dfb0aa3a4c 100644 --- a/internal/service/inspector/resource_group_identity_gen_test.go +++ b/internal/service/inspector/resource_group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccInspectorResourceGroup_Identity_Basic(t *testing.T) { resourceName := "aws_inspector_resource_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccInspectorResourceGroup_Identity_RegionOverride(t *testing.T) { resourceName := "aws_inspector_resource_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccInspectorResourceGroup_Identity_ExistingResource(t *testing.T) { resourceName := "aws_inspector_resource_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/inspector/service_endpoint_resolver_gen.go b/internal/service/inspector/service_endpoint_resolver_gen.go index b896bf2eb743..6147438161a8 100644 --- a/internal/service/inspector/service_endpoint_resolver_gen.go +++ b/internal/service/inspector/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params inspector.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up inspector endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up inspector endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index 0cbbdfff0601..2a3bf8bd941f 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/inspector2/enabler.go b/internal/service/inspector2/enabler.go index a551af5ddc1d..8f4ce6a76cb8 100644 --- a/internal/service/inspector2/enabler.go +++ b/internal/service/inspector2/enabler.go @@ -48,6 +48,10 @@ func ResourceEnabler() *schema.Resource { Delete: schema.DefaultTimeout(5 * time.Minute), }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Schema: map[string]*schema.Schema{ "account_ids": { Type: schema.TypeSet, diff --git a/internal/service/inspector2/enabler_test.go b/internal/service/inspector2/enabler_test.go index 4f99952255ba..3a8146963501 100644 --- a/internal/service/inspector2/enabler_test.go +++ b/internal/service/inspector2/enabler_test.go @@ -53,6 +53,11 @@ func testAccEnabler_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeEcr)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -86,6 +91,11 @@ func testAccEnabler_accountID(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeEcr)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -248,6 +258,11 @@ func testAccEnabler_lambda(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeLambda)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -283,6 +298,11 @@ func testAccEnabler_lambdaCode(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeLambdaCode)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -315,6 +335,11 @@ func testAccEnabler_codeRepository(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeCodeRepository)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/internal/service/inspector2/filter_tags_gen_test.go b/internal/service/inspector2/filter_tags_gen_test.go index 4d8c408dfdea..455d96a56f69 100644 --- a/internal/service/inspector2/filter_tags_gen_test.go +++ b/internal/service/inspector2/filter_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccInspector2Filter_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -208,6 +209,7 @@ func TestAccInspector2Filter_tags(t *testing.T) { func TestAccInspector2Filter_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccInspector2Filter_tags_null(t *testing.T) { func TestAccInspector2Filter_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -324,6 +327,7 @@ func TestAccInspector2Filter_tags_EmptyMap(t *testing.T) { func TestAccInspector2Filter_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccInspector2Filter_tags_AddOnUpdate(t *testing.T) { func TestAccInspector2Filter_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccInspector2Filter_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccInspector2Filter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccInspector2Filter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccInspector2Filter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccInspector2Filter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccInspector2Filter_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -924,6 +932,7 @@ func TestAccInspector2Filter_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccInspector2Filter_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1090,6 +1099,7 @@ func TestAccInspector2Filter_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccInspector2Filter_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func TestAccInspector2Filter_tags_DefaultTags_overlapping(t *testing.T) { func TestAccInspector2Filter_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1364,6 +1375,7 @@ func TestAccInspector2Filter_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccInspector2Filter_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1455,6 +1467,7 @@ func TestAccInspector2Filter_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccInspector2Filter_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1536,7 @@ func TestAccInspector2Filter_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccInspector2Filter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1583,6 +1597,7 @@ func TestAccInspector2Filter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccInspector2Filter_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1669,7 @@ func TestAccInspector2Filter_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccInspector2Filter_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1743,7 @@ func TestAccInspector2Filter_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccInspector2Filter_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1784,6 +1801,7 @@ func TestAccInspector2Filter_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccInspector2Filter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1883,6 +1901,7 @@ func TestAccInspector2Filter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccInspector2Filter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1972,6 +1991,7 @@ func TestAccInspector2Filter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccInspector2Filter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2134,6 +2154,7 @@ func TestAccInspector2Filter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccInspector2Filter_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Filter resourceName := "aws_inspector2_filter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/inspector2/service_endpoint_resolver_gen.go b/internal/service/inspector2/service_endpoint_resolver_gen.go index 1a00552e67e7..674a6333d1b5 100644 --- a/internal/service/inspector2/service_endpoint_resolver_gen.go +++ b/internal/service/inspector2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params inspector2.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up inspector2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up inspector2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index 4b5b454c6e84..9f3eba0adbf0 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/internetmonitor/service_endpoint_resolver_gen.go b/internal/service/internetmonitor/service_endpoint_resolver_gen.go index e31c6e0a78ef..6686ee041234 100644 --- a/internal/service/internetmonitor/service_endpoint_resolver_gen.go +++ b/internal/service/internetmonitor/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params internetmonitor. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up internetmonitor endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up internetmonitor endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index c43b670ed336..9b650258d553 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/invoicing/service_endpoint_resolver_gen.go b/internal/service/invoicing/service_endpoint_resolver_gen.go index 506bd7d41312..261586c0da88 100644 --- a/internal/service/invoicing/service_endpoint_resolver_gen.go +++ b/internal/service/invoicing/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params invoicing.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up invoicing endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up invoicing endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/invoicing/service_endpoints_gen_test.go b/internal/service/invoicing/service_endpoints_gen_test.go index 4afc0e43aa6e..f3ba3bcf2bdf 100644 --- a/internal/service/invoicing/service_endpoints_gen_test.go +++ b/internal/service/invoicing/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/iot/ca_certificate.go b/internal/service/iot/ca_certificate.go index 15161a428b60..7ce457d35b3e 100644 --- a/internal/service/iot/ca_certificate.go +++ b/internal/service/iot/ca_certificate.go @@ -160,7 +160,7 @@ func resourceCACertificateCreate(ctx context.Context, d *schema.ResourceData, me input.VerificationCertificate = aws.String(v.(string)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.RegisterCACertificate(ctx, input) }) @@ -242,7 +242,7 @@ func resourceCACertificateUpdate(ctx context.Context, d *schema.ResourceData, me } } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateCACertificate(ctx, input) }) diff --git a/internal/service/iot/event_configurations_identity_gen_test.go b/internal/service/iot/event_configurations_identity_gen_test.go index 8689e4480453..1f031fb41d65 100644 --- a/internal/service/iot/event_configurations_identity_gen_test.go +++ b/internal/service/iot/event_configurations_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccIoTEventConfigurations_IdentitySerial(t *testing.T) { func testAccIoTEventConfigurations_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_event_configurations.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,7 +107,7 @@ func testAccIoTEventConfigurations_Identity_RegionOverride(t *testing.T) { resourceName := "aws_iot_event_configurations.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -213,9 +214,10 @@ func testAccIoTEventConfigurations_Identity_RegionOverride(t *testing.T) { func testAccIoTEventConfigurations_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_event_configurations.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iot/indexing_configuration.go b/internal/service/iot/indexing_configuration.go index 3d3bdf4cbcfa..32ad055d5cf2 100644 --- a/internal/service/iot/indexing_configuration.go +++ b/internal/service/iot/indexing_configuration.go @@ -292,7 +292,7 @@ func flattenIndexingFilter(apiObject *awstypes.IndexingFilter) map[string]any { tfMap := map[string]any{} if v := apiObject.NamedShadowNames; v != nil { - tfMap["named_shadow_names"] = aws.StringSlice(v) + tfMap["named_shadow_names"] = v } return tfMap diff --git a/internal/service/iot/indexing_configuration_identity_gen_test.go b/internal/service/iot/indexing_configuration_identity_gen_test.go index 9cdda6e96f2f..e337c245a4d2 100644 --- a/internal/service/iot/indexing_configuration_identity_gen_test.go +++ b/internal/service/iot/indexing_configuration_identity_gen_test.go @@ -33,9 +33,10 @@ func testAccIoTIndexingConfiguration_IdentitySerial(t *testing.T) { func testAccIoTIndexingConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_indexing_configuration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -106,7 +107,7 @@ func testAccIoTIndexingConfiguration_Identity_RegionOverride(t *testing.T) { resourceName := "aws_iot_indexing_configuration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -213,9 +214,10 @@ func testAccIoTIndexingConfiguration_Identity_RegionOverride(t *testing.T) { func testAccIoTIndexingConfiguration_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_indexing_configuration.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iot/logging_options.go b/internal/service/iot/logging_options.go index e0e3ca462dde..f77fbd0940d2 100644 --- a/internal/service/iot/logging_options.go +++ b/internal/service/iot/logging_options.go @@ -70,7 +70,7 @@ func resourceLoggingOptionsPut(ctx context.Context, d *schema.ResourceData, meta input.RoleArn = aws.String(v.(string)) } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.SetV2LoggingOptions(ctx, input) }) diff --git a/internal/service/iot/logging_options_identity_gen_test.go b/internal/service/iot/logging_options_identity_gen_test.go index 7d42c4e1dec1..61f1e65c8880 100644 --- a/internal/service/iot/logging_options_identity_gen_test.go +++ b/internal/service/iot/logging_options_identity_gen_test.go @@ -34,10 +34,11 @@ func testAccIoTLoggingOptions_IdentitySerial(t *testing.T) { func testAccIoTLoggingOptions_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_logging_options.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -71,7 +72,7 @@ func testAccIoTLoggingOptions_Identity_RegionOverride(t *testing.T) { resourceName := "aws_iot_logging_options.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -102,10 +103,11 @@ func testAccIoTLoggingOptions_Identity_RegionOverride(t *testing.T) { func testAccIoTLoggingOptions_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_iot_logging_options.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/iot/policy.go b/internal/service/iot/policy.go index b67040acd649..0f1e3cf4c73b 100644 --- a/internal/service/iot/policy.go +++ b/internal/service/iot/policy.go @@ -286,8 +286,8 @@ func deletePolicy(ctx context.Context, conn *iot.Client, name string) error { PolicyName: aws.String(name), } - _, err := tfresource.RetryWhenIsA[*awstypes.DeleteConflictException](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.DeleteConflictException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.DeletePolicy(ctx, input) }) @@ -308,8 +308,8 @@ func deletePolicyVersion(ctx context.Context, conn *iot.Client, name, versionID PolicyVersionId: aws.String(versionID), } - _, err := tfresource.RetryWhenIsA[*awstypes.DeleteConflictException](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.DeleteConflictException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.DeletePolicyVersion(ctx, input) }) diff --git a/internal/service/iot/provisioning_template.go b/internal/service/iot/provisioning_template.go index c9edb55e0ddd..df59168a8cbc 100644 --- a/internal/service/iot/provisioning_template.go +++ b/internal/service/iot/provisioning_template.go @@ -155,8 +155,8 @@ func resourceProvisioningTemplateCreate(ctx context.Context, d *schema.ResourceD input.Type = awstypes.TemplateType(v) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, - func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.CreateProvisioningTemplate(ctx, input) }) @@ -234,8 +234,8 @@ func resourceProvisioningTemplateUpdate(ctx context.Context, d *schema.ResourceD input.PreProvisioningHook = expandProvisioningHook(v.([]any)[0].(map[string]any)) } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.UpdateProvisioningTemplate(ctx, input) }) diff --git a/internal/service/iot/service_endpoint_resolver_gen.go b/internal/service/iot/service_endpoint_resolver_gen.go index 040cd2f3d948..a2021edbbcfc 100644 --- a/internal/service/iot/service_endpoint_resolver_gen.go +++ b/internal/service/iot/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params iot.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up iot endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up iot endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 33d649b3a705..1a01af4bd0c0 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/iot/thing_group.go b/internal/service/iot/thing_group.go index 11114d9542a7..13ba9f80b662 100644 --- a/internal/service/iot/thing_group.go +++ b/internal/service/iot/thing_group.go @@ -238,8 +238,8 @@ func resourceThingGroupDelete(ctx context.Context, d *schema.ResourceData, meta const ( timeout = 1 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, timeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, timeout, + func(ctx context.Context) (any, error) { return conn.DeleteThingGroup(ctx, &iot.DeleteThingGroupInput{ ThingGroupName: aws.String(d.Id()), }) diff --git a/internal/service/iot/thing_type.go b/internal/service/iot/thing_type.go index 9f8f2bcd4c38..d43d44840129 100644 --- a/internal/service/iot/thing_type.go +++ b/internal/service/iot/thing_type.go @@ -194,8 +194,8 @@ func resourceThingTypeDelete(ctx context.Context, d *schema.ResourceData, meta a } log.Printf("[DEBUG] Deleting IoT Thing Type: %s", d.Id()) - _, err = tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, deprecatePropagationTimeout, - func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, deprecatePropagationTimeout, + func(ctx context.Context) (any, error) { return conn.DeleteThingType(ctx, &iot.DeleteThingTypeInput{ ThingTypeName: aws.String(d.Id()), }) diff --git a/internal/service/iot/topic_rule.go b/internal/service/iot/topic_rule.go index 1e1cc54e6ff4..a3e74eb6389d 100644 --- a/internal/service/iot/topic_rule.go +++ b/internal/service/iot/topic_rule.go @@ -1257,8 +1257,8 @@ func resourceTopicRuleCreate(ctx context.Context, d *schema.ResourceData, meta a TopicRulePayload: expandTopicRulePayload(d), } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.CreateTopicRule(ctx, input) }) @@ -1387,8 +1387,8 @@ func resourceTopicRuleUpdate(ctx context.Context, d *schema.ResourceData, meta a TopicRulePayload: expandTopicRulePayload(d), } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.ReplaceTopicRule(ctx, input) }) diff --git a/internal/service/iot/topic_rule_destination.go b/internal/service/iot/topic_rule_destination.go index d412de453aeb..c356dee7d284 100644 --- a/internal/service/iot/topic_rule_destination.go +++ b/internal/service/iot/topic_rule_destination.go @@ -102,8 +102,8 @@ func resourceTopicRuleDestinationCreate(ctx context.Context, d *schema.ResourceD input.DestinationConfiguration.VpcConfiguration = expandVPCDestinationConfiguration(v.([]any)[0].(map[string]any)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InvalidRequestException](ctx, propagationTimeout, - func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidRequestException](ctx, propagationTimeout, + func(ctx context.Context) (any, error) { return conn.CreateTopicRuleDestination(ctx, input) }) @@ -405,11 +405,11 @@ func flattenVPCDestinationProperties(apiObject *awstypes.VpcDestinationPropertie } if v := apiObject.SecurityGroups; v != nil { - tfMap[names.AttrSecurityGroups] = aws.StringSlice(v) + tfMap[names.AttrSecurityGroups] = v } if v := apiObject.SubnetIds; v != nil { - tfMap[names.AttrSubnetIDs] = aws.StringSlice(v) + tfMap[names.AttrSubnetIDs] = v } if v := apiObject.VpcId; v != nil { diff --git a/internal/service/iot/topic_rule_destination_test.go b/internal/service/iot/topic_rule_destination_test.go index 3fc80d13c9f2..2212d74baa4d 100644 --- a/internal/service/iot/topic_rule_destination_test.go +++ b/internal/service/iot/topic_rule_destination_test.go @@ -91,7 +91,7 @@ func TestAccIoTTopicRuleDestination_enabled(t *testing.T) { CheckDestroy: testAccCheckTopicRuleDestinationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccTopicRuleDestinationConfig_enabled(rName, false), + Config: testAccTopicRuleDestinationConfig_enabled(rName, 1, false), Check: resource.ComposeTestCheckFunc( testAccCheckTopicRuleDestinationExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, names.AttrEnabled, acctest.CtFalse), @@ -103,16 +103,18 @@ func TestAccIoTTopicRuleDestination_enabled(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccTopicRuleDestinationConfig_enabled(rName, true), + Config: testAccTopicRuleDestinationConfig_enabled(rName, 1, true), Check: resource.ComposeTestCheckFunc( testAccCheckTopicRuleDestinationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.0.security_groups.#", "1"), resource.TestCheckResourceAttr(resourceName, names.AttrEnabled, acctest.CtTrue), ), }, { - Config: testAccTopicRuleDestinationConfig_enabled(rName, false), + Config: testAccTopicRuleDestinationConfig_enabled(rName, 2, false), Check: resource.ComposeTestCheckFunc( testAccCheckTopicRuleDestinationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.0.security_groups.#", "2"), resource.TestCheckResourceAttr(resourceName, names.AttrEnabled, acctest.CtFalse), ), }, @@ -169,28 +171,29 @@ func testAccCheckTopicRuleDestinationExists(ctx context.Context, n string) resou } } -func testAccTopicRuleDestinationBaseConfig(rName string) string { +func testAccTopicRuleDestinationBaseConfig(rName string, securityGroupCount int) string { return acctest.ConfigCompose( acctest.ConfigVPCWithSubnets(rName, 2), testAccTopicRuleConfig_destinationRole(rName), fmt.Sprintf(` resource "aws_security_group" "test" { - name = %[1]q + count = %[2]d + name = "%[1]s-${count.index}" vpc_id = aws_vpc.test.id tags = { - Name = %[1]q + Name = "%[1]s-${count.index}" } } -`, rName)) +`, rName, securityGroupCount)) } func testAccTopicRuleDestinationConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccTopicRuleDestinationBaseConfig(rName), ` + return acctest.ConfigCompose(testAccTopicRuleDestinationBaseConfig(rName, 1), ` resource "aws_iot_topic_rule_destination" "test" { vpc_configuration { role_arn = aws_iam_role.test.arn - security_groups = [aws_security_group.test.id] + security_groups = aws_security_group.test[*].id subnet_ids = aws_subnet.test[*].id vpc_id = aws_vpc.test.id } @@ -198,14 +201,14 @@ resource "aws_iot_topic_rule_destination" "test" { `) } -func testAccTopicRuleDestinationConfig_enabled(rName string, enabled bool) string { - return acctest.ConfigCompose(testAccTopicRuleDestinationBaseConfig(rName), fmt.Sprintf(` +func testAccTopicRuleDestinationConfig_enabled(rName string, securityGroupCount int, enabled bool) string { + return acctest.ConfigCompose(testAccTopicRuleDestinationBaseConfig(rName, securityGroupCount), fmt.Sprintf(` resource "aws_iot_topic_rule_destination" "test" { enabled = %[1]t vpc_configuration { role_arn = aws_iam_role.test.arn - security_groups = [aws_security_group.test.id] + security_groups = aws_security_group.test[*].id subnet_ids = aws_subnet.test[*].id vpc_id = aws_vpc.test.id } diff --git a/internal/service/ivs/channel.go b/internal/service/ivs/channel.go index e646f04c3bdb..57cd7067129d 100644 --- a/internal/service/ivs/channel.go +++ b/internal/service/ivs/channel.go @@ -28,6 +28,10 @@ import ( // @SDKResource("aws_ivs_channel", name="Channel") // @Tags(identifierAttribute="id") +// @ArnIdentity +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ivs/types;awstypes.Channel") +// @Testing(preIdentityVersion="v6.7.0") +// @Testing(generator=false) func ResourceChannel() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceChannelCreate, @@ -35,10 +39,6 @@ func ResourceChannel() *schema.Resource { UpdateWithoutTimeout: resourceChannelUpdate, DeleteWithoutTimeout: resourceChannelDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Update: schema.DefaultTimeout(5 * time.Minute), diff --git a/internal/service/ivs/channel_identity_gen_test.go b/internal/service/ivs/channel_identity_gen_test.go new file mode 100644 index 000000000000..17a67ee699e6 --- /dev/null +++ b/internal/service/ivs/channel_identity_gen_test.go @@ -0,0 +1,261 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ivs_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ivs/types" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccIVSChannel_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Channel + resourceName := "aws_ivs_channel.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckChannelDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic/"), + ConfigVariables: config.Variables{}, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccIVSChannel_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ivs_channel.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccIVSChannel_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Channel + resourceName := "aws_ivs_channel.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckChannelDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic_v6.7.0/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckChannelExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Channel/basic/"), + ConfigVariables: config.Variables{}, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/ivs/generate.go b/internal/service/ivs/generate.go index af15398659c1..bdabf87e7bd5 100644 --- a/internal/service/ivs/generate.go +++ b/internal/service/ivs/generate.go @@ -3,6 +3,7 @@ //go:generate go run ../../generate/tags/main.go -KVTValues -ListTags -ServiceTagsMap -UpdateTags //go:generate go run ../../generate/servicepackage/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package ivs diff --git a/internal/service/ivs/ivs_test.go b/internal/service/ivs/ivs_test.go index dcb2a7a1e200..24bf731801b1 100644 --- a/internal/service/ivs/ivs_test.go +++ b/internal/service/ivs/ivs_test.go @@ -18,6 +18,7 @@ func TestAccIVS_serial(t *testing.T) { "update": testAccPlaybackKeyPair_update, "tags": testAccPlaybackKeyPair_tags, acctest.CtDisappears: testAccPlaybackKeyPair_disappears, + "identity": testAccIVSPlaybackKeyPair_IdentitySerial, }, } diff --git a/internal/service/ivs/playback_key_pair.go b/internal/service/ivs/playback_key_pair.go index a9b92079691e..2188e6fae3e6 100644 --- a/internal/service/ivs/playback_key_pair.go +++ b/internal/service/ivs/playback_key_pair.go @@ -24,16 +24,20 @@ import ( // @SDKResource("aws_ivs_playback_key_pair", name="Playback Key Pair") // @Tags(identifierAttribute="id") +// @ArnIdentity +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ivs/types;awstypes.PlaybackKeyPair") +// @Testing(preIdentityVersion="v6.7.0") +// @Testing(serialize=true) +// @Testing(generator=false) +// @Testing(tlsEcdsaPublicKeyPem=true) +// @Testing(importIgnore="public_key") +// @Testing(plannableImportAction=Replace) func ResourcePlaybackKeyPair() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourcePlaybackKeyPairCreate, ReadWithoutTimeout: resourcePlaybackKeyPairRead, DeleteWithoutTimeout: resourcePlaybackKeyPairDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Delete: schema.DefaultTimeout(5 * time.Minute), diff --git a/internal/service/ivs/playback_key_pair_identity_gen_test.go b/internal/service/ivs/playback_key_pair_identity_gen_test.go new file mode 100644 index 000000000000..31acb669525d --- /dev/null +++ b/internal/service/ivs/playback_key_pair_identity_gen_test.go @@ -0,0 +1,316 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ivs_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ivs/types" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func testAccIVSPlaybackKeyPair_IdentitySerial(t *testing.T) { + t.Helper() + + testCases := map[string]func(t *testing.T){ + acctest.CtBasic: testAccIVSPlaybackKeyPair_Identity_Basic, + "ExistingResource": testAccIVSPlaybackKeyPair_Identity_ExistingResource, + "RegionOverride": testAccIVSPlaybackKeyPair_Identity_RegionOverride, + } + + acctest.RunSerialTests1Level(t, testCases, 0) +} + +func testAccIVSPlaybackKeyPair_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.PlaybackKeyPair + resourceName := "aws_ivs_playback_key_pair.test" + privateKey := acctest.TLSECDSAPrivateKeyPEM(t, "P-384") + rTlsEcdsaPublicKeyPem, _ := acctest.TLSECDSAPublicKeyPEM(t, privateKey) + + acctest.Test(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckPlaybackKeyPairDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckPlaybackKeyPairExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + names.AttrPublicKey, + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrARN)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrID)), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrARN)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrID)), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccIVSPlaybackKeyPair_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ivs_playback_key_pair.test" + privateKey := acctest.TLSECDSAPrivateKeyPEM(t, "P-384") + rTlsEcdsaPublicKeyPem, _ := acctest.TLSECDSAPublicKeyPEM(t, privateKey) + + acctest.Test(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + names.AttrPublicKey, + }, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + names.AttrPublicKey, + }, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrARN)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrID)), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrARN)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrID)), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/region_override/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrARN)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrID)), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func testAccIVSPlaybackKeyPair_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.PlaybackKeyPair + resourceName := "aws_ivs_playback_key_pair.test" + privateKey := acctest.TLSECDSAPrivateKeyPEM(t, "P-384") + rTlsEcdsaPublicKeyPem, _ := acctest.TLSECDSAPublicKeyPEM(t, privateKey) + + acctest.Test(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckPlaybackKeyPairDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckPlaybackKeyPairExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/PlaybackKeyPair/basic/"), + ConfigVariables: config.Variables{ + "rTlsEcdsaPublicKeyPem": config.StringVariable(rTlsEcdsaPublicKeyPem), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/ivs/recording_configuration.go b/internal/service/ivs/recording_configuration.go index 1ea458d481fc..264d8d7386a0 100644 --- a/internal/service/ivs/recording_configuration.go +++ b/internal/service/ivs/recording_configuration.go @@ -28,16 +28,15 @@ import ( // @SDKResource("aws_ivs_recording_configuration", name="Recording Configuration") // @Tags(identifierAttribute="id") +// @ArnIdentity +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ivs/types;awstypes.RecordingConfiguration") +// @Testing(preIdentityVersion="v6.7.0") func ResourceRecordingConfiguration() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceRecordingConfigurationCreate, ReadWithoutTimeout: resourceRecordingConfigurationRead, DeleteWithoutTimeout: resourceRecordingConfigurationDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(10 * time.Minute), diff --git a/internal/service/ivs/recording_configuration_identity_gen_test.go b/internal/service/ivs/recording_configuration_identity_gen_test.go new file mode 100644 index 000000000000..96c1549f0d46 --- /dev/null +++ b/internal/service/ivs/recording_configuration_identity_gen_test.go @@ -0,0 +1,283 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ivs_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ivs/types" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccIVSRecordingConfiguration_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.RecordingConfiguration + resourceName := "aws_ivs_recording_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckRecordingConfigurationDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRecordingConfigurationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccIVSRecordingConfiguration_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ivs_recording_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccIVSRecordingConfiguration_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.RecordingConfiguration + resourceName := "aws_ivs_recording_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSServiceID), + CheckDestroy: testAccCheckRecordingConfigurationDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRecordingConfigurationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/RecordingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/ivs/service_endpoint_resolver_gen.go b/internal/service/ivs/service_endpoint_resolver_gen.go index c6ee0852761c..a628c3127703 100644 --- a/internal/service/ivs/service_endpoint_resolver_gen.go +++ b/internal/service/ivs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ivs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ivs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ivs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index 0b6a36c62087..77a84c606fdf 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ivs/service_package_gen.go b/internal/service/ivs/service_package_gen.go index 8e3888894cdc..aa0c9fade5fb 100644 --- a/internal/service/ivs/service_package_gen.go +++ b/internal/service/ivs/service_package_gen.go @@ -47,6 +47,12 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: ResourcePlaybackKeyPair, @@ -56,6 +62,12 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: ResourceRecordingConfiguration, @@ -65,6 +77,12 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, } } diff --git a/internal/service/ivs/testdata/Channel/basic/main_gen.tf b/internal/service/ivs/testdata/Channel/basic/main_gen.tf new file mode 100644 index 000000000000..e723cb24c3db --- /dev/null +++ b/internal/service/ivs/testdata/Channel/basic/main_gen.tf @@ -0,0 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_channel" "test" { +} + diff --git a/internal/service/ivs/testdata/Channel/basic_v6.7.0/main_gen.tf b/internal/service/ivs/testdata/Channel/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..64afb8a40f9c --- /dev/null +++ b/internal/service/ivs/testdata/Channel/basic_v6.7.0/main_gen.tf @@ -0,0 +1,16 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_channel" "test" { +} + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ivs/testdata/Channel/region_override/main_gen.tf b/internal/service/ivs/testdata/Channel/region_override/main_gen.tf new file mode 100644 index 000000000000..37d874a6db3e --- /dev/null +++ b/internal/service/ivs/testdata/Channel/region_override/main_gen.tf @@ -0,0 +1,14 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_channel" "test" { + region = var.region + +} + + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ivs/testdata/PlaybackKeyPair/basic/main_gen.tf b/internal/service/ivs/testdata/PlaybackKeyPair/basic/main_gen.tf new file mode 100644 index 000000000000..e3dcd0d5b88a --- /dev/null +++ b/internal/service/ivs/testdata/PlaybackKeyPair/basic/main_gen.tf @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_playback_key_pair" "test" { + public_key = var.rTlsEcdsaPublicKeyPem +} + +variable "rTlsEcdsaPublicKeyPem" { + type = string + nullable = false +} + diff --git a/internal/service/ivs/testdata/PlaybackKeyPair/basic_v6.7.0/main_gen.tf b/internal/service/ivs/testdata/PlaybackKeyPair/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..3e98e5f8d35d --- /dev/null +++ b/internal/service/ivs/testdata/PlaybackKeyPair/basic_v6.7.0/main_gen.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_playback_key_pair" "test" { + public_key = var.rTlsEcdsaPublicKeyPem +} + +variable "rTlsEcdsaPublicKeyPem" { + type = string + nullable = false +} + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ivs/testdata/PlaybackKeyPair/region_override/main_gen.tf b/internal/service/ivs/testdata/PlaybackKeyPair/region_override/main_gen.tf new file mode 100644 index 000000000000..b3635d6a4618 --- /dev/null +++ b/internal/service/ivs/testdata/PlaybackKeyPair/region_override/main_gen.tf @@ -0,0 +1,20 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_playback_key_pair" "test" { + region = var.region + + public_key = var.rTlsEcdsaPublicKeyPem +} + +variable "rTlsEcdsaPublicKeyPem" { + type = string + nullable = false +} + + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ivs/testdata/RecordingConfiguration/basic/main_gen.tf b/internal/service/ivs/testdata/RecordingConfiguration/basic/main_gen.tf new file mode 100644 index 000000000000..0e7cdf30b057 --- /dev/null +++ b/internal/service/ivs/testdata/RecordingConfiguration/basic/main_gen.tf @@ -0,0 +1,21 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_recording_configuration" "test" { + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/ivs/testdata/RecordingConfiguration/basic_v6.7.0/main_gen.tf b/internal/service/ivs/testdata/RecordingConfiguration/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..9172bf532e34 --- /dev/null +++ b/internal/service/ivs/testdata/RecordingConfiguration/basic_v6.7.0/main_gen.tf @@ -0,0 +1,31 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_recording_configuration" "test" { + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ivs/testdata/RecordingConfiguration/region_override/main_gen.tf b/internal/service/ivs/testdata/RecordingConfiguration/region_override/main_gen.tf new file mode 100644 index 000000000000..37ea87b80c82 --- /dev/null +++ b/internal/service/ivs/testdata/RecordingConfiguration/region_override/main_gen.tf @@ -0,0 +1,31 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivs_recording_configuration" "test" { + region = var.region + + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +resource "aws_s3_bucket" "test" { + region = var.region + + bucket = var.rName + force_destroy = true +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ivs/testdata/tmpl/channel_tags.gtpl b/internal/service/ivs/testdata/tmpl/channel_tags.gtpl new file mode 100644 index 000000000000..0c2c9f1b1733 --- /dev/null +++ b/internal/service/ivs/testdata/tmpl/channel_tags.gtpl @@ -0,0 +1,4 @@ +resource "aws_ivs_channel" "test" { +{{- template "region" }} +{{- template "tags" }} +} diff --git a/internal/service/ivs/testdata/tmpl/playback_key_pair_tags.gtpl b/internal/service/ivs/testdata/tmpl/playback_key_pair_tags.gtpl new file mode 100644 index 000000000000..2b7e891e64ec --- /dev/null +++ b/internal/service/ivs/testdata/tmpl/playback_key_pair_tags.gtpl @@ -0,0 +1,5 @@ +resource "aws_ivs_playback_key_pair" "test" { +{{- template "region" }} + public_key = var.rTlsEcdsaPublicKeyPem +{{- template "tags" }} +} diff --git a/internal/service/ivs/testdata/tmpl/recording_configuration_tags.gtpl b/internal/service/ivs/testdata/tmpl/recording_configuration_tags.gtpl new file mode 100644 index 000000000000..b38a11e9be2c --- /dev/null +++ b/internal/service/ivs/testdata/tmpl/recording_configuration_tags.gtpl @@ -0,0 +1,15 @@ +resource "aws_ivs_recording_configuration" "test" { +{{- template "region" }} + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +{{- template "tags" }} +} + +resource "aws_s3_bucket" "test" { +{{- template "region" }} + bucket = var.rName + force_destroy = true +} diff --git a/internal/service/ivschat/generate.go b/internal/service/ivschat/generate.go index 0bcf935ada23..5ac899821a9a 100644 --- a/internal/service/ivschat/generate.go +++ b/internal/service/ivschat/generate.go @@ -3,6 +3,7 @@ //go:generate go run ../../generate/tags/main.go -ListTags -ServiceTagsMap -UpdateTags -KVTValues //go:generate go run ../../generate/servicepackage/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package ivschat diff --git a/internal/service/ivschat/logging_configuration.go b/internal/service/ivschat/logging_configuration.go index fd261f4636f5..3bc150229764 100644 --- a/internal/service/ivschat/logging_configuration.go +++ b/internal/service/ivschat/logging_configuration.go @@ -25,6 +25,9 @@ import ( // @SDKResource("aws_ivschat_logging_configuration", name="Logging Configuration") // @Tags(identifierAttribute="id") +// @ArnIdentity +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ivschat;ivschat.GetLoggingConfigurationOutput") +// @Testing(preIdentityVersion="v6.5.0") func ResourceLoggingConfiguration() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceLoggingConfigurationCreate, @@ -32,10 +35,6 @@ func ResourceLoggingConfiguration() *schema.Resource { UpdateWithoutTimeout: resourceLoggingConfigurationUpdate, DeleteWithoutTimeout: resourceLoggingConfigurationDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Update: schema.DefaultTimeout(5 * time.Minute), diff --git a/internal/service/ivschat/logging_configuration_identity_gen_test.go b/internal/service/ivschat/logging_configuration_identity_gen_test.go new file mode 100644 index 000000000000..7d990a0de8a2 --- /dev/null +++ b/internal/service/ivschat/logging_configuration_identity_gen_test.go @@ -0,0 +1,283 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ivschat_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/ivschat" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccIVSChatLoggingConfiguration_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v ivschat.GetLoggingConfigurationOutput + resourceName := "aws_ivschat_logging_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckLoggingConfigurationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccIVSChatLoggingConfiguration_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ivschat_logging_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.5.0 +func TestAccIVSChatLoggingConfiguration_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v ivschat.GetLoggingConfigurationOutput + resourceName := "aws_ivschat_logging_configuration.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic_v6.5.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckLoggingConfigurationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/LoggingConfiguration/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/ivschat/room.go b/internal/service/ivschat/room.go index dffb4fd7970d..a61867da6d3c 100644 --- a/internal/service/ivschat/room.go +++ b/internal/service/ivschat/room.go @@ -27,6 +27,10 @@ import ( // @SDKResource("aws_ivschat_room", name="Room") // @Tags(identifierAttribute="id") +// @ArnIdentity +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ivschat;ivschat.GetRoomOutput") +// @Testing(preIdentityVersion="v6.5.0") +// @Testing(generator=false) func ResourceRoom() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceRoomCreate, @@ -34,10 +38,6 @@ func ResourceRoom() *schema.Resource { UpdateWithoutTimeout: resourceRoomUpdate, DeleteWithoutTimeout: resourceRoomDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Update: schema.DefaultTimeout(5 * time.Minute), diff --git a/internal/service/ivschat/room_identity_gen_test.go b/internal/service/ivschat/room_identity_gen_test.go new file mode 100644 index 000000000000..678191a168e9 --- /dev/null +++ b/internal/service/ivschat/room_identity_gen_test.go @@ -0,0 +1,261 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ivschat_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/ivschat" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccIVSChatRoom_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v ivschat.GetRoomOutput + resourceName := "aws_ivschat_room.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: testAccCheckRoomDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Room/basic/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoomExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Room/basic/"), + ConfigVariables: config.Variables{}, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Room/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Room/basic/"), + ConfigVariables: config.Variables{}, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccIVSChatRoom_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ivschat_room.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Room/region_override/"), + ConfigVariables: config.Variables{ + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.5.0 +func TestAccIVSChatRoom_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v ivschat.GetRoomOutput + resourceName := "aws_ivschat_room.test" + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IVSChatServiceID), + CheckDestroy: testAccCheckRoomDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Room/basic_v6.5.0/"), + ConfigVariables: config.Variables{}, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoomExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Room/basic/"), + ConfigVariables: config.Variables{}, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/ivschat/service_endpoint_resolver_gen.go b/internal/service/ivschat/service_endpoint_resolver_gen.go index 8717de5d415a..b1be53e68398 100644 --- a/internal/service/ivschat/service_endpoint_resolver_gen.go +++ b/internal/service/ivschat/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ivschat.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ivschat endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ivschat endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index 56b283058817..fdf9d3c2d6ab 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ivschat/service_package_gen.go b/internal/service/ivschat/service_package_gen.go index 7d3e4396b603..02274ce5eadc 100644 --- a/internal/service/ivschat/service_package_gen.go +++ b/internal/service/ivschat/service_package_gen.go @@ -40,6 +40,12 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: ResourceRoom, @@ -49,6 +55,12 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, } } diff --git a/internal/service/ivschat/testdata/LoggingConfiguration/basic/main_gen.tf b/internal/service/ivschat/testdata/LoggingConfiguration/basic/main_gen.tf new file mode 100644 index 000000000000..a19d91f69070 --- /dev/null +++ b/internal/service/ivschat/testdata/LoggingConfiguration/basic/main_gen.tf @@ -0,0 +1,21 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_ivschat_logging_configuration" "test" { + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/ivschat/testdata/LoggingConfiguration/basic_v6.5.0/main_gen.tf b/internal/service/ivschat/testdata/LoggingConfiguration/basic_v6.5.0/main_gen.tf new file mode 100644 index 000000000000..637e2febdc7b --- /dev/null +++ b/internal/service/ivschat/testdata/LoggingConfiguration/basic_v6.5.0/main_gen.tf @@ -0,0 +1,31 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_ivschat_logging_configuration" "test" { + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.5.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ivschat/testdata/LoggingConfiguration/region_override/main_gen.tf b/internal/service/ivschat/testdata/LoggingConfiguration/region_override/main_gen.tf new file mode 100644 index 000000000000..592b286629a1 --- /dev/null +++ b/internal/service/ivschat/testdata/LoggingConfiguration/region_override/main_gen.tf @@ -0,0 +1,31 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_s3_bucket" "test" { + region = var.region + + bucket = var.rName + force_destroy = true +} + +resource "aws_ivschat_logging_configuration" "test" { + region = var.region + + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ivschat/testdata/Room/basic/main_gen.tf b/internal/service/ivschat/testdata/Room/basic/main_gen.tf new file mode 100644 index 000000000000..8cc01c33bdcc --- /dev/null +++ b/internal/service/ivschat/testdata/Room/basic/main_gen.tf @@ -0,0 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivschat_room" "test" { +} + diff --git a/internal/service/ivschat/testdata/Room/basic_v6.5.0/main_gen.tf b/internal/service/ivschat/testdata/Room/basic_v6.5.0/main_gen.tf new file mode 100644 index 000000000000..07b528f5a951 --- /dev/null +++ b/internal/service/ivschat/testdata/Room/basic_v6.5.0/main_gen.tf @@ -0,0 +1,16 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivschat_room" "test" { +} + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.5.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ivschat/testdata/Room/region_override/main_gen.tf b/internal/service/ivschat/testdata/Room/region_override/main_gen.tf new file mode 100644 index 000000000000..bbc646144fa1 --- /dev/null +++ b/internal/service/ivschat/testdata/Room/region_override/main_gen.tf @@ -0,0 +1,14 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ivschat_room" "test" { + region = var.region + +} + + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ivschat/testdata/tmpl/logging_configuration_basic.gtpl b/internal/service/ivschat/testdata/tmpl/logging_configuration_basic.gtpl new file mode 100644 index 000000000000..66a5ca753ecb --- /dev/null +++ b/internal/service/ivschat/testdata/tmpl/logging_configuration_basic.gtpl @@ -0,0 +1,15 @@ +resource "aws_s3_bucket" "test" { +{{- template "region" }} + bucket = var.rName + force_destroy = true +} + +resource "aws_ivschat_logging_configuration" "test" { +{{- template "region" }} + destination_configuration { + s3 { + bucket_name = aws_s3_bucket.test.id + } + } +{{- template "tags" }} +} diff --git a/internal/service/ivschat/testdata/tmpl/room_basic.gtpl b/internal/service/ivschat/testdata/tmpl/room_basic.gtpl new file mode 100644 index 000000000000..68fe84f05daa --- /dev/null +++ b/internal/service/ivschat/testdata/tmpl/room_basic.gtpl @@ -0,0 +1,4 @@ +resource "aws_ivschat_room" "test" { +{{- template "region" }} +{{- template "tags" }} +} diff --git a/internal/service/kafka/service_endpoint_resolver_gen.go b/internal/service/kafka/service_endpoint_resolver_gen.go index f630adba87d7..5c6d825a7a90 100644 --- a/internal/service/kafka/service_endpoint_resolver_gen.go +++ b/internal/service/kafka/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kafka.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kafka endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kafka endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index 55ab24355e59..5b4648485749 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kafkaconnect/service_endpoint_resolver_gen.go b/internal/service/kafkaconnect/service_endpoint_resolver_gen.go index 14ac41d0f2a6..916f5faafc75 100644 --- a/internal/service/kafkaconnect/service_endpoint_resolver_gen.go +++ b/internal/service/kafkaconnect/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kafkaconnect.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kafkaconnect endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kafkaconnect endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index 92efbec1d4d7..cf6d789df172 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kendra/service_endpoint_resolver_gen.go b/internal/service/kendra/service_endpoint_resolver_gen.go index 2afb9523ce70..8455b39b66be 100644 --- a/internal/service/kendra/service_endpoint_resolver_gen.go +++ b/internal/service/kendra/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kendra.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kendra endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kendra endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index b2a707e5c93b..a3fe0267dd76 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/keyspaces/service_endpoint_resolver_gen.go b/internal/service/keyspaces/service_endpoint_resolver_gen.go index f577c6391862..bdf6ee7a3666 100644 --- a/internal/service/keyspaces/service_endpoint_resolver_gen.go +++ b/internal/service/keyspaces/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params keyspaces.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up keyspaces endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up keyspaces endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index c39ffd975b9e..10c9b12d2d23 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kinesis/resource_policy.go b/internal/service/kinesis/resource_policy.go index 7055199d360b..c58ce58b05e0 100644 --- a/internal/service/kinesis/resource_policy.go +++ b/internal/service/kinesis/resource_policy.go @@ -30,6 +30,7 @@ import ( // @Testing(useAlternateAccount=true) // We need to ignore `policy` because the JSON body is not normalized // @Testing(importIgnore="policy") +// @Testing(preIdentityVersion="v5.100.0") func newResourcePolicyResource(context.Context) (resource.ResourceWithConfigure, error) { r := &resourcePolicyResource{} diff --git a/internal/service/kinesis/resource_policy_identity_gen_test.go b/internal/service/kinesis/resource_policy_identity_gen_test.go index ab195ea8145a..7aaf58b42f4b 100644 --- a/internal/service/kinesis/resource_policy_identity_gen_test.go +++ b/internal/service/kinesis/resource_policy_identity_gen_test.go @@ -22,11 +22,12 @@ import ( func TestAccKinesisResourcePolicy_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_kinesis_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) providers := make(map[string]*schema.Provider) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -125,7 +126,7 @@ func TestAccKinesisResourcePolicy_Identity_RegionOverride(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) providers := make(map[string]*schema.Provider) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -261,11 +262,12 @@ func TestAccKinesisResourcePolicy_Identity_RegionOverride(t *testing.T) { func TestAccKinesisResourcePolicy_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_kinesis_resource_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) providers := make(map[string]*schema.Provider) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/kinesis/service_endpoint_resolver_gen.go b/internal/service/kinesis/service_endpoint_resolver_gen.go index 3edcc3caae73..167fa695398d 100644 --- a/internal/service/kinesis/service_endpoint_resolver_gen.go +++ b/internal/service/kinesis/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kinesis.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kinesis endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kinesis endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index 734406afa2ec..a37dde067565 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kinesisanalytics/service_endpoint_resolver_gen.go b/internal/service/kinesisanalytics/service_endpoint_resolver_gen.go index 3c7aab734f5c..d9e9a2a8b185 100644 --- a/internal/service/kinesisanalytics/service_endpoint_resolver_gen.go +++ b/internal/service/kinesisanalytics/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kinesisanalytics }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kinesisanalytics endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kinesisanalytics endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index 9aa9596d3490..0bc29660d7a4 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kinesisanalyticsv2/service_endpoint_resolver_gen.go b/internal/service/kinesisanalyticsv2/service_endpoint_resolver_gen.go index 0aa1230e6c2e..1f636c3211a1 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoint_resolver_gen.go +++ b/internal/service/kinesisanalyticsv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kinesisanalytics }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kinesisanalyticsv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kinesisanalyticsv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index 37b09c9136a9..90c73901aef5 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kinesisvideo/service_endpoint_resolver_gen.go b/internal/service/kinesisvideo/service_endpoint_resolver_gen.go index 4f75f7349b10..d644d3f303c6 100644 --- a/internal/service/kinesisvideo/service_endpoint_resolver_gen.go +++ b/internal/service/kinesisvideo/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kinesisvideo.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kinesisvideo endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kinesisvideo endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index d7c799d9c2e9..733ad25109e2 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kms/alias.go b/internal/service/kms/alias.go index 84f9e6ada5ed..cad38e222d69 100644 --- a/internal/service/kms/alias.go +++ b/internal/service/kms/alias.go @@ -81,7 +81,7 @@ func resourceAliasCreate(ctx context.Context, d *schema.ResourceData, meta any) TargetKeyId: aws.String(d.Get("target_key_id").(string)), } - _, err := tfresource.RetryWhenIsA[*awstypes.NotFoundException](ctx, keyRotationUpdatedTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.NotFoundException](ctx, keyRotationUpdatedTimeout, func(ctx context.Context) (any, error) { return conn.CreateAlias(ctx, input) }) diff --git a/internal/service/kms/external_key.go b/internal/service/kms/external_key.go index c56188d1fe03..c2ef4a101460 100644 --- a/internal/service/kms/external_key.go +++ b/internal/service/kms/external_key.go @@ -344,7 +344,7 @@ func importExternalKeyMaterial(ctx context.Context, conn *kms.Client, resourceTy } // Wait for propagation since KMS is eventually consistent. - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.NotFoundException](ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.NotFoundException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.GetParametersForImport(ctx, &inputGPFI) }) @@ -387,7 +387,7 @@ func importExternalKeyMaterial(ctx context.Context, conn *kms.Client, resourceTy } // Wait for propagation since KMS is eventually consistent. - _, err = tfresource.RetryWhenIsA[*awstypes.NotFoundException](ctx, propagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.NotFoundException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.ImportKeyMaterial(ctx, &inputIKM) }) diff --git a/internal/service/kms/external_key_tags_gen_test.go b/internal/service/kms/external_key_tags_gen_test.go index 0a2013d84752..943a22d6a048 100644 --- a/internal/service/kms/external_key_tags_gen_test.go +++ b/internal/service/kms/external_key_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccKMSExternalKey_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccKMSExternalKey_tags(t *testing.T) { func TestAccKMSExternalKey_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccKMSExternalKey_tags_null(t *testing.T) { func TestAccKMSExternalKey_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccKMSExternalKey_tags_EmptyMap(t *testing.T) { func TestAccKMSExternalKey_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccKMSExternalKey_tags_AddOnUpdate(t *testing.T) { func TestAccKMSExternalKey_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccKMSExternalKey_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccKMSExternalKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccKMSExternalKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccKMSExternalKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccKMSExternalKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_overlapping(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccKMSExternalKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccKMSExternalKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccKMSExternalKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccKMSExternalKey_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccKMSExternalKey_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccKMSExternalKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccKMSExternalKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccKMSExternalKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccKMSExternalKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSExternalKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccKMSExternalKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccKMSExternalKey_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/kms/key.go b/internal/service/kms/key.go index 83df9c4a511f..fcbd44af6f37 100644 --- a/internal/service/kms/key.go +++ b/internal/service/kms/key.go @@ -526,7 +526,7 @@ func updateKeyDescription(ctx context.Context, conn *kms.Client, resourceTypeNam func updateKeyEnabled(ctx context.Context, conn *kms.Client, resourceTypeName, keyID string, enabled bool) error { var action string - updateFunc := func() (any, error) { + updateFunc := func(ctx context.Context) (any, error) { var err error if enabled { @@ -548,7 +548,7 @@ func updateKeyEnabled(ctx context.Context, conn *kms.Client, resourceTypeName, k return nil, err } - if _, err := tfresource.RetryWhenIsA[*awstypes.NotFoundException](ctx, propagationTimeout, updateFunc); err != nil { + if _, err := tfresource.RetryWhenIsA[any, *awstypes.NotFoundException](ctx, propagationTimeout, updateFunc); err != nil { return fmt.Errorf("%s %s (%s): %w", action, resourceTypeName, keyID, err) } diff --git a/internal/service/kms/key_tags_gen_test.go b/internal/service/kms/key_tags_gen_test.go index 9ec98cda5521..0c1417e922ba 100644 --- a/internal/service/kms/key_tags_gen_test.go +++ b/internal/service/kms/key_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccKMSKey_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccKMSKey_tags(t *testing.T) { func TestAccKMSKey_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccKMSKey_tags_null(t *testing.T) { func TestAccKMSKey_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccKMSKey_tags_EmptyMap(t *testing.T) { func TestAccKMSKey_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccKMSKey_tags_AddOnUpdate(t *testing.T) { func TestAccKMSKey_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccKMSKey_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccKMSKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccKMSKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccKMSKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccKMSKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccKMSKey_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccKMSKey_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccKMSKey_tags_DefaultTags_overlapping(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccKMSKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccKMSKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccKMSKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccKMSKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccKMSKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccKMSKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccKMSKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) func TestAccKMSKey_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccKMSKey_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccKMSKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccKMSKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccKMSKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccKMSKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccKMSKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccKMSKey_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/kms/replica_external_key_tags_gen_test.go b/internal/service/kms/replica_external_key_tags_gen_test.go index 65218dead0ec..404ce312d57e 100644 --- a/internal/service/kms/replica_external_key_tags_gen_test.go +++ b/internal/service/kms/replica_external_key_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccKMSReplicaExternalKey_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -227,6 +228,7 @@ func TestAccKMSReplicaExternalKey_tags(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func TestAccKMSReplicaExternalKey_tags_null(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -373,6 +376,7 @@ func TestAccKMSReplicaExternalKey_tags_EmptyMap(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -462,6 +466,7 @@ func TestAccKMSReplicaExternalKey_tags_AddOnUpdate(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -564,6 +569,7 @@ func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -716,6 +722,7 @@ func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -813,6 +820,7 @@ func TestAccKMSReplicaExternalKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1014,6 +1022,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1189,6 +1198,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccKMSReplicaExternalKey_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1380,6 +1390,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_overlapping(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1476,6 +1487,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccKMSReplicaExternalKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1571,6 +1583,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccKMSReplicaExternalKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1641,6 +1654,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccKMSReplicaExternalKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1703,6 +1717,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccKMSReplicaExternalKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1770,6 +1785,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccKMSReplicaExternalKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1837,6 +1853,7 @@ func TestAccKMSReplicaExternalKey_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1897,6 +1914,7 @@ func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2018,7 @@ func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2093,6 +2112,7 @@ func TestAccKMSReplicaExternalKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccKMSReplicaExternalKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2258,6 +2278,7 @@ func TestAccKMSReplicaExternalKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccKMSReplicaExternalKey_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_external_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/kms/replica_key_tags_gen_test.go b/internal/service/kms/replica_key_tags_gen_test.go index f96437dfeef7..36bdfd1e0f11 100644 --- a/internal/service/kms/replica_key_tags_gen_test.go +++ b/internal/service/kms/replica_key_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccKMSReplicaKey_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -227,6 +228,7 @@ func TestAccKMSReplicaKey_tags(t *testing.T) { func TestAccKMSReplicaKey_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func TestAccKMSReplicaKey_tags_null(t *testing.T) { func TestAccKMSReplicaKey_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -373,6 +376,7 @@ func TestAccKMSReplicaKey_tags_EmptyMap(t *testing.T) { func TestAccKMSReplicaKey_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -462,6 +466,7 @@ func TestAccKMSReplicaKey_tags_AddOnUpdate(t *testing.T) { func TestAccKMSReplicaKey_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -564,6 +569,7 @@ func TestAccKMSReplicaKey_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccKMSReplicaKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -716,6 +722,7 @@ func TestAccKMSReplicaKey_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccKMSReplicaKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -813,6 +820,7 @@ func TestAccKMSReplicaKey_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1014,6 +1022,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1189,6 +1198,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1380,6 +1390,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_overlapping(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1476,6 +1487,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1571,6 +1583,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1641,6 +1654,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1703,6 +1717,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccKMSReplicaKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1770,6 +1785,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccKMSReplicaKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1837,6 +1853,7 @@ func TestAccKMSReplicaKey_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccKMSReplicaKey_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1897,6 +1914,7 @@ func TestAccKMSReplicaKey_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccKMSReplicaKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2018,7 @@ func TestAccKMSReplicaKey_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccKMSReplicaKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2093,6 +2112,7 @@ func TestAccKMSReplicaKey_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccKMSReplicaKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2258,6 +2278,7 @@ func TestAccKMSReplicaKey_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccKMSReplicaKey_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.KeyMetadata resourceName := "aws_kms_replica_key.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/kms/service_endpoint_resolver_gen.go b/internal/service/kms/service_endpoint_resolver_gen.go index 08c41e961bf9..c1e957586204 100644 --- a/internal/service/kms/service_endpoint_resolver_gen.go +++ b/internal/service/kms/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params kms.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up kms endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up kms endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index 2a0b90ee98eb..e8bc3eb9955b 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/kms/wait.go b/internal/service/kms/wait.go index 2df46fae0bdd..e78439ada58f 100644 --- a/internal/service/kms/wait.go +++ b/internal/service/kms/wait.go @@ -26,7 +26,7 @@ const ( // waitIAMPropagation retries the specified function if the returned error indicates an IAM eventual consistency issue. func waitIAMPropagation[T any](ctx context.Context, timeout time.Duration, f func() (T, error)) (T, error) { - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.MalformedPolicyDocumentException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.MalformedPolicyDocumentException](ctx, timeout, func(ctx context.Context) (any, error) { return f() }) diff --git a/internal/service/lakeformation/service_endpoint_resolver_gen.go b/internal/service/lakeformation/service_endpoint_resolver_gen.go index 2aa2369a6f2a..cf6e51e08a0d 100644 --- a/internal/service/lakeformation/service_endpoint_resolver_gen.go +++ b/internal/service/lakeformation/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params lakeformation.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up lakeformation endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up lakeformation endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index 8dea8993a7b6..6ed645eadb17 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/lambda/event_source_mapping.go b/internal/service/lambda/event_source_mapping.go index deaf755b6a79..a95491e38856 100644 --- a/internal/service/lambda/event_source_mapping.go +++ b/internal/service/lambda/event_source_mapping.go @@ -821,7 +821,7 @@ func resourceEventSourceMappingDelete(ctx context.Context, d *schema.ResourceDat const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.ResourceInUseException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceInUseException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteEventSourceMapping(ctx, &lambda.DeleteEventSourceMappingInput{ UUID: aws.String(d.Id()), }) diff --git a/internal/service/lambda/function.go b/internal/service/lambda/function.go index 79f7500fcf03..468c1a3fb89c 100644 --- a/internal/service/lambda/function.go +++ b/internal/service/lambda/function.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -44,6 +45,10 @@ const ( // @Tags(identifierAttribute="arn") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/lambda;lambda.GetFunctionOutput") // @Testing(importIgnore="filename;last_modified;publish") +// @IdentityAttribute("function_name") +// @Testing(idAttrDuplicates="function_name") +// @Testing(preIdentityVersion="v6.7.0") +// @CustomImport func resourceFunction() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceFunctionCreate, @@ -59,6 +64,10 @@ func resourceFunction() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) { + identitySpec := importer.IdentitySpec(ctx) + if err := importer.RegionalSingleParameterized(ctx, d, identitySpec, meta.(importer.AWSClient)); err != nil { + return nil, err + } d.Set("function_name", d.Id()) return []*schema.ResourceData{d}, nil }, @@ -645,6 +654,20 @@ func resourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta any) return sdkdiag.AppendErrorf(diags, "reading Lambda Function (%s): %s", d.Id(), err) } + // If Qualifier is specified, GetFunction will return nil for Concurrency. + // Need to fetch it separately using GetFunctionConcurrency. + if output.Concurrency == nil && input.Qualifier != nil { + outputGFC, err := findFunctionConcurrencyByName(ctx, conn, d.Id()) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Lambda Function (%s) concurrency: %s", d.Id(), err) + } + + output.Concurrency = &awstypes.Concurrency{ + ReservedConcurrentExecutions: outputGFC.ReservedConcurrentExecutions, + } + } + function := output.Configuration d.Set("architectures", function.Architectures) functionARN := aws.ToString(function.FunctionArn) @@ -1079,11 +1102,11 @@ func resourceFunctionDelete(ctx context.Context, d *schema.ResourceData, meta an } func findFunctionByName(ctx context.Context, conn *lambda.Client, name string) (*lambda.GetFunctionOutput, error) { - input := &lambda.GetFunctionInput{ + input := lambda.GetFunctionInput{ FunctionName: aws.String(name), } - return findFunction(ctx, conn, input) + return findFunction(ctx, conn, &input) } func findFunction(ctx context.Context, conn *lambda.Client, input *lambda.GetFunctionInput) (*lambda.GetFunctionOutput, error) { @@ -1140,13 +1163,13 @@ func findFunctionConfiguration(ctx context.Context, conn *lambda.Client, input * } func findLatestFunctionVersionByName(ctx context.Context, conn *lambda.Client, name string) (*awstypes.FunctionConfiguration, error) { - input := &lambda.ListVersionsByFunctionInput{ + input := lambda.ListVersionsByFunctionInput{ FunctionName: aws.String(name), MaxItems: aws.Int32(listVersionsMaxItems), } var output *awstypes.FunctionConfiguration - pages := lambda.NewListVersionsByFunctionPaginator(conn, input) + pages := lambda.NewListVersionsByFunctionPaginator(conn, &input) for pages.HasMorePages() { page, err := pages.NextPage(ctx) @@ -1167,6 +1190,35 @@ func findLatestFunctionVersionByName(ctx context.Context, conn *lambda.Client, n return output, nil } +func findFunctionConcurrencyByName(ctx context.Context, conn *lambda.Client, name string) (*lambda.GetFunctionConcurrencyOutput, error) { + input := lambda.GetFunctionConcurrencyInput{ + FunctionName: aws.String(name), + } + + return findFunctionConcurrency(ctx, conn, &input) +} + +func findFunctionConcurrency(ctx context.Context, conn *lambda.Client, input *lambda.GetFunctionConcurrencyInput) (*lambda.GetFunctionConcurrencyOutput, error) { + output, err := conn.GetFunctionConcurrency(ctx, input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + // replaceSecurityGroupsOnDestroy sets the VPC configuration security groups // prior to resource destruction // diff --git a/internal/service/lambda/function_data_source.go b/internal/service/lambda/function_data_source.go index faf8e3152859..f46d08b550a5 100644 --- a/internal/service/lambda/function_data_source.go +++ b/internal/service/lambda/function_data_source.go @@ -282,6 +282,20 @@ func dataSourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta an return sdkdiag.AppendErrorf(diags, "reading Lambda Function (%s): %s", functionName, err) } + // If Qualifier is specified, GetFunction will return nil for Concurrency. + // Need to fetch it separately using GetFunctionConcurrency. + if output.Concurrency == nil && input.Qualifier != nil { + outputGFC, err := findFunctionConcurrencyByName(ctx, conn, functionName) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Lambda Function (%s) concurrency: %s", functionName, err) + } + + output.Concurrency = &awstypes.Concurrency{ + ReservedConcurrentExecutions: outputGFC.ReservedConcurrentExecutions, + } + } + function := output.Configuration functionARN := aws.ToString(function.FunctionArn) qualifierSuffix := fmt.Sprintf(":%s", aws.ToString(input.Qualifier)) diff --git a/internal/service/lambda/function_data_source_tags_gen_test.go b/internal/service/lambda/function_data_source_tags_gen_test.go index 92ca9a145352..a5ae81c88a78 100644 --- a/internal/service/lambda/function_data_source_tags_gen_test.go +++ b/internal/service/lambda/function_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccLambdaFunctionDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccLambdaFunctionDataSource_tags(t *testing.T) { func TestAccLambdaFunctionDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccLambdaFunctionDataSource_tags_NullMap(t *testing.T) { func TestAccLambdaFunctionDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccLambdaFunctionDataSource_tags_EmptyMap(t *testing.T) { func TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping(t *testing. func TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/lambda/function_data_source_test.go b/internal/service/lambda/function_data_source_test.go index d324c03fe559..77efcf82158e 100644 --- a/internal/service/lambda/function_data_source_test.go +++ b/internal/service/lambda/function_data_source_test.go @@ -91,6 +91,33 @@ func TestAccLambdaFunctionDataSource_version(t *testing.T) { }) } +func TestAccLambdaFunctionDataSource_versionWithReservedConcurrency(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + dataSourceName := "data.aws_lambda_function.test" + resourceName := "aws_lambda_function.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccFunctionDataSourceConfig_versionWithReservedConcurrency(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, names.AttrARN, resourceName, names.AttrARN), + resource.TestCheckResourceAttrPair(dataSourceName, "invoke_arn", resourceName, "invoke_arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "qualified_arn", resourceName, "qualified_arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "qualified_invoke_arn", resourceName, "qualified_invoke_arn"), + resource.TestCheckResourceAttr(dataSourceName, "qualifier", "1"), + resource.TestCheckResourceAttrPair(dataSourceName, "reserved_concurrent_executions", resourceName, "reserved_concurrent_executions"), + resource.TestCheckResourceAttr(dataSourceName, names.AttrVersion, "1"), + ), + }, + }, + }) +} + func TestAccLambdaFunctionDataSource_latestVersion(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -469,6 +496,25 @@ data "aws_lambda_function" "test" { `, rName)) } +func testAccFunctionDataSourceConfig_versionWithReservedConcurrency(rName string) string { + return acctest.ConfigCompose(testAccFunctionDataSourceConfig_base(rName), fmt.Sprintf(` +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = %[1]q + handler = "exports.example" + publish = true + role = aws_iam_role.lambda.arn + runtime = "nodejs20.x" + reserved_concurrent_executions = 10 +} + +data "aws_lambda_function" "test" { + function_name = aws_lambda_function.test.function_name + qualifier = 1 +} +`, rName)) +} + func testAccFunctionDataSourceConfig_latestVersion(rName string) string { return acctest.ConfigCompose(testAccFunctionDataSourceConfig_base(rName), fmt.Sprintf(` resource "aws_lambda_function" "test" { diff --git a/internal/service/lambda/function_identity_gen_test.go b/internal/service/lambda/function_identity_gen_test.go new file mode 100644 index 000000000000..cbc2beb18a8e --- /dev/null +++ b/internal/service/lambda/function_identity_gen_test.go @@ -0,0 +1,270 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package lambda_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/lambda" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccLambdaFunction_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v lambda.GetFunctionOutput + resourceName := "aws_lambda_function.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaServiceID), + CheckDestroy: testAccCheckFunctionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Function/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("function_name"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + "function_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("function_name")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Function/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "filename", "last_modified", "publish", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Function/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("function_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Function/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("function_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccLambdaFunction_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_lambda_function.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Function/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("function_name"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + "function_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("function_name")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Function/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "filename", "last_modified", "publish", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Function/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("function_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Function/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("function_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccLambdaFunction_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v lambda.GetFunctionOutput + resourceName := "aws_lambda_function.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaServiceID), + CheckDestroy: testAccCheckFunctionDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Function/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Function/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + "function_name": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("function_name")), + }, + }, + }, + }) +} diff --git a/internal/service/lambda/function_tags_gen_test.go b/internal/service/lambda/function_tags_gen_test.go index 3585afaa4f95..8d73de511a1d 100644 --- a/internal/service/lambda/function_tags_gen_test.go +++ b/internal/service/lambda/function_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccLambdaFunction_tags(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccLambdaFunction_tags(t *testing.T) { func TestAccLambdaFunction_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccLambdaFunction_tags_null(t *testing.T) { func TestAccLambdaFunction_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccLambdaFunction_tags_EmptyMap(t *testing.T) { func TestAccLambdaFunction_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccLambdaFunction_tags_AddOnUpdate(t *testing.T) { func TestAccLambdaFunction_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccLambdaFunction_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccLambdaFunction_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccLambdaFunction_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccLambdaFunction_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccLambdaFunction_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccLambdaFunction_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccLambdaFunction_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccLambdaFunction_tags_DefaultTags_overlapping(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccLambdaFunction_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccLambdaFunction_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccLambdaFunction_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccLambdaFunction_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccLambdaFunction_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccLambdaFunction_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccLambdaFunction_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccLambdaFunction_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccLambdaFunction_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccLambdaFunction_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccLambdaFunction_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccLambdaFunction_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccLambdaFunction_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccLambdaFunction_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccLambdaFunction_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccLambdaFunction_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccLambdaFunction_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v lambda.GetFunctionOutput resourceName := "aws_lambda_function.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 913f023bef7a..a391f41d41b6 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -273,6 +273,13 @@ func TestAccLambdaFunction_concurrency(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "reserved_concurrent_executions", "222"), ), }, + { + Config: testAccFunctionConfig_concurrencyPublished(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "reserved_concurrent_executions", "222"), + ), + }, }, }) } @@ -2838,6 +2845,22 @@ resource "aws_lambda_function" "test" { `, rName)) } +func testAccFunctionConfig_concurrencyPublished(rName string) string { + return acctest.ConfigCompose( + acctest.ConfigLambdaBase(rName, rName, rName), + fmt.Sprintf(` +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = %[1]q + role = aws_iam_role.iam_for_lambda.arn + handler = "exports.example" + publish = true + runtime = "nodejs20.x" + reserved_concurrent_executions = 222 +} +`, rName)) +} + func testAccFunctionConfig_noFilenameAndS3Attributes(rName string) string { return acctest.ConfigCompose( acctest.ConfigLambdaBase(rName, rName, rName), diff --git a/internal/service/lambda/generate.go b/internal/service/lambda/generate.go index ac5d23a89d0a..27dc09d38292 100644 --- a/internal/service/lambda/generate.go +++ b/internal/service/lambda/generate.go @@ -4,6 +4,7 @@ //go:generate go run ../../generate/tags/main.go -ServiceTagsMap -TagInIDElem=Resource -UpdateTags -ListTags -ListTagsInIDElem=Resource -ListTagsOp=ListTags -KVTValues //go:generate go run ../../generate/servicepackage/main.go //go:generate go run ../../generate/tagstests/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package lambda diff --git a/internal/service/lambda/invocation_ephemeral.go b/internal/service/lambda/invocation_ephemeral.go index 61c9b8f015e4..31183d554f47 100644 --- a/internal/service/lambda/invocation_ephemeral.go +++ b/internal/service/lambda/invocation_ephemeral.go @@ -118,6 +118,10 @@ func (e *invocationEphemeralResource) Open(ctx context.Context, req ephemeral.Op resp.Diagnostics.Append(flex.Flatten(ctx, output, &data)...) data.Result = flex.StringValueToFramework(ctx, string(output.Payload)) + // data.Payload field is originally meant to hold the input payload. + // However, during the flattening process, it is populated with the result payload. + // To correct this, the original input payload needs to be manually restored to data.Payload after flattening. + data.Payload = flex.StringValueToFramework(ctx, string(input.Payload)) resp.Diagnostics.Append(resp.Result.Set(ctx, &data)...) } diff --git a/internal/service/lambda/invocation_ephemeral_test.go b/internal/service/lambda/invocation_ephemeral_test.go index 04dc3ae00251..7975720127fa 100644 --- a/internal/service/lambda/invocation_ephemeral_test.go +++ b/internal/service/lambda/invocation_ephemeral_test.go @@ -40,7 +40,7 @@ func TestAccLambdaInvocationEphemeral_basic(t *testing.T) { statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey("executed_version"), knownvalue.StringExact("$LATEST")), statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey("function_name"), knownvalue.NotNull()), statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey("log_result"), knownvalue.Null()), - statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey("result"), knownvalue.StringExact(`{"key1":"value1","key2":"value2"}`)), + statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey("result"), knownvalue.StringExact(`{"output":{"key1":"value1","key2":"value2"}}`)), statecheck.ExpectKnownValue(echoResourceName, dp.AtMapKey(names.AttrStatusCode), knownvalue.NumberExact(big.NewFloat(200))), }, }, @@ -78,11 +78,11 @@ resource "aws_iam_role_policy_attachment" "test" { resource "aws_lambda_function" "test" { depends_on = [aws_iam_role_policy_attachment.test] - filename = "test-fixtures/lambda_invocation.zip" + filename = "test-fixtures/lambda_invocation_ephemeral.zip" function_name = %[1]q role = aws_iam_role.test.arn - handler = "lambda_invocation.handler" - runtime = "nodejs18.x" + handler = "lambda_invocation_ephemeral.handler" + runtime = "nodejs22.x" } ephemeral "aws_lambda_invocation" "test" { diff --git a/internal/service/lambda/service_endpoint_resolver_gen.go b/internal/service/lambda/service_endpoint_resolver_gen.go index 352d37b7029a..99ef0cb316f8 100644 --- a/internal/service/lambda/service_endpoint_resolver_gen.go +++ b/internal/service/lambda/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params lambda.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up lambda endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up lambda endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index 09ebd5889fd8..099487f9f93f 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/lambda/service_package_gen.go b/internal/service/lambda/service_package_gen.go index 7de9eef76ef6..3cdbabc99170 100644 --- a/internal/service/lambda/service_package_gen.go +++ b/internal/service/lambda/service_package_gen.go @@ -131,7 +131,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Tags: unique.Make(inttypes.ServicePackageResourceTags{ IdentifierAttribute: names.AttrARN, }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity("function_name"), + Import: inttypes.SDKv2Import{ + CustomImport: true, + }, }, { Factory: resourceFunctionEventInvokeConfig, diff --git a/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.js b/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.js new file mode 100644 index 000000000000..6b5c0f453f3e --- /dev/null +++ b/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: MPL-2.0 + */ + +exports.handler = async (event) => { + if (process.env.TEST_DATA) { + event.key3 = process.env.TEST_DATA; + } + return {output: event}; +} diff --git a/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.zip b/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.zip new file mode 100644 index 000000000000..78c1c53c2e2b Binary files /dev/null and b/internal/service/lambda/test-fixtures/lambda_invocation_ephemeral.zip differ diff --git a/internal/service/lambda/testdata/Function/basic/main_gen.tf b/internal/service/lambda/testdata/Function/basic/main_gen.tf new file mode 100644 index 000000000000..4433e6b2e4f5 --- /dev/null +++ b/internal/service/lambda/testdata/Function/basic/main_gen.tf @@ -0,0 +1,91 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = var.rName + role = aws_iam_role.test.arn + handler = "exports.example" + runtime = "nodejs20.x" +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = var.rName + + assume_role_policy = < 0 { + return tags + } + } + + return nil +} + +// setTagsOut sets odb service tags in Context. +func setTagsOut(ctx context.Context, tags map[string]string) { + if inContext, ok := tftags.FromContext(ctx); ok { + inContext.TagsOut = option.Some(keyValueTags(ctx, tags)) + } +} + +// updateTags updates odb service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func updateTags(ctx context.Context, conn *odb.Client, identifier string, oldTagsMap, newTagsMap any, optFns ...func(*odb.Options)) error { + oldTags := tftags.New(ctx, oldTagsMap) + newTags := tftags.New(ctx, newTagsMap) + + ctx = tflog.SetField(ctx, logging.KeyResourceId, identifier) + + removedTags := oldTags.Removed(newTags) + removedTags = removedTags.IgnoreSystem(names.ODB) + if len(removedTags) > 0 { + input := odb.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: removedTags.Keys(), + } + + _, err := conn.UntagResource(ctx, &input, optFns...) + + if err != nil { + return smarterr.NewError(err) + } + } + + updatedTags := oldTags.Updated(newTags) + updatedTags = updatedTags.IgnoreSystem(names.ODB) + if len(updatedTags) > 0 { + input := odb.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: svcTags(updatedTags), + } + + _, err := conn.TagResource(ctx, &input, optFns...) + + if err != nil { + return smarterr.NewError(err) + } + } + + return nil +} + +// UpdateTags updates odb service tags. +// It is called from outside this package. +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return updateTags(ctx, meta.(*conns.AWSClient).ODBClient(ctx), identifier, oldTags, newTags) +} diff --git a/internal/service/opensearch/domain_policy.go b/internal/service/opensearch/domain_policy.go index d49329aaea98..0d5f363b596f 100644 --- a/internal/service/opensearch/domain_policy.go +++ b/internal/service/opensearch/domain_policy.go @@ -6,6 +6,7 @@ package opensearch import ( "context" "log" + "strings" "time" "github.com/aws/aws-sdk-go-v2/aws" @@ -35,6 +36,10 @@ func resourceDomainPolicy() *schema.Resource { Delete: schema.DefaultTimeout(90 * time.Minute), }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Schema: map[string]*schema.Schema{ names.AttrDomainName: { Type: schema.TypeString, @@ -58,7 +63,8 @@ func resourceDomainPolicyRead(ctx context.Context, d *schema.ResourceData, meta var diags diag.Diagnostics conn := meta.(*conns.AWSClient).OpenSearchClient(ctx) - ds, err := findDomainByName(ctx, conn, d.Get(names.AttrDomainName).(string)) + domainName := strings.Replace(d.Id(), "esd-policy-", "", 1) + ds, err := findDomainByName(ctx, conn, domainName) if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] OpenSearch Domain Policy (%s) not found, removing from state", d.Id()) @@ -77,6 +83,7 @@ func resourceDomainPolicyRead(ctx context.Context, d *schema.ResourceData, meta } d.Set("access_policies", policies) + d.Set(names.AttrDomainName, ds.DomainName) return diags } diff --git a/internal/service/opensearch/domain_policy_test.go b/internal/service/opensearch/domain_policy_test.go index beb72c1b193f..aedf2920c163 100644 --- a/internal/service/opensearch/domain_policy_test.go +++ b/internal/service/opensearch/domain_policy_test.go @@ -21,6 +21,7 @@ func TestAccOpenSearchDomainPolicy_basic(t *testing.T) { ctx := acctest.Context(t) var domain awstypes.DomainStatus ri := sdkacctest.RandInt() + resourceName := "aws_opensearch_domain_policy.test" policy := `{ "Version": "2012-10-17", "Statement": [ @@ -69,10 +70,15 @@ func TestAccOpenSearchDomainPolicy_basic(t *testing.T) { } expectedPolicy := fmt.Sprintf(expectedPolicyTpl, expectedArn) - return testAccCheckPolicyMatch("aws_opensearch_domain_policy.test", "access_policies", expectedPolicy)(s) + return testAccCheckPolicyMatch(resourceName, "access_policies", expectedPolicy)(s) }, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/internal/service/opensearch/service_endpoint_resolver_gen.go b/internal/service/opensearch/service_endpoint_resolver_gen.go index 7c7b779105f0..c3659fc7a0cd 100644 --- a/internal/service/opensearch/service_endpoint_resolver_gen.go +++ b/internal/service/opensearch/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params opensearch.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up opensearch endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up opensearch endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index b9e35d5ce5f7..a51ffcd77acd 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/opensearchserverless/service_endpoint_resolver_gen.go b/internal/service/opensearchserverless/service_endpoint_resolver_gen.go index 51a4ec07e87e..0779dc1fb5c7 100644 --- a/internal/service/opensearchserverless/service_endpoint_resolver_gen.go +++ b/internal/service/opensearchserverless/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params opensearchserver }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up opensearchserverless endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up opensearchserverless endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index 14d81ea391e2..97b0f49dd2da 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/organizations/account.go b/internal/service/organizations/account.go index a2dd4d1a051a..f699f447fa6c 100644 --- a/internal/service/organizations/account.go +++ b/internal/service/organizations/account.go @@ -146,8 +146,8 @@ func resourceAccountCreate(ctx context.Context, d *schema.ResourceData, meta any input.RoleName = aws.String(v.(string)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, - func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, + func(ctx context.Context) (any, error) { return conn.CreateGovCloudAccount(ctx, input) }) @@ -171,8 +171,8 @@ func resourceAccountCreate(ctx context.Context, d *schema.ResourceData, meta any input.RoleName = aws.String(v.(string)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, - func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, + func(ctx context.Context) (any, error) { return conn.CreateAccount(ctx, input) }) diff --git a/internal/service/organizations/organization_identity_gen_test.go b/internal/service/organizations/organization_identity_gen_test.go index 88d7faac2352..75938ba67e30 100644 --- a/internal/service/organizations/organization_identity_gen_test.go +++ b/internal/service/organizations/organization_identity_gen_test.go @@ -36,7 +36,7 @@ func testAccOrganizationsOrganization_Identity_Basic(t *testing.T) { var v awstypes.Organization resourceName := "aws_organizations_organization.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func testAccOrganizationsOrganization_Identity_ExistingResource(t *testing.T) { var v awstypes.Organization resourceName := "aws_organizations_organization.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/organizations/organizational_unit.go b/internal/service/organizations/organizational_unit.go index 3d4cae4c5b46..08476f44b8ad 100644 --- a/internal/service/organizations/organizational_unit.go +++ b/internal/service/organizations/organizational_unit.go @@ -94,7 +94,7 @@ func resourceOrganizationalUnitCreate(ctx context.Context, d *schema.ResourceDat Tags: getTagsIn(ctx), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func(ctx context.Context) (any, error) { return conn.CreateOrganizationalUnit(ctx, input) }) diff --git a/internal/service/organizations/organizational_unit_identity_gen_test.go b/internal/service/organizations/organizational_unit_identity_gen_test.go index ec17a109d5fc..6bfd773a396c 100644 --- a/internal/service/organizations/organizational_unit_identity_gen_test.go +++ b/internal/service/organizations/organizational_unit_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccOrganizationsOrganizationalUnit_Identity_Basic(t *testing.T) { resourceName := "aws_organizations_organizational_unit.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -123,7 +123,7 @@ func testAccOrganizationsOrganizationalUnit_Identity_ExistingResource(t *testing resourceName := "aws_organizations_organizational_unit.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/organizations/organizational_unit_tags_gen_test.go b/internal/service/organizations/organizational_unit_tags_gen_test.go index efa4d5214ae6..9dcef93bebbe 100644 --- a/internal/service/organizations/organizational_unit_tags_gen_test.go +++ b/internal/service/organizations/organizational_unit_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccOrganizationsOrganizationalUnit_tagsSerial(t *testing.T) { func testAccOrganizationsOrganizationalUnit_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -232,6 +233,7 @@ func testAccOrganizationsOrganizationalUnit_tags(t *testing.T) { func testAccOrganizationsOrganizationalUnit_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func testAccOrganizationsOrganizationalUnit_tags_null(t *testing.T) { func testAccOrganizationsOrganizationalUnit_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -368,6 +371,7 @@ func testAccOrganizationsOrganizationalUnit_tags_EmptyMap(t *testing.T) { func testAccOrganizationsOrganizationalUnit_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -452,6 +456,7 @@ func testAccOrganizationsOrganizationalUnit_tags_AddOnUpdate(t *testing.T) { func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -544,6 +549,7 @@ func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnCreate(t *testing.T) func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -684,6 +690,7 @@ func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnUpdate_Add(t *testin func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -776,6 +783,7 @@ func testAccOrganizationsOrganizationalUnit_tags_EmptyTag_OnUpdate_Replace(t *te func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -960,6 +968,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_providerOnly(t *tes func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1123,6 +1132,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nonOverlapping(t *t func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1302,6 +1312,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_overlapping(t *test func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1395,6 +1406,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_updateToProviderOnl func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1499,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_updateToResourceOnl func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1555,6 +1568,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_emptyResourceTag(t func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1615,6 +1629,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_emptyProviderOnlyTa func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1680,6 +1695,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nullOverlappingReso func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1745,6 +1761,7 @@ func testAccOrganizationsOrganizationalUnit_tags_DefaultTags_nullNonOverlappingR func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1803,6 +1820,7 @@ func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnCreate(t *testing func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1903,6 +1921,7 @@ func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnUpdate_Add(t *tes func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1993,6 +2012,7 @@ func testAccOrganizationsOrganizationalUnit_tags_ComputedTag_OnUpdate_Replace(t func testAccOrganizationsOrganizationalUnit_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2158,6 +2178,7 @@ func testAccOrganizationsOrganizationalUnit_tags_IgnoreTags_Overlap_DefaultTag(t func testAccOrganizationsOrganizationalUnit_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.OrganizationalUnit resourceName := "aws_organizations_organizational_unit.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/organizations/policy.go b/internal/service/organizations/policy.go index 8e9a9afdf115..715cdcdc8133 100644 --- a/internal/service/organizations/policy.go +++ b/internal/service/organizations/policy.go @@ -95,7 +95,7 @@ func resourcePolicyCreate(ctx context.Context, d *schema.ResourceData, meta any) Tags: getTagsIn(ctx), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func(ctx context.Context) (any, error) { return conn.CreatePolicy(ctx, input) }) diff --git a/internal/service/organizations/policy_attachment.go b/internal/service/organizations/policy_attachment.go index 7eedfccd8002..2fa97bc7a06d 100644 --- a/internal/service/organizations/policy_attachment.go +++ b/internal/service/organizations/policy_attachment.go @@ -68,7 +68,7 @@ func resourcePolicyAttachmentCreate(ctx context.Context, d *schema.ResourceData, TargetId: aws.String(targetID), } - _, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func(ctx context.Context) (any, error) { return conn.AttachPolicy(ctx, &input) }) diff --git a/internal/service/organizations/policy_attachment_identity_gen_test.go b/internal/service/organizations/policy_attachment_identity_gen_test.go index c5c0b9982023..707bb8f5569a 100644 --- a/internal/service/organizations/policy_attachment_identity_gen_test.go +++ b/internal/service/organizations/policy_attachment_identity_gen_test.go @@ -32,10 +32,11 @@ func testAccOrganizationsPolicyAttachment_IdentitySerial(t *testing.T) { func testAccOrganizationsPolicyAttachment_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_organizations_policy_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,10 +120,11 @@ func testAccOrganizationsPolicyAttachment_Identity_Basic(t *testing.T) { // Resource Identity was added after v6.4.0 func testAccOrganizationsPolicyAttachment_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_organizations_policy_attachment.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/organizations/policy_identity_gen_test.go b/internal/service/organizations/policy_identity_gen_test.go index fa43b079f272..ff397e93527d 100644 --- a/internal/service/organizations/policy_identity_gen_test.go +++ b/internal/service/organizations/policy_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccOrganizationsPolicy_Identity_Basic(t *testing.T) { resourceName := "aws_organizations_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -123,7 +123,7 @@ func testAccOrganizationsPolicy_Identity_ExistingResource(t *testing.T) { resourceName := "aws_organizations_policy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/organizations/policy_tags_gen_test.go b/internal/service/organizations/policy_tags_gen_test.go index 2db5cd3aae3d..833227fde64d 100644 --- a/internal/service/organizations/policy_tags_gen_test.go +++ b/internal/service/organizations/policy_tags_gen_test.go @@ -47,6 +47,7 @@ func testAccOrganizationsPolicy_tagsSerial(t *testing.T) { func testAccOrganizationsPolicy_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -232,6 +233,7 @@ func testAccOrganizationsPolicy_tags(t *testing.T) { func testAccOrganizationsPolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -302,6 +304,7 @@ func testAccOrganizationsPolicy_tags_null(t *testing.T) { func testAccOrganizationsPolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -368,6 +371,7 @@ func testAccOrganizationsPolicy_tags_EmptyMap(t *testing.T) { func testAccOrganizationsPolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -452,6 +456,7 @@ func testAccOrganizationsPolicy_tags_AddOnUpdate(t *testing.T) { func testAccOrganizationsPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -544,6 +549,7 @@ func testAccOrganizationsPolicy_tags_EmptyTag_OnCreate(t *testing.T) { func testAccOrganizationsPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -684,6 +690,7 @@ func testAccOrganizationsPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccOrganizationsPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -776,6 +783,7 @@ func testAccOrganizationsPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccOrganizationsPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -960,6 +968,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_providerOnly(t *testing.T) { func testAccOrganizationsPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1123,6 +1132,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccOrganizationsPolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1302,6 +1312,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_overlapping(t *testing.T) { func testAccOrganizationsPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1395,6 +1406,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_updateToProviderOnly(t *testing func testAccOrganizationsPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1499,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_updateToResourceOnly(t *testing func testAccOrganizationsPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1555,6 +1568,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) func testAccOrganizationsPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1615,6 +1629,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing func testAccOrganizationsPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1680,6 +1695,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *t func testAccOrganizationsPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1745,6 +1761,7 @@ func testAccOrganizationsPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccOrganizationsPolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1803,6 +1820,7 @@ func testAccOrganizationsPolicy_tags_ComputedTag_OnCreate(t *testing.T) { func testAccOrganizationsPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1903,6 +1921,7 @@ func testAccOrganizationsPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccOrganizationsPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1993,6 +2012,7 @@ func testAccOrganizationsPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func testAccOrganizationsPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2158,6 +2178,7 @@ func testAccOrganizationsPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccOrganizationsPolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Policy resourceName := "aws_organizations_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/organizations/resource_policy.go b/internal/service/organizations/resource_policy.go index a7682d99248b..cab4c09a1a22 100644 --- a/internal/service/organizations/resource_policy.go +++ b/internal/service/organizations/resource_policy.go @@ -76,7 +76,7 @@ func resourceResourcePolicyCreate(ctx context.Context, d *schema.ResourceData, m Tags: getTagsIn(ctx), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.FinalizingOrganizationException](ctx, organizationFinalizationTimeout, func(ctx context.Context) (any, error) { return conn.PutResourcePolicy(ctx, input) }) diff --git a/internal/service/organizations/resource_policy_identity_gen_test.go b/internal/service/organizations/resource_policy_identity_gen_test.go index 543faf834ff4..0e27d21882d2 100644 --- a/internal/service/organizations/resource_policy_identity_gen_test.go +++ b/internal/service/organizations/resource_policy_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccOrganizationsResourcePolicy_Identity_Basic(t *testing.T) { resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func testAccOrganizationsResourcePolicy_Identity_ExistingResource(t *testing.T) resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/organizations/resource_policy_tags_gen_test.go b/internal/service/organizations/resource_policy_tags_gen_test.go index ee94342dd87e..dfb0c763725f 100644 --- a/internal/service/organizations/resource_policy_tags_gen_test.go +++ b/internal/service/organizations/resource_policy_tags_gen_test.go @@ -48,6 +48,7 @@ func testAccOrganizationsResourcePolicy_tagsSerial(t *testing.T) { func testAccOrganizationsResourcePolicy_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -233,6 +234,7 @@ func testAccOrganizationsResourcePolicy_tags(t *testing.T) { func testAccOrganizationsResourcePolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -303,6 +305,7 @@ func testAccOrganizationsResourcePolicy_tags_null(t *testing.T) { func testAccOrganizationsResourcePolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -369,6 +372,7 @@ func testAccOrganizationsResourcePolicy_tags_EmptyMap(t *testing.T) { func testAccOrganizationsResourcePolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -453,6 +457,7 @@ func testAccOrganizationsResourcePolicy_tags_AddOnUpdate(t *testing.T) { func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -545,6 +550,7 @@ func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnCreate(t *testing.T) { func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -685,6 +691,7 @@ func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -777,6 +784,7 @@ func testAccOrganizationsResourcePolicy_tags_EmptyTag_OnUpdate_Replace(t *testin func testAccOrganizationsResourcePolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -954,6 +962,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_providerOnly(t *testing func testAccOrganizationsResourcePolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1112,6 +1121,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_nonOverlapping(t *testi func testAccOrganizationsResourcePolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1286,6 +1296,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_overlapping(t *testing. func testAccOrganizationsResourcePolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1377,6 +1388,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_updateToProviderOnly(t func testAccOrganizationsResourcePolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1467,6 +1479,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_updateToResourceOnly(t func testAccOrganizationsResourcePolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1534,6 +1547,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_emptyResourceTag(t *tes func testAccOrganizationsResourcePolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1593,6 +1607,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_emptyProviderOnlyTag(t func testAccOrganizationsResourcePolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1657,6 +1672,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_nullOverlappingResource func testAccOrganizationsResourcePolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1721,6 +1737,7 @@ func testAccOrganizationsResourcePolicy_tags_DefaultTags_nullNonOverlappingResou func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1778,6 +1795,7 @@ func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnCreate(t *testing.T) func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1876,6 +1894,7 @@ func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnUpdate_Add(t *testing func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -1964,6 +1983,7 @@ func testAccOrganizationsResourcePolicy_tags_ComputedTag_OnUpdate_Replace(t *tes func testAccOrganizationsResourcePolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) @@ -2127,6 +2147,7 @@ func testAccOrganizationsResourcePolicy_tags_IgnoreTags_Overlap_DefaultTag(t *te func testAccOrganizationsResourcePolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ResourcePolicy resourceName := "aws_organizations_resource_policy.test" providers := make(map[string]*schema.Provider) diff --git a/internal/service/organizations/service_endpoint_resolver_gen.go b/internal/service/organizations/service_endpoint_resolver_gen.go index 6878ed62c178..7185d6eac297 100644 --- a/internal/service/organizations/service_endpoint_resolver_gen.go +++ b/internal/service/organizations/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params organizations.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up organizations endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up organizations endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index 492ee31f5183..3f9f189aa8f9 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/osis/pipeline.go b/internal/service/osis/pipeline.go index aae31a051e57..515af9c1ff5e 100644 --- a/internal/service/osis/pipeline.go +++ b/internal/service/osis/pipeline.go @@ -226,7 +226,7 @@ func (r *pipelineResource) Create(ctx context.Context, request resource.CreateRe input.Tags = getTagsIn(ctx) // Retry for IAM eventual consistency. - _, err := tfresource.RetryWhenIsA[*awstypes.ValidationException](ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.ValidationException](ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreatePipeline(ctx, &input) }) diff --git a/internal/service/osis/service_endpoint_resolver_gen.go b/internal/service/osis/service_endpoint_resolver_gen.go index 6d27b8a1905d..e23b37145f4b 100644 --- a/internal/service/osis/service_endpoint_resolver_gen.go +++ b/internal/service/osis/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params osis.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up osis endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up osis endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index 6497798a1507..a07090d935bb 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/outposts/service_endpoint_resolver_gen.go b/internal/service/outposts/service_endpoint_resolver_gen.go index 0279c09937a5..8eb5fe1663a7 100644 --- a/internal/service/outposts/service_endpoint_resolver_gen.go +++ b/internal/service/outposts/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params outposts.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up outposts endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up outposts endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index eed5d91908c6..167ecf4cd572 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/paymentcryptography/key.go b/internal/service/paymentcryptography/key.go index 9fb0c41cdb40..d105ae383aa9 100644 --- a/internal/service/paymentcryptography/key.go +++ b/internal/service/paymentcryptography/key.go @@ -39,6 +39,7 @@ import ( // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/paymentcryptography;paymentcryptography.GetKeyOutput") // @Testing(generator=false) // @Testing(importIgnore="deletion_window_in_days") +// @Testing(preIdentityVersion="v5.100.0") func newKeyResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &keyResource{} diff --git a/internal/service/paymentcryptography/key_identity_gen_test.go b/internal/service/paymentcryptography/key_identity_gen_test.go index 99bbdfb6ad26..ff5ee6c31b3c 100644 --- a/internal/service/paymentcryptography/key_identity_gen_test.go +++ b/internal/service/paymentcryptography/key_identity_gen_test.go @@ -25,7 +25,7 @@ func TestAccPaymentCryptographyKey_Identity_Basic(t *testing.T) { var v paymentcryptography.GetKeyOutput resourceName := "aws_paymentcryptography_key.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -108,7 +108,7 @@ func TestAccPaymentCryptographyKey_Identity_RegionOverride(t *testing.T) { resourceName := "aws_paymentcryptography_key.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -234,7 +234,7 @@ func TestAccPaymentCryptographyKey_Identity_ExistingResource(t *testing.T) { var v paymentcryptography.GetKeyOutput resourceName := "aws_paymentcryptography_key.test" - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/paymentcryptography/service_endpoint_resolver_gen.go b/internal/service/paymentcryptography/service_endpoint_resolver_gen.go index b1c0d1946841..f62de3587841 100644 --- a/internal/service/paymentcryptography/service_endpoint_resolver_gen.go +++ b/internal/service/paymentcryptography/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params paymentcryptogra }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up paymentcryptography endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up paymentcryptography endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pcaconnectorad/service_endpoint_resolver_gen.go b/internal/service/pcaconnectorad/service_endpoint_resolver_gen.go index 8b4aed19b52b..396d076f845c 100644 --- a/internal/service/pcaconnectorad/service_endpoint_resolver_gen.go +++ b/internal/service/pcaconnectorad/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pcaconnectorad.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pcaconnectorad endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pcaconnectorad endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index 5babfc9b3314..87936378e4ab 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/pcs/service_endpoint_resolver_gen.go b/internal/service/pcs/service_endpoint_resolver_gen.go index b217a4cd1ddc..05ae03021d28 100644 --- a/internal/service/pcs/service_endpoint_resolver_gen.go +++ b/internal/service/pcs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pcs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pcs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pcs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pcs/service_endpoints_gen_test.go b/internal/service/pcs/service_endpoints_gen_test.go index 38031c44c99c..53beee1d5308 100644 --- a/internal/service/pcs/service_endpoints_gen_test.go +++ b/internal/service/pcs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/pinpoint/service_endpoint_resolver_gen.go b/internal/service/pinpoint/service_endpoint_resolver_gen.go index 9c9b5833adf4..3c2a9a5823e4 100644 --- a/internal/service/pinpoint/service_endpoint_resolver_gen.go +++ b/internal/service/pinpoint/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pinpoint.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pinpoint endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pinpoint endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index 2e624a8d937e..9dfba64e19e2 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/pinpointsmsvoicev2/service_endpoint_resolver_gen.go b/internal/service/pinpointsmsvoicev2/service_endpoint_resolver_gen.go index 09ba3a9f1908..8b4b9e1b0ed9 100644 --- a/internal/service/pinpointsmsvoicev2/service_endpoint_resolver_gen.go +++ b/internal/service/pinpointsmsvoicev2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pinpointsmsvoice }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pinpointsmsvoicev2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pinpointsmsvoicev2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pinpointsmsvoicev2/service_endpoints_gen_test.go b/internal/service/pinpointsmsvoicev2/service_endpoints_gen_test.go index d87dc54dcbb0..50e84597a504 100644 --- a/internal/service/pinpointsmsvoicev2/service_endpoints_gen_test.go +++ b/internal/service/pinpointsmsvoicev2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/pipes/service_endpoint_resolver_gen.go b/internal/service/pipes/service_endpoint_resolver_gen.go index 647f1c821077..a7aeaf7c08f2 100644 --- a/internal/service/pipes/service_endpoint_resolver_gen.go +++ b/internal/service/pipes/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pipes.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pipes endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pipes endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index 0386578de5c4..065b14e01bf0 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/polly/service_endpoint_resolver_gen.go b/internal/service/polly/service_endpoint_resolver_gen.go index 7f8d50ac4e6a..819677987fd4 100644 --- a/internal/service/polly/service_endpoint_resolver_gen.go +++ b/internal/service/polly/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params polly.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up polly endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up polly endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index 375827a00fb6..7613d7f68bc8 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/pricing/service_endpoint_resolver_gen.go b/internal/service/pricing/service_endpoint_resolver_gen.go index 7d927d33cfd2..fc6c74b2de64 100644 --- a/internal/service/pricing/service_endpoint_resolver_gen.go +++ b/internal/service/pricing/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params pricing.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up pricing endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up pricing endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index 3dac5ea189c8..4053ca6b0c8a 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/qbusiness/service_endpoint_resolver_gen.go b/internal/service/qbusiness/service_endpoint_resolver_gen.go index e3a9fd19d321..3e4b49ab74c4 100644 --- a/internal/service/qbusiness/service_endpoint_resolver_gen.go +++ b/internal/service/qbusiness/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params qbusiness.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up qbusiness endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up qbusiness endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index 19c54bb9f424..62cacbe40c59 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index e03a53933fd8..58382e84659d 100644 --- a/internal/service/qldb/ledger.go +++ b/internal/service/qldb/ledger.go @@ -187,7 +187,7 @@ func resourceLedgerDelete(ctx context.Context, d *schema.ResourceData, meta any) } log.Printf("[INFO] Deleting QLDB Ledger: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteLedger(ctx, input) }) diff --git a/internal/service/qldb/service_endpoint_resolver_gen.go b/internal/service/qldb/service_endpoint_resolver_gen.go index 9d59080dfff8..8b1fef031ad0 100644 --- a/internal/service/qldb/service_endpoint_resolver_gen.go +++ b/internal/service/qldb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params qldb.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up qldb endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up qldb endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index 2ead4b373906..e93d4bf6b5e0 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/qldb/stream.go b/internal/service/qldb/stream.go index 18eaf9772d91..6c2187bd1655 100644 --- a/internal/service/qldb/stream.go +++ b/internal/service/qldb/stream.go @@ -207,7 +207,7 @@ func resourceStreamDelete(ctx context.Context, d *schema.ResourceData, meta any) } log.Printf("[INFO] Deleting QLDB Stream: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.ResourceInUseException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ResourceInUseException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.CancelJournalKinesisStream(ctx, input) }) diff --git a/internal/service/quicksight/account_settings.go b/internal/service/quicksight/account_settings.go index 87cc58a0a467..4634cd623bf1 100644 --- a/internal/service/quicksight/account_settings.go +++ b/internal/service/quicksight/account_settings.go @@ -16,17 +16,13 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -55,25 +51,8 @@ type accountSettingsResource struct { func (r *accountSettingsResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { response.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - Validators: []validator.String{ - fwvalidators.AWSAccountID(), - }, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - "default_namespace": schema.StringAttribute{ - Optional: true, - Computed: true, - Default: stringdefault.StaticString("default"), - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + "default_namespace": quicksightschema.NamespaceAttribute(), "termination_protection_enabled": schema.BoolAttribute{ Optional: true, Computed: true, @@ -95,7 +74,9 @@ func (r *accountSettingsResource) Create(ctx context.Context, request resource.C if response.Diagnostics.HasError() { return } - data.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) + } conn := r.Meta().QuickSightClient(ctx) diff --git a/internal/service/quicksight/account_settings_test.go b/internal/service/quicksight/account_settings_test.go index d09d32b0f946..17e2c39e047f 100644 --- a/internal/service/quicksight/account_settings_test.go +++ b/internal/service/quicksight/account_settings_test.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -42,7 +43,7 @@ func testAccAccountSettings_basic(t *testing.T) { }, ConfigStateChecks: []statecheck.StateCheck{ statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), knownvalue.NotNull()), - statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("default_namespace"), knownvalue.StringExact("default")), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("default_namespace"), knownvalue.StringExact(tfquicksight.DefaultNamespace)), statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("termination_protection_enabled"), knownvalue.Bool(false)), }, }, diff --git a/internal/service/quicksight/account_subscription.go b/internal/service/quicksight/account_subscription.go index 59e06c527cfb..1a299260e8ff 100644 --- a/internal/service/quicksight/account_subscription.go +++ b/internal/service/quicksight/account_subscription.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -77,13 +77,7 @@ func resourceAccountSubscription() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), "contact_number": { Type: schema.TypeString, Optional: true, diff --git a/internal/service/quicksight/account_subscription_test.go b/internal/service/quicksight/account_subscription_test.go index dab09b7bf49c..f58bfe38bf8d 100644 --- a/internal/service/quicksight/account_subscription_test.go +++ b/internal/service/quicksight/account_subscription_test.go @@ -125,10 +125,9 @@ func testAccCheckAccountSubscriptionDisableTerminationProtection(ctx context.Con conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) - defaultNs := "default" input := &quicksight.UpdateAccountSettingsInput{ AwsAccountId: aws.String(rs.Primary.ID), - DefaultNamespace: aws.String(defaultNs), + DefaultNamespace: aws.String(tfquicksight.DefaultNamespace), TerminationProtectionEnabled: false, } diff --git a/internal/service/quicksight/analysis.go b/internal/service/quicksight/analysis.go index fbc640f2b387..baa2b57707fc 100644 --- a/internal/service/quicksight/analysis.go +++ b/internal/service/quicksight/analysis.go @@ -26,7 +26,6 @@ import ( tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -65,13 +64,7 @@ func resourceAnalysis() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrCreatedTime: { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/analysis_data_source.go b/internal/service/quicksight/analysis_data_source.go index fefdac11b9d9..e4c30f746ae6 100644 --- a/internal/service/quicksight/analysis_data_source.go +++ b/internal/service/quicksight/analysis_data_source.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -33,12 +32,7 @@ func dataSourceAnalysis() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDDataSourceSchema(), names.AttrCreatedTime: { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/analysis_data_source_tags_gen_test.go b/internal/service/quicksight/analysis_data_source_tags_gen_test.go index dc2264f445c2..58fe94ca86ef 100644 --- a/internal/service/quicksight/analysis_data_source_tags_gen_test.go +++ b/internal/service/quicksight/analysis_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccQuickSightAnalysisDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccQuickSightAnalysisDataSource_tags(t *testing.T) { func TestAccQuickSightAnalysisDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccQuickSightAnalysisDataSource_tags_NullMap(t *testing.T) { func TestAccQuickSightAnalysisDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccQuickSightAnalysisDataSource_tags_EmptyMap(t *testing.T) { func TestAccQuickSightAnalysisDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccQuickSightAnalysisDataSource_tags_DefaultTags_nonOverlapping(t *test func TestAccQuickSightAnalysisDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccQuickSightAnalysisDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccQuickSightAnalysisDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/analysis_tags_gen_test.go b/internal/service/quicksight/analysis_tags_gen_test.go index 47d25455b565..38430afc2831 100644 --- a/internal/service/quicksight/analysis_tags_gen_test.go +++ b/internal/service/quicksight/analysis_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightAnalysis_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightAnalysis_tags_null(t *testing.T) { t.Skip("Resource Analysis does not support null tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightAnalysis_tags_null(t *testing.T) { func TestAccQuickSightAnalysis_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightAnalysis_tags_EmptyMap(t *testing.T) { func TestAccQuickSightAnalysis_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightAnalysis_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Analysis does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightAnalysis_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Analysis does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightAnalysis_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Analysis does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightAnalysis_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightAnalysis_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightAnalysis_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightAnalysis_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightAnalysis_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccQuickSightAnalysis_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource Analysis does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_emptyProviderOnlyTag(t *testing. t.Skip("Resource Analysis does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_nullOverlappingResourceTag(t *te t.Skip("Resource Analysis does not support null tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Analysis does not support null tags") ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightAnalysis_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccQuickSightAnalysis_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightAnalysis_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightAnalysis_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightAnalysis_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightAnalysis_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightAnalysis_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightAnalysis_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightAnalysis_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccQuickSightAnalysis_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Analysis resourceName := "aws_quicksight_analysis.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/custom_permissions.go b/internal/service/quicksight/custom_permissions.go new file mode 100644 index 000000000000..25200a2b23fc --- /dev/null +++ b/internal/service/quicksight/custom_permissions.go @@ -0,0 +1,308 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight + +import ( + "context" + "fmt" + + "github.com/YakDriver/regexache" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/quicksight" + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource("aws_quicksight_custom_permissions", name="Custom Permissions") +// @Tags(identifierAttribute="arn") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/quicksight/types;awstypes;awstypes.CustomPermissions") +// @Testing(skipEmptyTags=true, skipNullTags=true) +// @Testing(importStateIdFunc="testAccCustomPermissionsImportStateID", importStateIdAttribute="custom_permissions_name") +func newCustomPermissionsResource(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &customPermissionsResource{} + + return r, nil +} + +type customPermissionsResource struct { + framework.ResourceWithModel[customPermissionsResourceModel] +} + +func (r *customPermissionsResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + names.AttrARN: framework.ARNAttributeComputedOnly(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + "custom_permissions_name": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + stringvalidator.RegexMatches(regexache.MustCompile(`^[a-zA-Z0-9+=,.@_-]+$`), ""), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + names.AttrTags: tftags.TagsAttribute(), + names.AttrTagsAll: tftags.TagsAttributeComputedOnly(), + }, + Blocks: map[string]schema.Block{ + "capabilities": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[capabilitiesModel](ctx), + Validators: []validator.List{ + listvalidator.IsRequired(), + listvalidator.SizeAtLeast(1), + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: tfmaps.ApplyToAllValues(fwtypes.AttributeTypesMust[capabilitiesModel](ctx), func(attr.Type) schema.Attribute { + return schema.StringAttribute{ + CustomType: fwtypes.StringEnumType[awstypes.CapabilityState](), + Optional: true, + } + }), + }, + }, + }, + } +} + +func (r *customPermissionsResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data customPermissionsResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) + } + + conn := r.Meta().QuickSightClient(ctx) + + name := fwflex.StringValueFromFramework(ctx, data.CustomPermissionsName) + var input quicksight.CreateCustomPermissionsInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return + } + + // Additional fields. + input.Tags = getTagsIn(ctx) + + output, err := conn.CreateCustomPermissions(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight Custom Permissions (%s)", name), err.Error()) + + return + } + + // Set values for unknowns. + data.ARN = fwflex.StringToFramework(ctx, output.Arn) + + response.Diagnostics.Append(response.State.Set(ctx, data)...) +} + +func (r *customPermissionsResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data customPermissionsResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + accountID, name := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.CustomPermissionsName) + output, err := findCustomPermissionsByTwoPartKey(ctx, conn, accountID, name) + + if tfresource.NotFound(err) { + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("reading Quicksight Custom Permissions (%s)", name), err.Error()) + + return + } + + // Set attributes for import. + response.Diagnostics.Append(fwflex.Flatten(ctx, output, &data)...) + if response.Diagnostics.HasError() { + return + } + + response.Diagnostics.Append(response.State.Set(ctx, &data)...) +} + +func (r *customPermissionsResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old customPermissionsResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &new)...) + if response.Diagnostics.HasError() { + return + } + response.Diagnostics.Append(request.State.Get(ctx, &old)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + diff, diags := fwflex.Diff(ctx, new, old) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { + return + } + + if diff.HasChanges() { + name := fwflex.StringValueFromFramework(ctx, new.CustomPermissionsName) + var input quicksight.UpdateCustomPermissionsInput + response.Diagnostics.Append(fwflex.Expand(ctx, new, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateCustomPermissions(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("updating Quicksight Custom Permissions (%s)", name), err.Error()) + + return + } + } + + response.Diagnostics.Append(response.State.Set(ctx, &new)...) +} + +func (r *customPermissionsResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data customPermissionsResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + accountID, name := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.CustomPermissionsName) + input := quicksight.DeleteCustomPermissionsInput{ + AwsAccountId: aws.String(accountID), + CustomPermissionsName: aws.String(name), + } + _, err := conn.DeleteCustomPermissions(ctx, &input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("deleting Quicksight Custom Permissions (%s)", name), err.Error()) + + return + } +} + +func (r *customPermissionsResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + const ( + customPermissionsIDParts = 2 + ) + parts, err := intflex.ExpandResourceId(request.ID, customPermissionsIDParts, true) + + if err != nil { + response.Diagnostics.Append(fwdiag.NewParsingResourceIDErrorDiagnostic(err)) + + return + } + + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrAWSAccountID), parts[0])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root("custom_permissions_name"), parts[1])...) +} + +func findCustomPermissionsByTwoPartKey(ctx context.Context, conn *quicksight.Client, awsAccountID, customPermissionsName string) (*awstypes.CustomPermissions, error) { + input := &quicksight.DescribeCustomPermissionsInput{ + AwsAccountId: aws.String(awsAccountID), + CustomPermissionsName: aws.String(customPermissionsName), + } + + return findCustomPermissions(ctx, conn, input) +} + +func findCustomPermissions(ctx context.Context, conn *quicksight.Client, input *quicksight.DescribeCustomPermissionsInput) (*awstypes.CustomPermissions, error) { + output, err := conn.DescribeCustomPermissions(ctx, input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || output.CustomPermissions == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.CustomPermissions, nil +} + +type customPermissionsResourceModel struct { + framework.WithRegionModel + ARN types.String `tfsdk:"arn"` + AWSAccountID types.String `tfsdk:"aws_account_id"` + Capabilities fwtypes.ListNestedObjectValueOf[capabilitiesModel] `tfsdk:"capabilities"` + CustomPermissionsName types.String `tfsdk:"custom_permissions_name"` + Tags tftags.Map `tfsdk:"tags"` + TagsAll tftags.Map `tfsdk:"tags_all"` +} + +type capabilitiesModel struct { + AddOrRunAnomalyDetectionForAnalyses fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"add_or_run_anomaly_detection_for_analyses"` + CreateAndUpdateDashboardEmailReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_and_update_dashboard_email_reports"` + CreateAndUpdateDatasets fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_and_update_datasets"` + CreateAndUpdateDataSources fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_and_update_data_sources"` + CreateAndUpdateThemes fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_and_update_themes"` + CreateAndUpdateThresholdAlerts fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_and_update_threshold_alerts"` + CreateSharedFolders fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_shared_folders"` + CreateSPICEDataset fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"create_spice_dataset"` + ExportToCSV fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_csv"` + ExportToCSVInScheduledReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_csv_in_scheduled_reports"` + ExportToExcel fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_excel"` + ExportToExcelInScheduledReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_excel_in_scheduled_reports"` + ExportToPDF fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_pdf"` + ExportToPDFInScheduledReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"export_to_pdf_in_scheduled_reports"` + IncludeContentInScheduledReportsEmail fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"include_content_in_scheduled_reports_email"` + PrintReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"print_reports"` + RenameSharedFolders fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"rename_shared_folders"` + ShareAnalyses fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"share_analyses"` + ShareDashboards fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"share_dashboards"` + ShareDatasets fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"share_datasets"` + ShareDataSources fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"share_data_sources"` + SubscribeDashboardEmailReports fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"subscribe_dashboard_email_reports"` + ViewAccountSPICECapacity fwtypes.StringEnum[awstypes.CapabilityState] `tfsdk:"view_account_spice_capacity"` +} diff --git a/internal/service/quicksight/custom_permissions_tags_gen_test.go b/internal/service/quicksight/custom_permissions_tags_gen_test.go new file mode 100644 index 000000000000..4b217ec1c62d --- /dev/null +++ b/internal/service/quicksight/custom_permissions_tags_gen_test.go @@ -0,0 +1,2357 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +package quicksight_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccQuickSightCustomPermissions_tags(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_null(t *testing.T) { + t.Skip("Resource CustomPermissions does not support null tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_EmptyMap(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{})), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{}), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_AddOnUpdate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_EmptyTag_OnCreate(t *testing.T) { + t.Skip("Resource CustomPermissions does not support empty tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_EmptyTag_OnUpdate_Add(t *testing.T) { + t.Skip("Resource CustomPermissions does not support empty tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + acctest.CtKey2: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + acctest.CtKey2: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { + t.Skip("Resource CustomPermissions does not support empty tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_providerOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1Updated), + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1Updated), + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey2: knownvalue.StringExact(acctest.CtValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey2: config.StringVariable(acctest.CtValue2), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_nonOverlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1Updated), + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{})), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_overlapping(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtOverlapKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + acctest.CtOverlapKey2: config.StringVariable("providervalue2"), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtOverlapKey2: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtOverlapKey1: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtOverlapKey1: config.StringVariable(acctest.CtResourceValue2), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_updateToProviderOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_updateToResourceOnly(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_emptyResourceTag(t *testing.T) { + t.Skip("Resource CustomPermissions does not support empty tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { + t.Skip("Resource CustomPermissions does not support empty tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(""), + }), + acctest.CtResourceTags: nil, + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { + t.Skip("Resource CustomPermissions does not support null tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(""), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + ImportStateVerifyIgnore: []string{ + acctest.CtTagsKey1, // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { + t.Skip("Resource CustomPermissions does not support null tags") + + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.Null(), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(""), + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_defaults/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: nil, + }), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + ImportStateVerifyIgnore: []string{ + "tags.resourcekey1", // The canonical value returned by the AWS API is "" + }, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_ComputedTag_OnCreate(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_ComputedTag_OnUpdate_Add(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "tags.computedkey1", "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(2)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapPartial(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey("computedkey1")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed2/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable("computedkey1"), + "knownTagKey": config.StringVariable(acctest.CtKey1), + "knownTagValue": config.StringVariable(acctest.CtValue1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtKey1: config.StringVariable(acctest.CtValue1), + }), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtKey1: knownvalue.StringExact(acctest.CtValue1), + })), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsKey1, "null_resource.test", names.AttrID), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapSizeExact(1)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapSizeExact(1)), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTags).AtMapKey(acctest.CtKey1)), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrTagsAll)), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tagsComputed1/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "unknownTagKey": config.StringVariable(acctest.CtKey1), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerify: true, + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 2: Update ignored tag only + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Updated), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtProviderTags: config.MapVariable(map[string]config.Variable{ + acctest.CtProviderKey1: config.StringVariable(acctest.CtProviderValue1Again), + }), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtProviderKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtProviderKey1: knownvalue.StringExact(acctest.CtProviderValue1), // TODO: Should not be set + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.CustomPermissions + resourceName := "aws_quicksight_custom_permissions.test" + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + // 1: Create + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 2: Update ignored tag + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Updated), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + // 3: Update both tags + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CustomPermissions/tags_ignore/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + acctest.CtResourceTags: config.MapVariable(map[string]config.Variable{ + acctest.CtResourceKey1: config.StringVariable(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: config.StringVariable(acctest.CtResourceValue2Updated), + }), + "ignore_tag_keys": config.SetVariable( + config.StringVariable(acctest.CtResourceKey1), + ), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + expectFullResourceTags(ctx, resourceName, knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1), // TODO: Should not be set + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // TODO: Should be NoOp + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey1: knownvalue.StringExact(acctest.CtResourceValue1Again), + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), knownvalue.MapExact(map[string]knownvalue.Check{ + acctest.CtResourceKey2: knownvalue.StringExact(acctest.CtResourceValue2Updated), + })), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} diff --git a/internal/service/quicksight/custom_permissions_test.go b/internal/service/quicksight/custom_permissions_test.go new file mode 100644 index 000000000000..34d437f1f227 --- /dev/null +++ b/internal/service/quicksight/custom_permissions_test.go @@ -0,0 +1,308 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight_test + +import ( + "context" + "fmt" + "testing" + + "github.com/YakDriver/regexache" + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccQuickSightCustomPermissions_basic(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.CustomPermissions + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_custom_permissions.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccCustomPermissionsConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), tfknownvalue.RegionalARNRegexp("quicksight", regexache.MustCompile(`custompermissions/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("capabilities"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "add_or_run_anomaly_detection_for_analyses": knownvalue.Null(), + "create_and_update_dashboard_email_reports": knownvalue.Null(), + "create_and_update_datasets": knownvalue.Null(), + "create_and_update_data_sources": knownvalue.Null(), + "create_and_update_themes": knownvalue.Null(), + "create_and_update_threshold_alerts": knownvalue.Null(), + "create_shared_folders": knownvalue.Null(), + "create_spice_dataset": knownvalue.Null(), + "export_to_csv": knownvalue.Null(), + "export_to_csv_in_scheduled_reports": knownvalue.Null(), + "export_to_excel": knownvalue.Null(), + "export_to_excel_in_scheduled_reports": knownvalue.Null(), + "export_to_pdf": knownvalue.Null(), + "export_to_pdf_in_scheduled_reports": knownvalue.Null(), + "include_content_in_scheduled_reports_email": knownvalue.Null(), + "print_reports": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "rename_shared_folders": knownvalue.Null(), + "share_analyses": knownvalue.Null(), + "share_dashboards": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "share_datasets": knownvalue.Null(), + "share_data_sources": knownvalue.Null(), + "subscribe_dashboard_email_reports": knownvalue.Null(), + "view_account_spice_capacity": knownvalue.Null(), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_disappears(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.CustomPermissions + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_custom_permissions.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccCustomPermissionsConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfquicksight.ResourceCustomPermissions, resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccQuickSightCustomPermissions_update(t *testing.T) { + ctx := acctest.Context(t) + var v awstypes.CustomPermissions + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_custom_permissions.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckCustomPermissionsDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccCustomPermissionsConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), tfknownvalue.RegionalARNRegexp("quicksight", regexache.MustCompile(`custompermissions/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("capabilities"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "add_or_run_anomaly_detection_for_analyses": knownvalue.Null(), + "create_and_update_dashboard_email_reports": knownvalue.Null(), + "create_and_update_datasets": knownvalue.Null(), + "create_and_update_data_sources": knownvalue.Null(), + "create_and_update_themes": knownvalue.Null(), + "create_and_update_threshold_alerts": knownvalue.Null(), + "create_shared_folders": knownvalue.Null(), + "create_spice_dataset": knownvalue.Null(), + "export_to_csv": knownvalue.Null(), + "export_to_csv_in_scheduled_reports": knownvalue.Null(), + "export_to_excel": knownvalue.Null(), + "export_to_excel_in_scheduled_reports": knownvalue.Null(), + "export_to_pdf": knownvalue.Null(), + "export_to_pdf_in_scheduled_reports": knownvalue.Null(), + "include_content_in_scheduled_reports_email": knownvalue.Null(), + "print_reports": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "rename_shared_folders": knownvalue.Null(), + "share_analyses": knownvalue.Null(), + "share_dashboards": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "share_datasets": knownvalue.Null(), + "share_data_sources": knownvalue.Null(), + "subscribe_dashboard_email_reports": knownvalue.Null(), + "view_account_spice_capacity": knownvalue.Null(), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccCustomPermissionsImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + Config: testAccCustomPermissionsConfig_updated(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCustomPermissionsExists(ctx, resourceName, &v), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), tfknownvalue.RegionalARNRegexp("quicksight", regexache.MustCompile(`custompermissions/.+`))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("capabilities"), knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectPartial(map[string]knownvalue.Check{ + "create_and_update_datasets": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "create_and_update_data_sources": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "export_to_pdf": tfknownvalue.StringExact(awstypes.CapabilityStateDeny), + "print_reports": knownvalue.Null(), + "share_dashboards": knownvalue.Null(), + }), + })), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.Null()), + }, + }, + }, + }) +} + +func testAccCheckCustomPermissionsDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_quicksight_ip_restriction" { + continue + } + + _, err := tfquicksight.FindCustomPermissionsByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["custom_permissions_name"]) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("QuickSight Custom Permissions (%s) still exists", rs.Primary.Attributes["custom_permissions_name"]) + } + + return nil + } +} + +func testAccCheckCustomPermissionsExists(ctx context.Context, n string, v *awstypes.CustomPermissions) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + output, err := tfquicksight.FindCustomPermissionsByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["custom_permissions_name"]) + + if err != nil { + return err + } + + *v = *output + + return nil + } +} + +func testAccCustomPermissionsImportStateID(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return acctest.AttrsImportStateIdFunc(n, ",", names.AttrAWSAccountID, "custom_permissions_name")(s) + } +} + +func testAccCustomPermissionsConfig_basic(rName string) string { + return fmt.Sprintf(` +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = %[1]q + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } +} +`, rName) +} + +func testAccCustomPermissionsConfig_updated(rName string) string { + return fmt.Sprintf(` +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = %[1]q + + capabilities { + create_and_update_datasets = "DENY" + create_and_update_data_sources = "DENY" + export_to_pdf = "DENY" + } +} +`, rName) +} diff --git a/internal/service/quicksight/dashboard.go b/internal/service/quicksight/dashboard.go index 93798e83dc48..7bc4a0e84c5c 100644 --- a/internal/service/quicksight/dashboard.go +++ b/internal/service/quicksight/dashboard.go @@ -27,7 +27,6 @@ import ( tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -58,13 +57,7 @@ func resourceDashboard() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrCreatedTime: { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/dashboard_tags_gen_test.go b/internal/service/quicksight/dashboard_tags_gen_test.go index 577b8ee9ca60..13bac52d972b 100644 --- a/internal/service/quicksight/dashboard_tags_gen_test.go +++ b/internal/service/quicksight/dashboard_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightDashboard_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightDashboard_tags_null(t *testing.T) { t.Skip("Resource Dashboard does not support null tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightDashboard_tags_null(t *testing.T) { func TestAccQuickSightDashboard_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightDashboard_tags_EmptyMap(t *testing.T) { func TestAccQuickSightDashboard_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightDashboard_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Dashboard does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightDashboard_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Dashboard does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightDashboard_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Dashboard does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightDashboard_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightDashboard_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightDashboard_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightDashboard_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightDashboard_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccQuickSightDashboard_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource Dashboard does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_emptyProviderOnlyTag(t *testing t.Skip("Resource Dashboard does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_nullOverlappingResourceTag(t *t t.Skip("Resource Dashboard does not support null tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Dashboard does not support null tags") ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightDashboard_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccQuickSightDashboard_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightDashboard_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightDashboard_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightDashboard_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightDashboard_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightDashboard_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccQuickSightDashboard_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightDashboard_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccQuickSightDashboard_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Dashboard resourceName := "aws_quicksight_dashboard.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/data_set.go b/internal/service/quicksight/data_set.go index 9723762e577d..4cc9c71c61c4 100644 --- a/internal/service/quicksight/data_set.go +++ b/internal/service/quicksight/data_set.go @@ -24,7 +24,6 @@ import ( quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -49,13 +48,7 @@ func resourceDataSet() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), "column_groups": quicksightschema.DataSetColumnGroupsSchema(), "column_level_permission_rules": quicksightschema.DataSetColumnLevelPermissionRulesSchema(), "data_set_id": { diff --git a/internal/service/quicksight/data_set_data_source.go b/internal/service/quicksight/data_set_data_source.go index 7564f48e010f..8a96a24041fc 100644 --- a/internal/service/quicksight/data_set_data_source.go +++ b/internal/service/quicksight/data_set_data_source.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -29,12 +28,7 @@ func dataSourceDataSet() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDDataSourceSchema(), "column_groups": quicksightschema.DataSetColumnGroupsSchemaDataSourceSchema(), "column_level_permission_rules": quicksightschema.DataSetColumnLevelPermissionRulesSchemaDataSourceSchema(), "data_set_id": { diff --git a/internal/service/quicksight/data_set_data_source_tags_gen_test.go b/internal/service/quicksight/data_set_data_source_tags_gen_test.go index 7bdc83ec2f6d..b86d41fd066e 100644 --- a/internal/service/quicksight/data_set_data_source_tags_gen_test.go +++ b/internal/service/quicksight/data_set_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccQuickSightDataSetDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccQuickSightDataSetDataSource_tags(t *testing.T) { func TestAccQuickSightDataSetDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccQuickSightDataSetDataSource_tags_NullMap(t *testing.T) { func TestAccQuickSightDataSetDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccQuickSightDataSetDataSource_tags_EmptyMap(t *testing.T) { func TestAccQuickSightDataSetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccQuickSightDataSetDataSource_tags_DefaultTags_nonOverlapping(t *testi func TestAccQuickSightDataSetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccQuickSightDataSetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *te func TestAccQuickSightDataSetDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/data_set_tags_gen_test.go b/internal/service/quicksight/data_set_tags_gen_test.go index 7658bb4b78cd..76e198164e47 100644 --- a/internal/service/quicksight/data_set_tags_gen_test.go +++ b/internal/service/quicksight/data_set_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightDataSet_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightDataSet_tags_null(t *testing.T) { t.Skip("Resource DataSet does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightDataSet_tags_null(t *testing.T) { func TestAccQuickSightDataSet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightDataSet_tags_EmptyMap(t *testing.T) { func TestAccQuickSightDataSet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightDataSet_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource DataSet does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightDataSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource DataSet does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightDataSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource DataSet does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightDataSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightDataSet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightDataSet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightDataSet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightDataSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccQuickSightDataSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource DataSet does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T t.Skip("Resource DataSet does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_nullOverlappingResourceTag(t *tes t.Skip("Resource DataSet does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_nullNonOverlappingResourceTag(t * t.Skip("Resource DataSet does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightDataSet_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccQuickSightDataSet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightDataSet_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightDataSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightDataSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightDataSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightDataSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightDataSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightDataSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccQuickSightDataSet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSet resourceName := "aws_quicksight_data_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/data_source.go b/internal/service/quicksight/data_source.go index b32655fdc171..3778965d4d57 100644 --- a/internal/service/quicksight/data_source.go +++ b/internal/service/quicksight/data_source.go @@ -25,7 +25,6 @@ import ( quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -59,14 +58,8 @@ func resourceDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, - "credentials": quicksightschema.DataSourceCredentialsSchema(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), + "credentials": quicksightschema.DataSourceCredentialsSchema(), "data_source_id": { Type: schema.TypeString, Required: true, diff --git a/internal/service/quicksight/data_source_tags_gen_test.go b/internal/service/quicksight/data_source_tags_gen_test.go index 6474b6dc9b46..a0e1bab34433 100644 --- a/internal/service/quicksight/data_source_tags_gen_test.go +++ b/internal/service/quicksight/data_source_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightDataSource_tags_null(t *testing.T) { t.Skip("Resource DataSource does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightDataSource_tags_null(t *testing.T) { func TestAccQuickSightDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightDataSource_tags_EmptyMap(t *testing.T) { func TestAccQuickSightDataSource_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightDataSource_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource DataSource does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightDataSource_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource DataSource does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightDataSource_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource DataSource does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightDataSource_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightDataSource_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightDataSource_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightDataSource_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccQuickSightDataSource_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource DataSource does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_emptyProviderOnlyTag(t *testin t.Skip("Resource DataSource does not support empty tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_nullOverlappingResourceTag(t * t.Skip("Resource DataSource does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_nullNonOverlappingResourceTag( t.Skip("Resource DataSource does not support null tags") ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightDataSource_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccQuickSightDataSource_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightDataSource_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightDataSource_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightDataSource_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightDataSource_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightDataSource_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccQuickSightDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccQuickSightDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.DataSource resourceName := "aws_quicksight_data_source.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/exports_test.go b/internal/service/quicksight/exports_test.go index 3b1e6c78c1e2..5646615fb493 100644 --- a/internal/service/quicksight/exports_test.go +++ b/internal/service/quicksight/exports_test.go @@ -3,56 +3,65 @@ package quicksight +import ( + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" +) + // Exports for use in tests only. var ( - ResourceAccountSettings = newAccountSettingsResource - ResourceAccountSubscription = resourceAccountSubscription - ResourceAnalysis = resourceAnalysis - ResourceDashboard = resourceDashboard - ResourceDataSet = resourceDataSet - ResourceDataSource = resourceDataSource - ResourceFolder = resourceFolder - ResourceFolderMembership = newFolderMembershipResource - ResourceGroup = resourceGroup - ResourceGroupMembership = resourceGroupMembership - ResourceIAMPolicyAssignment = newIAMPolicyAssignmentResource - ResourceIngestion = newIngestionResource - ResourceIPRestriction = newIPRestrictionResource - ResourceKeyRegistration = newKeyRegistrationResource - ResourceNamespace = newNamespaceResource - ResourceRefreshSchedule = newRefreshScheduleResource - ResourceRoleMembership = newRoleMembershipResource - ResourceTemplate = resourceTemplate - ResourceTemplateAlias = newTemplateAliasResource - ResourceTheme = resourceTheme - ResourceUser = resourceUser - ResourceVPCConnection = newVPCConnectionResource + ResourceAccountSettings = newAccountSettingsResource + ResourceAccountSubscription = resourceAccountSubscription + ResourceAnalysis = resourceAnalysis + ResourceCustomPermissions = newCustomPermissionsResource + ResourceDashboard = resourceDashboard + ResourceDataSet = resourceDataSet + ResourceDataSource = resourceDataSource + ResourceFolder = resourceFolder + ResourceFolderMembership = newFolderMembershipResource + ResourceGroup = resourceGroup + ResourceGroupMembership = resourceGroupMembership + ResourceIAMPolicyAssignment = newIAMPolicyAssignmentResource + ResourceIngestion = newIngestionResource + ResourceIPRestriction = newIPRestrictionResource + ResourceKeyRegistration = newKeyRegistrationResource + ResourceNamespace = newNamespaceResource + ResourceRefreshSchedule = newRefreshScheduleResource + ResourceRoleCustomPermission = newRoleCustomPermissionResource + ResourceRoleMembership = newRoleMembershipResource + ResourceTemplate = resourceTemplate + ResourceTemplateAlias = newTemplateAliasResource + ResourceTheme = resourceTheme + ResourceUser = resourceUser + ResourceUserCustomPermission = newUserCustomPermissionResource + ResourceVPCConnection = newVPCConnectionResource - DashboardLatestVersion = dashboardLatestVersion - DefaultGroupNamespace = defaultGroupNamespace - DefaultUserNamespace = defaultUserNamespace - FindAccountSettingsByID = findAccountSettingsByID - FindAccountSubscriptionByID = findAccountSubscriptionByID - FindAnalysisByTwoPartKey = findAnalysisByTwoPartKey - FindDashboardByThreePartKey = findDashboardByThreePartKey - FindDataSetByTwoPartKey = findDataSetByTwoPartKey - FindDataSourceByTwoPartKey = findDataSourceByTwoPartKey - FindFolderByTwoPartKey = findFolderByTwoPartKey - FindFolderMembershipByFourPartKey = findFolderMembershipByFourPartKey - FindGroupByThreePartKey = findGroupByThreePartKey - FindGroupMembershipByFourPartKey = findGroupMembershipByFourPartKey - FindIAMPolicyAssignmentByThreePartKey = findIAMPolicyAssignmentByThreePartKey - FindIngestionByThreePartKey = findIngestionByThreePartKey - FindIPRestrictionByID = findIPRestrictionByID - FindKeyRegistrationByID = findKeyRegistrationByID - FindNamespaceByTwoPartKey = findNamespaceByTwoPartKey - FindRefreshScheduleByThreePartKey = findRefreshScheduleByThreePartKey - FindRoleMembershipByMultiPartKey = findRoleMembershipByMultiPartKey - FindTemplateAliasByThreePartKey = findTemplateAliasByThreePartKey - FindTemplateByTwoPartKey = findTemplateByTwoPartKey - FindThemeByTwoPartKey = findThemeByTwoPartKey - FindUserByThreePartKey = findUserByThreePartKey - FindVPCConnectionByTwoPartKey = findVPCConnectionByTwoPartKey + DashboardLatestVersion = dashboardLatestVersion + DefaultNamespace = quicksightschema.DefaultNamespace + FindAccountSettingsByID = findAccountSettingsByID + FindAccountSubscriptionByID = findAccountSubscriptionByID + FindAnalysisByTwoPartKey = findAnalysisByTwoPartKey + FindCustomPermissionsByTwoPartKey = findCustomPermissionsByTwoPartKey + FindDashboardByThreePartKey = findDashboardByThreePartKey + FindDataSetByTwoPartKey = findDataSetByTwoPartKey + FindDataSourceByTwoPartKey = findDataSourceByTwoPartKey + FindFolderByTwoPartKey = findFolderByTwoPartKey + FindFolderMembershipByFourPartKey = findFolderMembershipByFourPartKey + FindGroupByThreePartKey = findGroupByThreePartKey + FindGroupMembershipByFourPartKey = findGroupMembershipByFourPartKey + FindIAMPolicyAssignmentByThreePartKey = findIAMPolicyAssignmentByThreePartKey + FindIngestionByThreePartKey = findIngestionByThreePartKey + FindIPRestrictionByID = findIPRestrictionByID + FindKeyRegistrationByID = findKeyRegistrationByID + FindNamespaceByTwoPartKey = findNamespaceByTwoPartKey + FindRefreshScheduleByThreePartKey = findRefreshScheduleByThreePartKey + FindRoleCustomPermissionByThreePartKey = findRoleCustomPermissionByThreePartKey + FindRoleMembershipByFourPartKey = findRoleMembershipByFourPartKey + FindTemplateAliasByThreePartKey = findTemplateAliasByThreePartKey + FindTemplateByTwoPartKey = findTemplateByTwoPartKey + FindThemeByTwoPartKey = findThemeByTwoPartKey + FindUserByThreePartKey = findUserByThreePartKey + FindUserCustomPermissionByThreePartKey = findUserCustomPermissionByThreePartKey + FindVPCConnectionByTwoPartKey = findVPCConnectionByTwoPartKey StartAfterDateTimeLayout = startAfterDateTimeLayout ) diff --git a/internal/service/quicksight/folder.go b/internal/service/quicksight/folder.go index 7f6e7443dafc..96f5460fa0f9 100644 --- a/internal/service/quicksight/folder.go +++ b/internal/service/quicksight/folder.go @@ -55,13 +55,7 @@ func resourceFolder() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrCreatedTime: { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/folder_membership.go b/internal/service/quicksight/folder_membership.go index 636164943751..f1d8d18a0a63 100644 --- a/internal/service/quicksight/folder_membership.go +++ b/internal/service/quicksight/folder_membership.go @@ -23,7 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -47,15 +48,8 @@ type folderMembershipResource struct { func (r *folderMembershipResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - names.AttrID: framework.IDAttribute(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + names.AttrID: framework.IDAttribute(), "folder_id": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ @@ -82,18 +76,18 @@ func (r *folderMembershipResource) Schema(ctx context.Context, req resource.Sche } func (r *folderMembershipResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan folderMembershipResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data folderMembershipResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - awsAccountID, folderID, memberType, memberID := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.FolderID), flex.StringValueFromFramework(ctx, plan.MemberType), flex.StringValueFromFramework(ctx, plan.MemberID) + + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, folderID, memberType, memberID := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.FolderID), fwflex.StringValueFromFramework(ctx, data.MemberType), fwflex.StringValueFromFramework(ctx, data.MemberID) in := &quicksight.CreateFolderMembershipInput{ AwsAccountId: aws.String(awsAccountID), FolderId: aws.String(folderID), @@ -104,22 +98,22 @@ func (r *folderMembershipResource) Create(ctx context.Context, req resource.Crea out, err := conn.CreateFolderMembership(ctx, in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameFolderMembership, plan.MemberID.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameFolderMembership, data.MemberID.String(), err), err.Error(), ) return } if out == nil || out.FolderMember == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameFolderMembership, plan.MemberID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameFolderMembership, data.MemberID.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = flex.StringValueToFramework(ctx, folderMembershipCreateResourceID(awsAccountID, folderID, memberType, memberID)) + data.ID = fwflex.StringValueToFramework(ctx, folderMembershipCreateResourceID(awsAccountID, folderID, memberType, memberID)) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *folderMembershipResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -153,10 +147,10 @@ func (r *folderMembershipResource) Read(ctx context.Context, req resource.ReadRe return } - state.MemberID = flex.StringToFramework(ctx, out.MemberId) - state.AWSAccountID = flex.StringValueToFramework(ctx, awsAccountID) - state.FolderID = flex.StringValueToFramework(ctx, folderID) - state.MemberType = flex.StringValueToFramework(ctx, memberType) + state.MemberID = fwflex.StringToFramework(ctx, out.MemberId) + state.AWSAccountID = fwflex.StringValueToFramework(ctx, awsAccountID) + state.FolderID = fwflex.StringValueToFramework(ctx, folderID) + state.MemberType = fwflex.StringValueToFramework(ctx, memberType) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } diff --git a/internal/service/quicksight/folder_tags_gen_test.go b/internal/service/quicksight/folder_tags_gen_test.go index 9f10eafd6bb0..a045de2cb7e0 100644 --- a/internal/service/quicksight/folder_tags_gen_test.go +++ b/internal/service/quicksight/folder_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightFolder_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightFolder_tags_null(t *testing.T) { t.Skip("Resource Folder does not support null tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightFolder_tags_null(t *testing.T) { func TestAccQuickSightFolder_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightFolder_tags_EmptyMap(t *testing.T) { func TestAccQuickSightFolder_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightFolder_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Folder does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightFolder_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Folder does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightFolder_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Folder does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightFolder_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightFolder_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightFolder_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightFolder_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightFolder_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccQuickSightFolder_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource Folder does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) t.Skip("Resource Folder does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_nullOverlappingResourceTag(t *test t.Skip("Resource Folder does not support null tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_nullNonOverlappingResourceTag(t *t t.Skip("Resource Folder does not support null tags") ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightFolder_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccQuickSightFolder_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightFolder_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightFolder_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightFolder_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightFolder_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightFolder_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightFolder_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightFolder_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccQuickSightFolder_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Folder resourceName := "aws_quicksight_folder.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/group.go b/internal/service/quicksight/group.go index a74f6544a3a0..4cf6317d27ec 100644 --- a/internal/service/quicksight/group.go +++ b/internal/service/quicksight/group.go @@ -9,25 +9,20 @@ import ( "log" "strings" - "github.com/YakDriver/regexache" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/quicksight" awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) -const ( - defaultGroupNamespace = "default" -) - // @SDKResource("aws_quicksight_group", name="Group") func resourceGroup() *schema.Resource { return &schema.Resource{ @@ -46,12 +41,7 @@ func resourceGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrDescription: { Type: schema.TypeString, Optional: true, @@ -61,16 +51,7 @@ func resourceGroup() *schema.Resource { Required: true, ForceNew: true, }, - names.AttrNamespace: { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: defaultGroupNamespace, - ValidateFunc: validation.All( - validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods"), - ), - }, + names.AttrNamespace: quicksightschema.NamespaceSchema(), } }, } diff --git a/internal/service/quicksight/group_data_source.go b/internal/service/quicksight/group_data_source.go index 28b296dea55b..88222c402f96 100644 --- a/internal/service/quicksight/group_data_source.go +++ b/internal/service/quicksight/group_data_source.go @@ -6,12 +6,11 @@ package quicksight import ( "context" - "github.com/YakDriver/regexache" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -26,11 +25,7 @@ func dataSourceGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDDataSourceSchema(), names.AttrDescription: { Type: schema.TypeString, Computed: true, @@ -39,15 +34,7 @@ func dataSourceGroup() *schema.Resource { Type: schema.TypeString, Required: true, }, - names.AttrNamespace: { - Type: schema.TypeString, - Optional: true, - Default: defaultGroupNamespace, - ValidateFunc: validation.All( - validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods"), - ), - }, + names.AttrNamespace: quicksightschema.NamespaceDataSourceSchema(), "principal_id": { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/group_data_source_test.go b/internal/service/quicksight/group_data_source_test.go index 312dc447f9df..0ff51c45a124 100644 --- a/internal/service/quicksight/group_data_source_test.go +++ b/internal/service/quicksight/group_data_source_test.go @@ -33,7 +33,7 @@ func TestAccQuickSightGroupDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceName, names.AttrGroupName, resourceName, names.AttrGroupName), resource.TestCheckResourceAttrPair(dataSourceName, names.AttrARN, resourceName, names.AttrARN), resource.TestCheckResourceAttr(dataSourceName, names.AttrDescription, "text1"), - resource.TestCheckResourceAttr(dataSourceName, names.AttrNamespace, tfquicksight.DefaultGroupNamespace), + resource.TestCheckResourceAttr(dataSourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), resource.TestCheckResourceAttrSet(dataSourceName, "principal_id"), ), }, diff --git a/internal/service/quicksight/group_membership.go b/internal/service/quicksight/group_membership.go index 49a5801de719..18ababdbae3f 100644 --- a/internal/service/quicksight/group_membership.go +++ b/internal/service/quicksight/group_membership.go @@ -9,17 +9,16 @@ import ( "log" "strings" - "github.com/YakDriver/regexache" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/quicksight" awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -42,12 +41,7 @@ func resourceGroupMembership() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrGroupName: { Type: schema.TypeString, Required: true, @@ -58,16 +52,7 @@ func resourceGroupMembership() *schema.Resource { Required: true, ForceNew: true, }, - names.AttrNamespace: { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "default", - ValidateFunc: validation.All( - validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods"), - ), - }, + names.AttrNamespace: quicksightschema.NamespaceSchema(), } }, } diff --git a/internal/service/quicksight/iam_policy_assignment.go b/internal/service/quicksight/iam_policy_assignment.go index d758555dc705..171a54d9529c 100644 --- a/internal/service/quicksight/iam_policy_assignment.go +++ b/internal/service/quicksight/iam_policy_assignment.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -56,23 +56,9 @@ func (r *iamPolicyAssignmentResource) Schema(ctx context.Context, request resour CustomType: fwtypes.StringEnumType[awstypes.AssignmentStatus](), Required: true, }, - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - names.AttrID: framework.IDAttribute(), - names.AttrNamespace: schema.StringAttribute{ - Optional: true, - Computed: true, - Default: stringdefault.StaticString("default"), - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + names.AttrID: framework.IDAttribute(), + names.AttrNamespace: quicksightschema.NamespaceAttribute(), "policy_arn": schema.StringAttribute{ CustomType: fwtypes.ARNType, Optional: true, @@ -109,7 +95,7 @@ func (r *iamPolicyAssignmentResource) Create(ctx context.Context, request resour if response.Diagnostics.HasError() { return } - if data.AWSAccountID.IsUnknown() || data.AWSAccountID.IsNull() { + if data.AWSAccountID.IsUnknown() { data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } diff --git a/internal/service/quicksight/iam_policy_assignment_test.go b/internal/service/quicksight/iam_policy_assignment_test.go index e111b9b92a4f..bbd1d117c45f 100644 --- a/internal/service/quicksight/iam_policy_assignment_test.go +++ b/internal/service/quicksight/iam_policy_assignment_test.go @@ -37,7 +37,7 @@ func TestAccQuickSightIAMPolicyAssignment_basic(t *testing.T) { testAccCheckIAMPolicyAssignmentExists(ctx, resourceName, &assignment), resource.TestCheckResourceAttr(resourceName, "assignment_name", rName), resource.TestCheckResourceAttr(resourceName, "assignment_status", string(awstypes.AssignmentStatusEnabled)), - resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, "default"), + resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), ), }, { @@ -91,7 +91,7 @@ func TestAccQuickSightIAMPolicyAssignment_assignmentStatus(t *testing.T) { testAccCheckIAMPolicyAssignmentExists(ctx, resourceName, &assignment), resource.TestCheckResourceAttr(resourceName, "assignment_name", rName), resource.TestCheckResourceAttr(resourceName, "assignment_status", string(awstypes.AssignmentStatusDraft)), - resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, "default"), + resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), ), }, { @@ -105,7 +105,7 @@ func TestAccQuickSightIAMPolicyAssignment_assignmentStatus(t *testing.T) { testAccCheckIAMPolicyAssignmentExists(ctx, resourceName, &assignment), resource.TestCheckResourceAttr(resourceName, "assignment_name", rName), resource.TestCheckResourceAttr(resourceName, "assignment_status", string(awstypes.AssignmentStatusEnabled)), - resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, "default"), + resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), ), }, { @@ -114,7 +114,7 @@ func TestAccQuickSightIAMPolicyAssignment_assignmentStatus(t *testing.T) { testAccCheckIAMPolicyAssignmentExists(ctx, resourceName, &assignment), resource.TestCheckResourceAttr(resourceName, "assignment_name", rName), resource.TestCheckResourceAttr(resourceName, "assignment_status", string(awstypes.AssignmentStatusDisabled)), - resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, "default"), + resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), ), }, }, @@ -141,7 +141,7 @@ func TestAccQuickSightIAMPolicyAssignment_identities(t *testing.T) { testAccCheckIAMPolicyAssignmentExists(ctx, resourceName, &assignment), resource.TestCheckResourceAttr(resourceName, "assignment_name", rName), resource.TestCheckResourceAttr(resourceName, "assignment_status", string(awstypes.AssignmentStatusEnabled)), - resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, "default"), + resource.TestCheckResourceAttr(resourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), resource.TestCheckResourceAttr(resourceName, "identities.#", "1"), resource.TestCheckResourceAttr(resourceName, "identities.0.user.#", "1"), resource.TestCheckResourceAttrPair(resourceName, "identities.0.user.0", userResourceName, names.AttrUserName), diff --git a/internal/service/quicksight/ingestion.go b/internal/service/quicksight/ingestion.go index 90f98419e584..6535658e2ce2 100644 --- a/internal/service/quicksight/ingestion.go +++ b/internal/service/quicksight/ingestion.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -49,14 +50,7 @@ func (r *ingestionResource) Schema(ctx context.Context, req resource.SchemaReque names.AttrARN: schema.StringAttribute{ Computed: true, }, - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), "data_set_id": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ @@ -87,46 +81,46 @@ func (r *ingestionResource) Schema(ctx context.Context, req resource.SchemaReque } func (r *ingestionResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan ingestionResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data ingestionResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) } - awsAccountID, dataSetID, ingestionID := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.DataSetID), flex.StringValueFromFramework(ctx, plan.IngestionID) + + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, dataSetID, ingestionID := flex.StringValueFromFramework(ctx, data.AWSAccountID), flex.StringValueFromFramework(ctx, data.DataSetID), flex.StringValueFromFramework(ctx, data.IngestionID) in := quicksight.CreateIngestionInput{ AwsAccountId: aws.String(awsAccountID), DataSetId: aws.String(dataSetID), IngestionId: aws.String(ingestionID), - IngestionType: awstypes.IngestionType(plan.IngestionType.ValueString()), + IngestionType: awstypes.IngestionType(data.IngestionType.ValueString()), } out, err := conn.CreateIngestion(ctx, &in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameIngestion, plan.IngestionID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameIngestion, data.IngestionID.String(), nil), err.Error(), ) return } if out == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameIngestion, plan.IngestionID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameIngestion, data.IngestionID.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = flex.StringValueToFramework(ctx, ingestionCreateResourceID(awsAccountID, dataSetID, ingestionID)) - plan.ARN = flex.StringToFramework(ctx, out.Arn) - plan.IngestionStatus = flex.StringValueToFramework(ctx, out.IngestionStatus) + data.ID = flex.StringValueToFramework(ctx, ingestionCreateResourceID(awsAccountID, dataSetID, ingestionID)) + data.ARN = flex.StringToFramework(ctx, out.Arn) + data.IngestionStatus = flex.StringValueToFramework(ctx, out.IngestionStatus) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *ingestionResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { diff --git a/internal/service/quicksight/ip_restriction.go b/internal/service/quicksight/ip_restriction.go index 8e7b40fb8535..f4ea103e5e13 100644 --- a/internal/service/quicksight/ip_restriction.go +++ b/internal/service/quicksight/ip_restriction.go @@ -16,8 +16,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -27,6 +25,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -45,17 +44,7 @@ type ipRestrictionResource struct { func (r *ipRestrictionResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { response.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - Validators: []validator.String{ - fwvalidators.AWSAccountID(), - }, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), names.AttrEnabled: schema.BoolAttribute{ Required: true, }, diff --git a/internal/service/quicksight/key_registration.go b/internal/service/quicksight/key_registration.go index a617f78343d4..969485164783 100644 --- a/internal/service/quicksight/key_registration.go +++ b/internal/service/quicksight/key_registration.go @@ -15,15 +15,13 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -42,17 +40,7 @@ type keyRegistrationResource struct { func (r *keyRegistrationResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { response.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - Validators: []validator.String{ - fwvalidators.AWSAccountID(), - }, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), }, Blocks: map[string]schema.Block{ "key_registration": schema.SetNestedBlock{ diff --git a/internal/service/quicksight/namespace.go b/internal/service/quicksight/namespace.go index 9056b7760d39..3433899190f8 100644 --- a/internal/service/quicksight/namespace.go +++ b/internal/service/quicksight/namespace.go @@ -25,7 +25,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -57,15 +58,8 @@ type namespaceResource struct { func (r *namespaceResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrARN: framework.ARNAttributeComputedOnly(), - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrARN: framework.ARNAttributeComputedOnly(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), "capacity_region": schema.StringAttribute{ Computed: true, PlanModifiers: []planmodifier.String{ @@ -106,21 +100,21 @@ func (r *namespaceResource) Schema(ctx context.Context, req resource.SchemaReque } func (r *namespaceResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan namespaceResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data namespaceResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - awsAccountID, namespace := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.Namespace) + + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, namespace := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.Namespace) in := quicksight.CreateNamespaceInput{ AwsAccountId: aws.String(awsAccountID), - IdentityStore: awstypes.IdentityStore(plan.IdentityStore.ValueString()), + IdentityStore: awstypes.IdentityStore(data.IdentityStore.ValueString()), Namespace: aws.String(namespace), Tags: getTagsIn(ctx), } @@ -128,35 +122,35 @@ func (r *namespaceResource) Create(ctx context.Context, req resource.CreateReque out, err := conn.CreateNamespace(ctx, &in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameNamespace, plan.Namespace.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameNamespace, data.Namespace.String(), err), err.Error(), ) return } if out == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameNamespace, plan.Namespace.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameNamespace, data.Namespace.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = flex.StringValueToFramework(ctx, namespaceCreateResourceID(awsAccountID, namespace)) + data.ID = fwflex.StringValueToFramework(ctx, namespaceCreateResourceID(awsAccountID, namespace)) - waitOut, err := waitNamespaceCreated(ctx, conn, awsAccountID, namespace, r.CreateTimeout(ctx, plan.Timeouts)) + waitOut, err := waitNamespaceCreated(ctx, conn, awsAccountID, namespace, r.CreateTimeout(ctx, data.Timeouts)) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionWaitingForCreation, resNameNamespace, plan.Namespace.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionWaitingForCreation, resNameNamespace, data.Namespace.String(), err), err.Error(), ) return } - plan.ARN = flex.StringToFramework(ctx, waitOut.Arn) - plan.CapacityRegion = flex.StringToFramework(ctx, waitOut.CapacityRegion) - plan.CreationStatus = flex.StringValueToFramework(ctx, waitOut.CreationStatus) - plan.IdentityStore = flex.StringValueToFramework(ctx, waitOut.IdentityStore) + data.ARN = fwflex.StringToFramework(ctx, waitOut.Arn) + data.CapacityRegion = fwflex.StringToFramework(ctx, waitOut.CapacityRegion) + data.CreationStatus = fwflex.StringValueToFramework(ctx, waitOut.CreationStatus) + data.IdentityStore = fwflex.StringValueToFramework(ctx, waitOut.IdentityStore) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *namespaceResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -190,12 +184,12 @@ func (r *namespaceResource) Read(ctx context.Context, req resource.ReadRequest, return } - state.ARN = flex.StringToFramework(ctx, out.Arn) - state.CapacityRegion = flex.StringToFramework(ctx, out.CapacityRegion) - state.CreationStatus = flex.StringValueToFramework(ctx, out.CreationStatus) - state.IdentityStore = flex.StringValueToFramework(ctx, out.IdentityStore) - state.AWSAccountID = flex.StringValueToFramework(ctx, awsAccountID) - state.Namespace = flex.StringValueToFramework(ctx, namespace) + state.ARN = fwflex.StringToFramework(ctx, out.Arn) + state.CapacityRegion = fwflex.StringToFramework(ctx, out.CapacityRegion) + state.CreationStatus = fwflex.StringValueToFramework(ctx, out.CreationStatus) + state.IdentityStore = fwflex.StringValueToFramework(ctx, out.IdentityStore) + state.AWSAccountID = fwflex.StringValueToFramework(ctx, awsAccountID) + state.Namespace = fwflex.StringValueToFramework(ctx, namespace) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } diff --git a/internal/service/quicksight/namespace_tags_gen_test.go b/internal/service/quicksight/namespace_tags_gen_test.go index b3c964fab20f..88df27f4e909 100644 --- a/internal/service/quicksight/namespace_tags_gen_test.go +++ b/internal/service/quicksight/namespace_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightNamespace_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightNamespace_tags_null(t *testing.T) { t.Skip("Resource Namespace does not support null tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccQuickSightNamespace_tags_null(t *testing.T) { func TestAccQuickSightNamespace_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -314,6 +317,7 @@ func TestAccQuickSightNamespace_tags_EmptyMap(t *testing.T) { func TestAccQuickSightNamespace_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -396,6 +400,7 @@ func TestAccQuickSightNamespace_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Namespace does not support empty tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -488,6 +493,7 @@ func TestAccQuickSightNamespace_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Namespace does not support empty tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -629,6 +635,7 @@ func TestAccQuickSightNamespace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Namespace does not support empty tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -719,6 +726,7 @@ func TestAccQuickSightNamespace_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightNamespace_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -900,6 +908,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightNamespace_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1060,6 +1069,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightNamespace_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1236,6 +1246,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightNamespace_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1326,6 +1337,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_updateToProviderOnly(t *testing func TestAccQuickSightNamespace_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1417,6 +1429,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource Namespace does not support empty tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1485,6 +1498,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_emptyProviderOnlyTag(t *testing t.Skip("Resource Namespace does not support empty tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1545,6 +1559,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_nullOverlappingResourceTag(t *t t.Skip("Resource Namespace does not support null tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1616,6 +1631,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Namespace does not support null tags") ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1703,7 @@ func TestAccQuickSightNamespace_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccQuickSightNamespace_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1742,6 +1759,7 @@ func TestAccQuickSightNamespace_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightNamespace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1839,6 +1857,7 @@ func TestAccQuickSightNamespace_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightNamespace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1926,6 +1945,7 @@ func TestAccQuickSightNamespace_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccQuickSightNamespace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2088,6 +2108,7 @@ func TestAccQuickSightNamespace_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccQuickSightNamespace_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.NamespaceInfoV2 resourceName := "aws_quicksight_namespace.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/quicksight_test.go b/internal/service/quicksight/quicksight_test.go index 03995f196fa1..d60dbf4c0d56 100644 --- a/internal/service/quicksight/quicksight_test.go +++ b/internal/service/quicksight/quicksight_test.go @@ -41,6 +41,11 @@ func TestAccQuickSight_serial(t *testing.T) { acctest.CtBasic: testAccKeyRegistration_basic, acctest.CtDisappears: testAccKeyRegistration_disappears, }, + "RoleCustomPermission": { + acctest.CtBasic: testAccRoleCustomPermission_basic, + acctest.CtDisappears: testAccRoleCustomPermission_disappears, + "update": testAccRoleCustomPermission_update, + }, "RoleMembership": { acctest.CtBasic: testAccRoleMembership_basic, acctest.CtDisappears: testAccRoleMembership_disappears, diff --git a/internal/service/quicksight/refresh_schedule.go b/internal/service/quicksight/refresh_schedule.go index af1e3d223812..bdc8d5636b47 100644 --- a/internal/service/quicksight/refresh_schedule.go +++ b/internal/service/quicksight/refresh_schedule.go @@ -31,8 +31,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -60,15 +61,8 @@ type refreshScheduleResource struct { func (r *refreshScheduleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrARN: framework.ARNAttributeComputedOnly(), - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrARN: framework.ARNAttributeComputedOnly(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), "data_set_id": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ @@ -204,28 +198,27 @@ type refreshOnDayModel struct { } func (r *refreshScheduleResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan refreshScheduleResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data refreshScheduleResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - awsAccountID, dataSetID, scheduleID := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.DataSetID), flex.StringValueFromFramework(ctx, plan.ScheduleID) + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, dataSetID, scheduleID := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.DataSetID), fwflex.StringValueFromFramework(ctx, data.ScheduleID) var in quicksight.CreateRefreshScheduleInput - resp.Diagnostics.Append(flex.Expand(ctx, plan, &in)...) + resp.Diagnostics.Append(fwflex.Expand(ctx, data, &in)...) if resp.Diagnostics.HasError() { return } - in.Schedule.ScheduleId = plan.ScheduleID.ValueStringPointer() + in.Schedule.ScheduleId = data.ScheduleID.ValueStringPointer() // Because StartAfterDateTime is a string and not a time type, we have to handle it outside of AutoFlex - schedule, diags := plan.Schedule.ToPtr(ctx) + schedule, diags := data.Schedule.ToPtr(ctx) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -238,34 +231,34 @@ func (r *refreshScheduleResource) Create(ctx context.Context, req resource.Creat out, err := conn.CreateRefreshSchedule(ctx, &in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameRefreshSchedule, plan.ScheduleID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameRefreshSchedule, data.ScheduleID.String(), nil), err.Error(), ) return } if out == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameRefreshSchedule, plan.ScheduleID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameRefreshSchedule, data.ScheduleID.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = flex.StringValueToFramework(ctx, refreshScheduleCreateResourceID(awsAccountID, dataSetID, scheduleID)) + data.ID = fwflex.StringValueToFramework(ctx, refreshScheduleCreateResourceID(awsAccountID, dataSetID, scheduleID)) _, outFind, err := findRefreshScheduleByThreePartKey(ctx, conn, awsAccountID, dataSetID, scheduleID) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionReading, resNameRefreshSchedule, plan.ID.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionReading, resNameRefreshSchedule, data.ID.String(), nil), err.Error(), ) return } - resp.Diagnostics.Append(plan.refreshFromRead(ctx, out.Arn, outFind)...) + resp.Diagnostics.Append(data.refreshFromRead(ctx, out.Arn, outFind)...) // resp.Diagnostics.Append(flex.Flatten(ctx, outFind, &plan)...) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *refreshScheduleResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -299,9 +292,9 @@ func (r *refreshScheduleResource) Read(ctx context.Context, req resource.ReadReq return } - state.AWSAccountID = flex.StringValueToFramework(ctx, awsAccountID) - state.DataSetID = flex.StringValueToFramework(ctx, dataSetID) - state.ScheduleID = flex.StringValueToFramework(ctx, scheduleID) + state.AWSAccountID = fwflex.StringValueToFramework(ctx, awsAccountID) + state.DataSetID = fwflex.StringValueToFramework(ctx, dataSetID) + state.ScheduleID = fwflex.StringValueToFramework(ctx, scheduleID) resp.Diagnostics.Append(state.refreshFromRead(ctx, arn, outFind)...) // resp.Diagnostics.Append(flex.Flatten(ctx, outFind, &state)...) @@ -330,7 +323,7 @@ func (r *refreshScheduleResource) Update(ctx context.Context, req resource.Updat if !plan.Schedule.Equal(state.Schedule) { var in quicksight.UpdateRefreshScheduleInput - resp.Diagnostics.Append(flex.Expand(ctx, plan, &in)...) + resp.Diagnostics.Append(fwflex.Expand(ctx, plan, &in)...) if resp.Diagnostics.HasError() { return } @@ -506,7 +499,7 @@ func (rd *refreshScheduleResourceModel) refreshFromRead(ctx context.Context, arn return diags } - rd.ARN = flex.StringToFramework(ctx, arn) + rd.ARN = fwflex.StringToFramework(ctx, arn) schedule, d := flattenSchedule(ctx, out) diags.Append(d...) @@ -524,7 +517,7 @@ func flattenSchedule(ctx context.Context, apiObject *awstypes.RefreshSchedule) ( var model scheduleModel - diags.Append(flex.Flatten(ctx, apiObject, &model)...) + diags.Append(fwflex.Flatten(ctx, apiObject, &model)...) if apiObject.StartAfterDateTime != nil { model.StartAfterDateTime = types.StringValue(apiObject.StartAfterDateTime.Format(startAfterDateTimeLayout)) diff --git a/internal/service/quicksight/role_custom_permission.go b/internal/service/quicksight/role_custom_permission.go new file mode 100644 index 000000000000..a8a0cb8be4a3 --- /dev/null +++ b/internal/service/quicksight/role_custom_permission.go @@ -0,0 +1,232 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/quicksight" + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource("aws_quicksight_role_custom_permission", name="Role Custom Permission") +func newRoleCustomPermissionResource(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &roleCustomPermissionResource{} + + return r, nil +} + +type roleCustomPermissionResource struct { + framework.ResourceWithModel[roleCustomPermissionResourceModel] +} + +func (r *roleCustomPermissionResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + "custom_permissions_name": schema.StringAttribute{ + Required: true, + }, + names.AttrNamespace: quicksightschema.NamespaceAttribute(), + names.AttrRole: schema.StringAttribute{ + CustomType: fwtypes.StringEnumType[awstypes.Role](), + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + }, + } +} + +func (r *roleCustomPermissionResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data roleCustomPermissionResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.UpdateRoleCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateRoleCustomPermission(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight Role (%s) Custom Permission (%s)", data.Role.ValueString(), data.CustomPermissionsName.ValueString()), err.Error()) + + return + } + + response.Diagnostics.Append(response.State.Set(ctx, data)...) +} + +func (r *roleCustomPermissionResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data roleCustomPermissionResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + output, err := findRoleCustomPermissionByThreePartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.Role.ValueEnum()) + + if tfresource.NotFound(err) { + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight Role (%s) Custom Permission", data.Role.ValueString()), err.Error()) + + return + } + + // Set attributes for import. + data.CustomPermissionsName = fwflex.StringToFramework(ctx, output) + + response.Diagnostics.Append(response.State.Set(ctx, &data)...) +} + +func (r *roleCustomPermissionResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old roleCustomPermissionResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &new)...) + if response.Diagnostics.HasError() { + return + } + response.Diagnostics.Append(request.State.Get(ctx, &old)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.UpdateRoleCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, new, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateRoleCustomPermission(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("updating Quicksight Role (%s) Custom Permission (%s)", new.Role.ValueString(), new.CustomPermissionsName.ValueString()), err.Error()) + + return + } + + response.Diagnostics.Append(response.State.Set(ctx, &new)...) +} + +func (r *roleCustomPermissionResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data roleCustomPermissionResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.DeleteRoleCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.DeleteRoleCustomPermission(ctx, &input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("deleting Quicksight Role (%s) Custom Permission (%s)", data.Role.ValueString(), data.CustomPermissionsName.ValueString()), err.Error()) + + return + } +} + +func (r *roleCustomPermissionResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + const ( + roleCustomPermissionIDParts = 3 + ) + parts, err := intflex.ExpandResourceId(request.ID, roleCustomPermissionIDParts, true) + + if err != nil { + response.Diagnostics.Append(fwdiag.NewParsingResourceIDErrorDiagnostic(err)) + + return + } + + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrAWSAccountID), parts[0])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrNamespace), parts[1])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRole), parts[2])...) +} + +func findRoleCustomPermissionByThreePartKey(ctx context.Context, conn *quicksight.Client, awsAccountID, namespace string, role awstypes.Role) (*string, error) { + input := quicksight.DescribeRoleCustomPermissionInput{ + AwsAccountId: aws.String(awsAccountID), + Namespace: aws.String(namespace), + Role: role, + } + + return findRoleCustomPermission(ctx, conn, &input) +} + +func findRoleCustomPermission(ctx context.Context, conn *quicksight.Client, input *quicksight.DescribeRoleCustomPermissionInput) (*string, error) { + output, err := conn.DescribeRoleCustomPermission(ctx, input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || aws.ToString(output.CustomPermissionsName) == "" { + return nil, tfresource.NewEmptyResultError(&input) + } + + return output.CustomPermissionsName, nil +} + +type roleCustomPermissionResourceModel struct { + framework.WithRegionModel + AWSAccountID types.String `tfsdk:"aws_account_id"` + CustomPermissionsName types.String `tfsdk:"custom_permissions_name"` + Namespace types.String `tfsdk:"namespace"` + Role fwtypes.StringEnum[awstypes.Role] `tfsdk:"role"` +} diff --git a/internal/service/quicksight/role_custom_permission_test.go b/internal/service/quicksight/role_custom_permission_test.go new file mode 100644 index 000000000000..675a51e410f5 --- /dev/null +++ b/internal/service/quicksight/role_custom_permission_test.go @@ -0,0 +1,236 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight_test + +import ( + "context" + "fmt" + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func testAccRoleCustomPermission_basic(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_role_custom_permission.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRoleCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRoleCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoleCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRole), tfknownvalue.StringExact(awstypes.RoleReader)), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccRoleCustomPermissionImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func testAccRoleCustomPermission_disappears(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_role_custom_permission.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRoleCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRoleCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoleCustomPermissionExists(ctx, resourceName), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfquicksight.ResourceRoleCustomPermission, resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccRoleCustomPermission_update(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_quicksight_role_custom_permission.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRoleCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRoleCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoleCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRole), tfknownvalue.StringExact(awstypes.RoleReader)), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccRoleCustomPermissionImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + Config: testAccRoleCustomPermissionConfig_updated(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRoleCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName+"-2")), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRole), tfknownvalue.StringExact(awstypes.RoleReader)), + }, + }, + }, + }) +} + +func testAccCheckRoleCustomPermissionDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_quicksight_role_custom_permission" { + continue + } + + _, err := tfquicksight.FindRoleCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole])) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("QuickSight Role Custom Permission (%s) still exists", rs.Primary.Attributes[names.AttrRole]) + } + + return nil + } +} + +func testAccCheckRoleCustomPermissionExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + _, err := tfquicksight.FindRoleCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole])) + + return err + } +} + +func testAccRoleCustomPermissionImportStateID(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return acctest.AttrsImportStateIdFunc(n, ",", names.AttrAWSAccountID, names.AttrNamespace, names.AttrRole)(s) + } +} + +func testAccRoleCustomPermissionConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccCustomPermissionsConfig_basic(rName), ` +resource "aws_quicksight_role_custom_permission" "test" { + role = "READER" + custom_permissions_name = aws_quicksight_custom_permissions.test.custom_permissions_name +} +`) +} + +func testAccRoleCustomPermissionConfig_updated(rName string) string { + return acctest.ConfigCompose(testAccCustomPermissionsConfig_basic(rName), fmt.Sprintf(` +resource "aws_quicksight_custom_permissions" "test2" { + custom_permissions_name = "%[1]s-2" + + capabilities { + create_and_update_datasets = "DENY" + create_and_update_data_sources = "DENY" + export_to_pdf = "DENY" + } +} + +resource "aws_quicksight_role_custom_permission" "test" { + role = "READER" + custom_permissions_name = aws_quicksight_custom_permissions.test2.custom_permissions_name +} +`, rName)) +} diff --git a/internal/service/quicksight/role_membership.go b/internal/service/quicksight/role_membership.go index bc3010627e72..6434077d7525 100644 --- a/internal/service/quicksight/role_membership.go +++ b/internal/service/quicksight/role_membership.go @@ -15,15 +15,16 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -33,40 +34,22 @@ func newRoleMembershipResource(_ context.Context) (resource.ResourceWithConfigur return &roleMembershipResource{}, nil } -const ( - ResNameRoleMembership = "Role Membership" -) - type roleMembershipResource struct { framework.ResourceWithModel[roleMembershipResourceModel] framework.WithNoUpdate } -func (r *roleMembershipResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ +func (r *roleMembershipResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), "member_name": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), }, }, - names.AttrNamespace: schema.StringAttribute{ - Optional: true, - Computed: true, - Default: stringdefault.StaticString("default"), - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, + names.AttrNamespace: quicksightschema.NamespaceAttribute(), names.AttrRole: schema.StringAttribute{ CustomType: fwtypes.StringEnumType[awstypes.Role](), Required: true, @@ -78,128 +61,125 @@ func (r *roleMembershipResource) Schema(ctx context.Context, req resource.Schema } } -func (r *roleMembershipResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan roleMembershipResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) - if resp.Diagnostics.HasError() { +func (r *roleMembershipResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data roleMembershipResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &data)...) + if response.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - input := quicksight.CreateRoleMembershipInput{ - AwsAccountId: plan.AWSAccountID.ValueStringPointer(), - MemberName: plan.MemberName.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - Role: plan.Role.ValueEnum(), + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.CreateRoleMembershipInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return } _, err := conn.CreateRoleMembership(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, ResNameRoleMembership, plan.MemberName.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight Role (%s) Membership (%s)", data.Role.ValueString(), data.MemberName.ValueString()), err.Error()) + return } - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + response.Diagnostics.Append(response.State.Set(ctx, data)...) } -func (r *roleMembershipResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var state roleMembershipResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - if resp.Diagnostics.HasError() { +func (r *roleMembershipResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data roleMembershipResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { return } - err := findRoleMembershipByMultiPartKey(ctx, conn, state.AWSAccountID.ValueString(), state.Namespace.ValueString(), state.Role.ValueEnum(), state.MemberName.ValueString()) + conn := r.Meta().QuickSightClient(ctx) + + err := findRoleMembershipByFourPartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.Role.ValueEnum(), data.MemberName.ValueString()) if tfresource.NotFound(err) { - resp.State.RemoveResource(ctx) + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + return } + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionSetting, ResNameRoleMembership, state.MemberName.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("reading Quicksight Role (%s) Membership (%s)", data.Role.ValueString(), data.MemberName.ValueString()), err.Error()) + return } - resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) + response.Diagnostics.Append(response.State.Set(ctx, &data)...) } -func (r *roleMembershipResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { +func (r *roleMembershipResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data roleMembershipResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + conn := r.Meta().QuickSightClient(ctx) - var state roleMembershipResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - if resp.Diagnostics.HasError() { + var input quicksight.DeleteRoleMembershipInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { return } - input := quicksight.DeleteRoleMembershipInput{ - AwsAccountId: state.AWSAccountID.ValueStringPointer(), - MemberName: state.MemberName.ValueStringPointer(), - Namespace: state.Namespace.ValueStringPointer(), - Role: state.Role.ValueEnum(), + _, err := conn.DeleteRoleMembership(ctx, &input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return } - _, err := conn.DeleteRoleMembership(ctx, &input) if err != nil { - if errs.IsA[*awstypes.ResourceNotFoundException](err) { - return - } + response.Diagnostics.AddError(fmt.Sprintf("deleting Quicksight Role (%s) Membership (%s)", data.Role.ValueString(), data.MemberName.ValueString()), err.Error()) - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionDeleting, ResNameRoleMembership, state.MemberName.String(), err), - err.Error(), - ) return } } -const roleMembershipIDParts = 4 +func (r *roleMembershipResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + const ( + roleMembershipIDParts = 4 + ) + parts, err := intflex.ExpandResourceId(request.ID, roleMembershipIDParts, false) -func (r *roleMembershipResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - parts, err := intflex.ExpandResourceId(req.ID, roleMembershipIDParts, false) if err != nil { - resp.Diagnostics.AddError( - "Unexpected Import Identifier", - fmt.Sprintf("Expected import identifier with format: aws_account_id,namespace,role,member_name. Got: %q", req.ID), - ) + response.Diagnostics.Append(fwdiag.NewParsingResourceIDErrorDiagnostic(err)) + return } - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root(names.AttrAWSAccountID), parts[0])...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root(names.AttrNamespace), parts[1])...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root(names.AttrRole), parts[2])...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("member_name"), parts[3])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrAWSAccountID), parts[0])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrNamespace), parts[1])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrRole), parts[2])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root("member_name"), parts[3])...) } -// findRoleMembershipByMultiPartKey verifies the existence of a role membership +// findRoleMembershipByFourPartKey verifies the existence of a role membership // // No value is returned, but the error will be non-nil if no matching member name // is found in the list of group members for the provided role. -func findRoleMembershipByMultiPartKey(ctx context.Context, conn *quicksight.Client, accountID string, namespace string, role awstypes.Role, member string) error { +func findRoleMembershipByFourPartKey(ctx context.Context, conn *quicksight.Client, awsAccountID, namespace string, role awstypes.Role, member string) error { input := quicksight.ListRoleMembershipsInput{ - AwsAccountId: aws.String(accountID), + AwsAccountId: aws.String(awsAccountID), Namespace: aws.String(namespace), Role: role, } - out, err := findRoleMemberships(ctx, conn, &input) + members, err := findRoleMembers(ctx, conn, &input) + if err != nil { return err } - if slices.Contains(out, member) { + if slices.Contains(members, member) { return nil } @@ -208,20 +188,28 @@ func findRoleMembershipByMultiPartKey(ctx context.Context, conn *quicksight.Clie } } -func findRoleMemberships(ctx context.Context, conn *quicksight.Client, input *quicksight.ListRoleMembershipsInput) ([]string, error) { - paginator := quicksight.NewListRoleMembershipsPaginator(conn, input) +func findRoleMembers(ctx context.Context, conn *quicksight.Client, input *quicksight.ListRoleMembershipsInput) ([]string, error) { + var output []string + + pages := quicksight.NewListRoleMembershipsPaginator(conn, input) + for pages.HasMorePages() { + page, err := pages.NextPage(ctx) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } - var memberNames []string - for paginator.HasMorePages() { - page, err := paginator.NextPage(ctx) if err != nil { return nil, err } - memberNames = append(memberNames, page.MembersList...) + output = append(output, page.MembersList...) } - return memberNames, nil + return output, nil } type roleMembershipResourceModel struct { diff --git a/internal/service/quicksight/role_membership_test.go b/internal/service/quicksight/role_membership_test.go index 00637411f7ff..7ddde49cd405 100644 --- a/internal/service/quicksight/role_membership_test.go +++ b/internal/service/quicksight/role_membership_test.go @@ -5,17 +5,15 @@ package quicksight_test import ( "context" - "errors" "fmt" "testing" - "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/create" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -23,10 +21,9 @@ import ( func testAccRoleMembership_basic(t *testing.T) { ctx := acctest.Context(t) - role := string(types.RoleReader) - resourceName := "aws_quicksight_role_membership.test" - memberName := acctest.SkipIfEnvVarNotSet(t, "TF_AWS_QUICKSIGHT_IDC_GROUP") + role := string(awstypes.RoleReader) + resourceName := "aws_quicksight_role_membership.test" resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -50,7 +47,7 @@ func testAccRoleMembership_basic(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccRoleMembershipImportStateIdFunc(resourceName), + ImportStateIdFunc: testAccRoleMembershipImportStateIDFunc(resourceName), ImportStateVerify: true, ImportStateVerifyIdentifierAttribute: "member_name", }, @@ -60,10 +57,9 @@ func testAccRoleMembership_basic(t *testing.T) { func testAccRoleMembership_disappears(t *testing.T) { ctx := acctest.Context(t) - role := string(types.RoleReader) - resourceName := "aws_quicksight_role_membership.test" - memberName := acctest.SkipIfEnvVarNotSet(t, "TF_AWS_QUICKSIGHT_IDC_GROUP") + role := string(awstypes.RoleReader) + resourceName := "aws_quicksight_role_membership.test" resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -90,11 +86,10 @@ func testAccRoleMembership_disappears(t *testing.T) { func testAccRoleMembership_role(t *testing.T) { ctx := acctest.Context(t) - role := string(types.RoleReader) - roleUpdated := string(types.RoleAuthor) - resourceName := "aws_quicksight_role_membership.test" - memberName := acctest.SkipIfEnvVarNotSet(t, "TF_AWS_QUICKSIGHT_IDC_GROUP") + role := string(awstypes.RoleReader) + roleUpdated := string(awstypes.RoleAuthor) + resourceName := "aws_quicksight_role_membership.test" resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -141,65 +136,41 @@ func testAccCheckRoleMembershipDestroy(ctx context.Context) resource.TestCheckFu continue } - accountID := rs.Primary.Attributes[names.AttrAWSAccountID] - namespace := rs.Primary.Attributes[names.AttrNamespace] - role := rs.Primary.Attributes[names.AttrRole] - memberName := rs.Primary.Attributes["member_name"] + err := tfquicksight.FindRoleMembershipByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole]), rs.Primary.Attributes["member_name"]) - err := tfquicksight.FindRoleMembershipByMultiPartKey(ctx, conn, accountID, namespace, types.Role(role), memberName) if tfresource.NotFound(err) { - return nil + continue } + if err != nil { - return create.Error(names.QuickSight, create.ErrActionCheckingDestroyed, tfquicksight.ResNameRoleMembership, rs.Primary.ID, err) + return err } - return create.Error(names.QuickSight, create.ErrActionCheckingDestroyed, tfquicksight.ResNameRoleMembership, rs.Primary.ID, errors.New("not destroyed")) + return fmt.Errorf("QuickSight Role Membership (%s) still exists", rs.Primary.Attributes[names.AttrRole]) } return nil } } -func testAccCheckRoleMembershipExists(ctx context.Context, name string) resource.TestCheckFunc { +func testAccCheckRoleMembershipExists(ctx context.Context, n string) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] + rs, ok := s.RootModule().Resources[n] if !ok { - return create.Error(names.QuickSight, create.ErrActionCheckingExistence, tfquicksight.ResNameRoleMembership, name, errors.New("not found")) - } - - accountID := rs.Primary.Attributes[names.AttrAWSAccountID] - namespace := rs.Primary.Attributes[names.AttrNamespace] - role := rs.Primary.Attributes[names.AttrRole] - memberName := rs.Primary.Attributes["member_name"] - if accountID == "" || namespace == "" || role == "" || memberName == "" { - return create.Error(names.QuickSight, create.ErrActionCheckingExistence, tfquicksight.ResNameRoleMembership, name, errors.New("not set")) + return fmt.Errorf("Not found: %s", n) } conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) - err := tfquicksight.FindRoleMembershipByMultiPartKey(ctx, conn, accountID, namespace, types.Role(role), memberName) - if err != nil { - return create.Error(names.QuickSight, create.ErrActionCheckingExistence, tfquicksight.ResNameRoleMembership, rs.Primary.ID, err) - } + err := tfquicksight.FindRoleMembershipByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole]), rs.Primary.Attributes["member_name"]) - return nil + return err } } -func testAccRoleMembershipImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { +func testAccRoleMembershipImportStateIDFunc(n string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { - rs, ok := s.RootModule().Resources[resourceName] - if !ok { - return "", fmt.Errorf("Not found: %s", resourceName) - } - - return fmt.Sprintf("%s,%s,%s,%s", - rs.Primary.Attributes[names.AttrAWSAccountID], - rs.Primary.Attributes[names.AttrNamespace], - rs.Primary.Attributes[names.AttrRole], - rs.Primary.Attributes["member_name"], - ), nil + return acctest.AttrsImportStateIdFunc(n, ",", names.AttrAWSAccountID, names.AttrNamespace, names.AttrRole, "member_name")(s) } } diff --git a/internal/service/quicksight/schema/stdattributes.go b/internal/service/quicksight/schema/stdattributes.go new file mode 100644 index 000000000000..a0638686aa56 --- /dev/null +++ b/internal/service/quicksight/schema/stdattributes.go @@ -0,0 +1,101 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package schema + +import ( + "regexp" + + "github.com/YakDriver/regexache" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + fwschema "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + sdkschema "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/verify" +) + +func AWSAccountIDAttribute() fwschema.StringAttribute { // nosemgrep:ci.aws-in-func-name + return fwschema.StringAttribute{ + Optional: true, + Computed: true, + Validators: []validator.String{ + fwvalidators.AWSAccountID(), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + stringplanmodifier.RequiresReplace(), + }, + } +} + +func AWSAccountIDSchema() *sdkschema.Schema { // nosemgrep:ci.aws-in-func-name + return &sdkschema.Schema{ + Type: sdkschema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: verify.ValidAccountID, + } +} + +func AWSAccountIDDataSourceSchema() *sdkschema.Schema { // nosemgrep:ci.aws-in-func-name + return &sdkschema.Schema{ + Type: sdkschema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: verify.ValidAccountID, + } +} + +const ( + DefaultNamespace = "default" +) + +func NamespaceAttribute() fwschema.StringAttribute { + return fwschema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(DefaultNamespace), + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + stringvalidator.RegexMatches(namespaceRegex()), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + } +} + +func NamespaceSchema() *sdkschema.Schema { + return &sdkschema.Schema{ + Type: sdkschema.TypeString, + Optional: true, + ForceNew: true, + Default: DefaultNamespace, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 64), + validation.StringMatch(namespaceRegex()), + ), + } +} + +func NamespaceDataSourceSchema() *sdkschema.Schema { + return &sdkschema.Schema{ + Type: sdkschema.TypeString, + Optional: true, + Default: DefaultNamespace, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 64), + validation.StringMatch(namespaceRegex()), + ), + } +} + +func namespaceRegex() (*regexp.Regexp, string) { + return regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods" +} diff --git a/internal/service/quicksight/service_endpoint_resolver_gen.go b/internal/service/quicksight/service_endpoint_resolver_gen.go index 3c6a46e09805..402978520340 100644 --- a/internal/service/quicksight/service_endpoint_resolver_gen.go +++ b/internal/service/quicksight/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params quicksight.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up quicksight endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up quicksight endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index 891d31327945..ea7698f34e90 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -524,7 +524,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/quicksight/service_package_gen.go b/internal/service/quicksight/service_package_gen.go index d61537514a5f..0ffe4c882010 100644 --- a/internal/service/quicksight/service_package_gen.go +++ b/internal/service/quicksight/service_package_gen.go @@ -30,6 +30,15 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.Ser Name: "Account Settings", Region: unique.Make(inttypes.ResourceRegionDisabled()), }, + { + Factory: newCustomPermissionsResource, + TypeName: "aws_quicksight_custom_permissions", + Name: "Custom Permissions", + Tags: unique.Make(inttypes.ServicePackageResourceTags{ + IdentifierAttribute: names.AttrARN, + }), + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, { Factory: newFolderMembershipResource, TypeName: "aws_quicksight_folder_membership", @@ -75,6 +84,12 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.Ser Name: "Refresh Schedule", Region: unique.Make(inttypes.ResourceRegionDefault()), }, + { + Factory: newRoleCustomPermissionResource, + TypeName: "aws_quicksight_role_custom_permission", + Name: "Role Custom Permission", + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, { Factory: newRoleMembershipResource, TypeName: "aws_quicksight_role_membership", @@ -87,6 +102,12 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.Ser Name: "Template Alias", Region: unique.Make(inttypes.ResourceRegionDefault()), }, + { + Factory: newUserCustomPermissionResource, + TypeName: "aws_quicksight_user_custom_permission", + Name: "User Custom Permission", + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, { Factory: newVPCConnectionResource, TypeName: "aws_quicksight_vpc_connection", diff --git a/internal/service/quicksight/sweep.go b/internal/service/quicksight/sweep.go index 975f7a1c226a..c7a2ba27505e 100644 --- a/internal/service/quicksight/sweep.go +++ b/internal/service/quicksight/sweep.go @@ -13,6 +13,7 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" "github.com/hashicorp/terraform-provider-aws/internal/sweep/framework" @@ -249,7 +250,7 @@ func sweepGroups(region string) error { awsAccountID := client.AccountID(ctx) input := &quicksight.ListGroupsInput{ AwsAccountId: aws.String(awsAccountID), - Namespace: aws.String(defaultUserNamespace), + Namespace: aws.String(quicksightschema.DefaultNamespace), } pages := quicksight.NewListGroupsPaginator(conn, input) @@ -275,7 +276,7 @@ func sweepGroups(region string) error { r := resourceGroup() d := r.Data(nil) - d.SetId(groupCreateResourceID(awsAccountID, defaultUserNamespace, groupName)) + d.SetId(groupCreateResourceID(awsAccountID, quicksightschema.DefaultNamespace, groupName)) sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client)) } @@ -345,7 +346,7 @@ func sweepUsers(region string) error { awsAccountID := client.AccountID(ctx) input := &quicksight.ListUsersInput{ AwsAccountId: aws.String(awsAccountID), - Namespace: aws.String(defaultUserNamespace), + Namespace: aws.String(quicksightschema.DefaultNamespace), } pages := quicksight.NewListUsersPaginator(conn, input) @@ -371,7 +372,7 @@ func sweepUsers(region string) error { r := resourceUser() d := r.Data(nil) - d.SetId(userCreateResourceID(awsAccountID, defaultUserNamespace, userName)) + d.SetId(userCreateResourceID(awsAccountID, quicksightschema.DefaultNamespace, userName)) sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client)) } diff --git a/internal/service/quicksight/template.go b/internal/service/quicksight/template.go index e67904fcd23a..4bea3dfdc7d5 100644 --- a/internal/service/quicksight/template.go +++ b/internal/service/quicksight/template.go @@ -26,7 +26,6 @@ import ( tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -57,13 +56,7 @@ func resourceTemplate() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrCreatedTime: { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/template_alias.go b/internal/service/quicksight/template_alias.go index 05a00bcd801a..7e2b365e6b62 100644 --- a/internal/service/quicksight/template_alias.go +++ b/internal/service/quicksight/template_alias.go @@ -21,7 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -49,16 +50,9 @@ func (r *templateAliasResource) Schema(ctx context.Context, req resource.SchemaR stringplanmodifier.RequiresReplace(), }, }, - names.AttrARN: framework.ARNAttributeComputedOnly(), - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - names.AttrID: framework.IDAttribute(), + names.AttrARN: framework.ARNAttributeComputedOnly(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + names.AttrID: framework.IDAttribute(), "template_id": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ @@ -73,45 +67,45 @@ func (r *templateAliasResource) Schema(ctx context.Context, req resource.SchemaR } func (r *templateAliasResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan templateAliasResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data templateAliasResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - awsAccountID, templateID, aliasName := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.TemplateID), flex.StringValueFromFramework(ctx, plan.AliasName) + + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, templateID, aliasName := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.TemplateID), fwflex.StringValueFromFramework(ctx, data.AliasName) in := &quicksight.CreateTemplateAliasInput{ AliasName: aws.String(aliasName), AwsAccountId: aws.String(awsAccountID), TemplateId: aws.String(templateID), - TemplateVersionNumber: plan.TemplateVersionNumber.ValueInt64Pointer(), + TemplateVersionNumber: data.TemplateVersionNumber.ValueInt64Pointer(), } out, err := conn.CreateTemplateAlias(ctx, in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameTemplateAlias, plan.AliasName.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameTemplateAlias, data.AliasName.String(), err), err.Error(), ) return } if out == nil || out.TemplateAlias == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameTemplateAlias, plan.AliasName.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameTemplateAlias, data.AliasName.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = types.StringValue(templateAliasCreateResourceID(awsAccountID, templateID, aliasName)) - plan.ARN = flex.StringToFramework(ctx, out.TemplateAlias.Arn) + data.ID = types.StringValue(templateAliasCreateResourceID(awsAccountID, templateID, aliasName)) + data.ARN = fwflex.StringToFramework(ctx, out.TemplateAlias.Arn) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *templateAliasResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -145,11 +139,11 @@ func (r *templateAliasResource) Read(ctx context.Context, req resource.ReadReque return } - state.ARN = flex.StringToFramework(ctx, out.Arn) - state.AliasName = flex.StringToFramework(ctx, out.AliasName) - state.TemplateVersionNumber = flex.Int64ToFramework(ctx, out.TemplateVersionNumber) - state.AWSAccountID = flex.StringValueToFramework(ctx, awsAccountID) - state.TemplateID = flex.StringValueToFramework(ctx, templateID) + state.ARN = fwflex.StringToFramework(ctx, out.Arn) + state.AliasName = fwflex.StringToFramework(ctx, out.AliasName) + state.TemplateVersionNumber = fwflex.Int64ToFramework(ctx, out.TemplateVersionNumber) + state.AWSAccountID = fwflex.StringValueToFramework(ctx, awsAccountID) + state.TemplateID = fwflex.StringValueToFramework(ctx, templateID) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } @@ -197,7 +191,7 @@ func (r *templateAliasResource) Update(ctx context.Context, req resource.UpdateR return } - plan.ARN = flex.StringToFramework(ctx, out.TemplateAlias.Arn) + plan.ARN = fwflex.StringToFramework(ctx, out.TemplateAlias.Arn) } resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) diff --git a/internal/service/quicksight/template_tags_gen_test.go b/internal/service/quicksight/template_tags_gen_test.go index da1886d7abbe..64cf566e6068 100644 --- a/internal/service/quicksight/template_tags_gen_test.go +++ b/internal/service/quicksight/template_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightTemplate_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightTemplate_tags_null(t *testing.T) { t.Skip("Resource Template does not support null tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightTemplate_tags_null(t *testing.T) { func TestAccQuickSightTemplate_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightTemplate_tags_EmptyMap(t *testing.T) { func TestAccQuickSightTemplate_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightTemplate_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Template does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightTemplate_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Template does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightTemplate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Template does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightTemplate_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightTemplate_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightTemplate_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightTemplate_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightTemplate_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccQuickSightTemplate_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource Template does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_emptyProviderOnlyTag(t *testing. t.Skip("Resource Template does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_nullOverlappingResourceTag(t *te t.Skip("Resource Template does not support null tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Template does not support null tags") ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightTemplate_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccQuickSightTemplate_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightTemplate_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightTemplate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightTemplate_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightTemplate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightTemplate_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightTemplate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightTemplate_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccQuickSightTemplate_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Template resourceName := "aws_quicksight_template.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/testdata/CustomPermissions/tags/main_gen.tf b/internal/service/quicksight/testdata/CustomPermissions/tags/main_gen.tf new file mode 100644 index 000000000000..594dc355d23f --- /dev/null +++ b/internal/service/quicksight/testdata/CustomPermissions/tags/main_gen.tf @@ -0,0 +1,25 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } + + tags = var.resource_tags +} +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} diff --git a/internal/service/quicksight/testdata/CustomPermissions/tagsComputed1/main_gen.tf b/internal/service/quicksight/testdata/CustomPermissions/tagsComputed1/main_gen.tf new file mode 100644 index 000000000000..f53246a3e309 --- /dev/null +++ b/internal/service/quicksight/testdata/CustomPermissions/tagsComputed1/main_gen.tf @@ -0,0 +1,29 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + } +} +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} diff --git a/internal/service/quicksight/testdata/CustomPermissions/tagsComputed2/main_gen.tf b/internal/service/quicksight/testdata/CustomPermissions/tagsComputed2/main_gen.tf new file mode 100644 index 000000000000..5e0d566f8895 --- /dev/null +++ b/internal/service/quicksight/testdata/CustomPermissions/tagsComputed2/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "null" {} + +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } + + tags = { + (var.unknownTagKey) = null_resource.test.id + (var.knownTagKey) = var.knownTagValue + } +} +resource "null_resource" "test" {} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "unknownTagKey" { + type = string + nullable = false +} + +variable "knownTagKey" { + type = string + nullable = false +} + +variable "knownTagValue" { + type = string + nullable = false +} diff --git a/internal/service/quicksight/testdata/CustomPermissions/tags_defaults/main_gen.tf b/internal/service/quicksight/testdata/CustomPermissions/tags_defaults/main_gen.tf new file mode 100644 index 000000000000..dcff11bb1132 --- /dev/null +++ b/internal/service/quicksight/testdata/CustomPermissions/tags_defaults/main_gen.tf @@ -0,0 +1,36 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } +} + +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } + + tags = var.resource_tags +} +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = false +} diff --git a/internal/service/quicksight/testdata/CustomPermissions/tags_ignore/main_gen.tf b/internal/service/quicksight/testdata/CustomPermissions/tags_ignore/main_gen.tf new file mode 100644 index 000000000000..b67889b92a79 --- /dev/null +++ b/internal/service/quicksight/testdata/CustomPermissions/tags_ignore/main_gen.tf @@ -0,0 +1,45 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } + ignore_tags { + keys = var.ignore_tag_keys + } +} + +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } + + tags = var.resource_tags +} +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "resource_tags" { + description = "Tags to set on resource. To specify no tags, set to `null`" + # Not setting a default, so that this must explicitly be set to `null` to specify no tags + type = map(string) + nullable = true +} + +variable "provider_tags" { + type = map(string) + nullable = true + default = null +} + +variable "ignore_tag_keys" { + type = set(string) + nullable = false +} diff --git a/internal/service/quicksight/testdata/tmpl/custom_permissions_tags.gtpl b/internal/service/quicksight/testdata/tmpl/custom_permissions_tags.gtpl new file mode 100644 index 000000000000..40d53ea6bcde --- /dev/null +++ b/internal/service/quicksight/testdata/tmpl/custom_permissions_tags.gtpl @@ -0,0 +1,9 @@ +resource "aws_quicksight_custom_permissions" "test" { + custom_permissions_name = var.rName + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } +{{- template "tags" . }} +} \ No newline at end of file diff --git a/internal/service/quicksight/theme.go b/internal/service/quicksight/theme.go index 715666cc215d..01f7161a3f4d 100644 --- a/internal/service/quicksight/theme.go +++ b/internal/service/quicksight/theme.go @@ -26,7 +26,6 @@ import ( tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -57,13 +56,7 @@ func resourceTheme() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), "base_theme_id": { Type: schema.TypeString, Required: true, diff --git a/internal/service/quicksight/theme_data_source.go b/internal/service/quicksight/theme_data_source.go index 57d04160333a..a61c6b478941 100644 --- a/internal/service/quicksight/theme_data_source.go +++ b/internal/service/quicksight/theme_data_source.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -28,12 +27,7 @@ func dataSourceTheme() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: verify.ValidAccountID, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDDataSourceSchema(), "base_theme_id": { Type: schema.TypeString, Computed: true, diff --git a/internal/service/quicksight/theme_tags_gen_test.go b/internal/service/quicksight/theme_tags_gen_test.go index 892d0691465c..11aa3808d96d 100644 --- a/internal/service/quicksight/theme_tags_gen_test.go +++ b/internal/service/quicksight/theme_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightTheme_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightTheme_tags_null(t *testing.T) { t.Skip("Resource Theme does not support null tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -269,6 +271,7 @@ func TestAccQuickSightTheme_tags_null(t *testing.T) { func TestAccQuickSightTheme_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -332,6 +335,7 @@ func TestAccQuickSightTheme_tags_EmptyMap(t *testing.T) { func TestAccQuickSightTheme_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -415,6 +419,7 @@ func TestAccQuickSightTheme_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Theme does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -506,6 +511,7 @@ func TestAccQuickSightTheme_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Theme does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -645,6 +651,7 @@ func TestAccQuickSightTheme_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Theme does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -734,6 +741,7 @@ func TestAccQuickSightTheme_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightTheme_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -915,6 +923,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccQuickSightTheme_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1075,6 +1084,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccQuickSightTheme_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1251,6 +1261,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightTheme_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1341,6 +1352,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccQuickSightTheme_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1432,6 +1444,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource Theme does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1512,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) t.Skip("Resource Theme does not support empty tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_nullOverlappingResourceTag(t *testi t.Skip("Resource Theme does not support null tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1637,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_nullNonOverlappingResourceTag(t *te t.Skip("Resource Theme does not support null tags") ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1684,6 +1700,7 @@ func TestAccQuickSightTheme_tags_DefaultTags_nullNonOverlappingResourceTag(t *te func TestAccQuickSightTheme_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1739,6 +1756,7 @@ func TestAccQuickSightTheme_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightTheme_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1836,6 +1854,7 @@ func TestAccQuickSightTheme_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccQuickSightTheme_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1923,6 +1942,7 @@ func TestAccQuickSightTheme_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccQuickSightTheme_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2085,6 +2105,7 @@ func TestAccQuickSightTheme_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccQuickSightTheme_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Theme resourceName := "aws_quicksight_theme.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/quicksight/user.go b/internal/service/quicksight/user.go index aa1bcdfe6d9f..468a63b97740 100644 --- a/internal/service/quicksight/user.go +++ b/internal/service/quicksight/user.go @@ -9,7 +9,6 @@ import ( "log" "strings" - "github.com/YakDriver/regexache" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/quicksight" awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -21,14 +20,12 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) -const ( - defaultUserNamespace = "default" -) - // @SDKResource("aws_quicksight_user", name="User") func resourceUser() *schema.Resource { return &schema.Resource{ @@ -43,41 +40,24 @@ func resourceUser() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, + names.AttrAWSAccountID: quicksightschema.AWSAccountIDSchema(), names.AttrEmail: { Type: schema.TypeString, Required: true, }, "iam_arn": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: verify.ValidARN, }, "identity_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - // TODO ValidateDiagFunc: enum.Validate[awstypes.IdentityType](), - ValidateFunc: validation.StringInSlice(enum.Slice( - awstypes.IdentityTypeIam, - awstypes.IdentityTypeQuicksight, - ), false), - }, - names.AttrNamespace: { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: defaultUserNamespace, - ValidateFunc: validation.All( - validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods"), - ), + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateDiagFunc: enum.Validate[awstypes.IdentityType](), }, + names.AttrNamespace: quicksightschema.NamespaceSchema(), "session_name": { Type: schema.TypeString, Optional: true, @@ -90,21 +70,14 @@ func resourceUser() *schema.Resource { names.AttrUserName: { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.NoZeroValues, }, "user_role": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - // TODO ValidateDiagFunc: enum.Validate[awstypes.UserRole](), - ValidateFunc: validation.StringInSlice(enum.Slice( - awstypes.UserRoleReader, - awstypes.UserRoleAuthor, - awstypes.UserRoleAdmin, - awstypes.UserRoleReaderPro, - awstypes.UserRoleAuthorPro, - awstypes.UserRoleAdminPro, - ), false), + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateDiagFunc: enum.Validate[awstypes.UserRole](), }, } }, @@ -121,7 +94,7 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, meta any) d } email := d.Get(names.AttrEmail).(string) namespace := d.Get(names.AttrNamespace).(string) - input := &quicksight.RegisterUserInput{ + input := quicksight.RegisterUserInput{ AwsAccountId: aws.String(awsAccountID), Email: aws.String(email), IdentityType: awstypes.IdentityType(d.Get("identity_type").(string)), @@ -141,7 +114,7 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, meta any) d input.UserName = aws.String(v.(string)) } - output, err := conn.RegisterUser(ctx, input) + output, err := conn.RegisterUser(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "registering QuickSight User (%s): %s", email, err) @@ -197,7 +170,7 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta any) d return sdkdiag.AppendFromErr(diags, err) } - input := &quicksight.UpdateUserInput{ + input := quicksight.UpdateUserInput{ AwsAccountId: aws.String(awsAccountID), Email: aws.String(d.Get(names.AttrEmail).(string)), Namespace: aws.String(namespace), @@ -205,7 +178,7 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta any) d UserName: aws.String(userName), } - _, err = conn.UpdateUser(ctx, input) + _, err = conn.UpdateUser(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating QuickSight User (%s): %s", d.Id(), err) @@ -223,11 +196,13 @@ func resourceUserDelete(ctx context.Context, d *schema.ResourceData, meta any) d return sdkdiag.AppendFromErr(diags, err) } - _, err = conn.DeleteUser(ctx, &quicksight.DeleteUserInput{ + log.Printf("[INFO] Deleting QuickSight User: %s", d.Id()) + input := quicksight.DeleteUserInput{ AwsAccountId: aws.String(awsAccountID), Namespace: aws.String(namespace), UserName: aws.String(userName), - }) + } + _, err = conn.DeleteUser(ctx, &input) if errs.IsA[*awstypes.ResourceNotFoundException](err) { return diags @@ -260,13 +235,13 @@ func userParseResourceID(id string) (string, string, string, error) { } func findUserByThreePartKey(ctx context.Context, conn *quicksight.Client, awsAccountID, namespace, userName string) (*awstypes.User, error) { - input := &quicksight.DescribeUserInput{ + input := quicksight.DescribeUserInput{ AwsAccountId: aws.String(awsAccountID), Namespace: aws.String(namespace), UserName: aws.String(userName), } - return findUser(ctx, conn, input) + return findUser(ctx, conn, &input) } func findUser(ctx context.Context, conn *quicksight.Client, input *quicksight.DescribeUserInput) (*awstypes.User, error) { diff --git a/internal/service/quicksight/user_custom_permission.go b/internal/service/quicksight/user_custom_permission.go new file mode 100644 index 000000000000..da5330485a82 --- /dev/null +++ b/internal/service/quicksight/user_custom_permission.go @@ -0,0 +1,212 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/quicksight" + awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource("aws_quicksight_user_custom_permission", name="User Custom Permission") +func newUserCustomPermissionResource(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &userCustomPermissionResource{} + + return r, nil +} + +type userCustomPermissionResource struct { + framework.ResourceWithModel[userCustomPermissionResourceModel] +} + +func (r *userCustomPermissionResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + "custom_permissions_name": schema.StringAttribute{ + Required: true, + }, + names.AttrNamespace: quicksightschema.NamespaceAttribute(), + names.AttrUserName: schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + }, + } +} + +func (r *userCustomPermissionResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data userCustomPermissionResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.UpdateUserCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateUserCustomPermission(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight User (%s) Custom Permission (%s)", data.UserName.ValueString(), data.CustomPermissionsName.ValueString()), err.Error()) + + return + } + + response.Diagnostics.Append(response.State.Set(ctx, data)...) +} + +func (r *userCustomPermissionResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data userCustomPermissionResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + output, err := findUserCustomPermissionByThreePartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.UserName.ValueString()) + + if tfresource.NotFound(err) { + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("creating Quicksight User (%s) Custom Permission", data.UserName.ValueString()), err.Error()) + + return + } + + // Set attributes for import. + data.CustomPermissionsName = fwflex.StringToFramework(ctx, output) + + response.Diagnostics.Append(response.State.Set(ctx, &data)...) +} + +func (r *userCustomPermissionResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old userCustomPermissionResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &new)...) + if response.Diagnostics.HasError() { + return + } + response.Diagnostics.Append(request.State.Get(ctx, &old)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.UpdateUserCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, new, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.UpdateUserCustomPermission(ctx, &input) + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("updating Quicksight User (%s) Custom Permission (%s)", new.UserName.ValueString(), new.CustomPermissionsName.ValueString()), err.Error()) + + return + } + + response.Diagnostics.Append(response.State.Set(ctx, &new)...) +} + +func (r *userCustomPermissionResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data userCustomPermissionResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().QuickSightClient(ctx) + + var input quicksight.DeleteUserCustomPermissionInput + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { + return + } + + _, err := conn.DeleteUserCustomPermission(ctx, &input) + + if errs.IsA[*awstypes.ResourceNotFoundException](err) { + return + } + + if err != nil { + response.Diagnostics.AddError(fmt.Sprintf("deleting Quicksight User (%s) Custom Permission (%s)", data.UserName.ValueString(), data.CustomPermissionsName.ValueString()), err.Error()) + + return + } +} + +func (r *userCustomPermissionResource) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) { + const ( + userCustomPermissionIDParts = 3 + ) + parts, err := intflex.ExpandResourceId(request.ID, userCustomPermissionIDParts, true) + + if err != nil { + response.Diagnostics.Append(fwdiag.NewParsingResourceIDErrorDiagnostic(err)) + + return + } + + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrAWSAccountID), parts[0])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrNamespace), parts[1])...) + response.Diagnostics.Append(response.State.SetAttribute(ctx, path.Root(names.AttrUserName), parts[2])...) +} + +func findUserCustomPermissionByThreePartKey(ctx context.Context, conn *quicksight.Client, awsAccountID, namespace, userName string) (*string, error) { + output, err := findUserByThreePartKey(ctx, conn, awsAccountID, namespace, userName) + + if err != nil { + return nil, err + } + + if aws.ToString(output.CustomPermissionsName) == "" { + return nil, tfresource.NewEmptyResultError(nil) + } + + return output.CustomPermissionsName, nil +} + +type userCustomPermissionResourceModel struct { + framework.WithRegionModel + AWSAccountID types.String `tfsdk:"aws_account_id"` + CustomPermissionsName types.String `tfsdk:"custom_permissions_name"` + Namespace types.String `tfsdk:"namespace"` + UserName types.String `tfsdk:"user_name"` +} diff --git a/internal/service/quicksight/user_custom_permission_test.go b/internal/service/quicksight/user_custom_permission_test.go new file mode 100644 index 000000000000..34eecf69ab68 --- /dev/null +++ b/internal/service/quicksight/user_custom_permission_test.go @@ -0,0 +1,249 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package quicksight_test + +import ( + "context" + "fmt" + "testing" + + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccQuickSightUserCustomPermission_basic(t *testing.T) { + ctx := acctest.Context(t) + rName := "tfacctest" + sdkacctest.RandString(10) + resourceName := "aws_quicksight_user_custom_permission.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckUserCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccUserCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckUserCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName+"-perm")), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrUserName), knownvalue.StringExact(rName)), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccUserCustomPermissionImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + }, + }) +} + +func TestAccQuickSightUserCustomPermission_disappears(t *testing.T) { + ctx := acctest.Context(t) + rName := "tfacctest" + sdkacctest.RandString(10) + resourceName := "aws_quicksight_user_custom_permission.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckUserCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccUserCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckUserCustomPermissionExists(ctx, resourceName), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfquicksight.ResourceUserCustomPermission, resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccQuickSightUserCustomPermission_update(t *testing.T) { + ctx := acctest.Context(t) + rName := "tfacctest" + sdkacctest.RandString(10) + resourceName := "aws_quicksight_user_custom_permission.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.QuickSightServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckUserCustomPermissionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccUserCustomPermissionConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckUserCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName+"-perm")), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrUserName), knownvalue.StringExact(rName)), + }, + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccUserCustomPermissionImportStateID(resourceName), + ImportStateVerifyIdentifierAttribute: "custom_permissions_name", + }, + { + Config: testAccUserCustomPermissionConfig_updated(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckUserCustomPermissionExists(ctx, resourceName), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrAWSAccountID), tfknownvalue.AccountID()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("custom_permissions_name"), knownvalue.StringExact(rName+"-perm2")), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrNamespace), knownvalue.StringExact(tfquicksight.DefaultNamespace)), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrUserName), knownvalue.StringExact(rName)), + }, + }, + }, + }) +} + +func testAccCheckUserCustomPermissionDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_quicksight_user_custom_permission" { + continue + } + + _, err := tfquicksight.FindUserCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrUserName]) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("QuickSight User Custom Permission (%s) still exists", rs.Primary.Attributes[names.AttrUserName]) + } + + return nil + } +} + +func testAccCheckUserCustomPermissionExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).QuickSightClient(ctx) + + _, err := tfquicksight.FindUserCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrUserName]) + + return err + } +} + +func testAccUserCustomPermissionImportStateID(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return acctest.AttrsImportStateIdFunc(n, ",", names.AttrAWSAccountID, names.AttrNamespace, names.AttrUserName)(s) + } +} + +func testAccUserCustomPermissionConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccCustomPermissionsConfig_basic(rName+"-perm"), fmt.Sprintf(` +resource "aws_quicksight_user" "test" { + user_name = %[1]q + email = %[2]q + identity_type = "QUICKSIGHT" + user_role = "READER" +} + +resource "aws_quicksight_user_custom_permission" "test" { + user_name = aws_quicksight_user.test.user_name + custom_permissions_name = aws_quicksight_custom_permissions.test.custom_permissions_name +} +`, rName, acctest.DefaultEmailAddress)) +} + +func testAccUserCustomPermissionConfig_updated(rName string) string { + return acctest.ConfigCompose(testAccCustomPermissionsConfig_basic(rName+"-perm"), fmt.Sprintf(` +resource "aws_quicksight_custom_permissions" "test2" { + custom_permissions_name = "%[1]s-perm2" + + capabilities { + create_and_update_datasets = "DENY" + create_and_update_data_sources = "DENY" + export_to_pdf = "DENY" + } +} + +resource "aws_quicksight_user" "test" { + user_name = %[1]q + email = %[2]q + identity_type = "QUICKSIGHT" + user_role = "READER" +} + +resource "aws_quicksight_user_custom_permission" "test" { + user_name = aws_quicksight_user.test.user_name + custom_permissions_name = aws_quicksight_custom_permissions.test2.custom_permissions_name +} +`, rName, acctest.DefaultEmailAddress)) +} diff --git a/internal/service/quicksight/user_data_source.go b/internal/service/quicksight/user_data_source.go index 773f4a5562f4..3064a696c004 100644 --- a/internal/service/quicksight/user_data_source.go +++ b/internal/service/quicksight/user_data_source.go @@ -6,12 +6,11 @@ package quicksight import ( "context" - "github.com/YakDriver/regexache" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -30,9 +29,9 @@ func dataSourceUser() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrAWSAccountID: { + names.AttrAWSAccountID: quicksightschema.AWSAccountIDDataSourceSchema(), + "custom_permissions_name": { Type: schema.TypeString, - Optional: true, Computed: true, }, names.AttrEmail: { @@ -43,15 +42,7 @@ func dataSourceUser() *schema.Resource { Type: schema.TypeString, Computed: true, }, - names.AttrNamespace: { - Type: schema.TypeString, - Optional: true, - Default: defaultUserNamespace, - ValidateFunc: validation.All( - validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]*$`), "must contain only alphanumeric characters, hyphens, underscores, and periods"), - ), - }, + names.AttrNamespace: quicksightschema.NamespaceDataSourceSchema(), "principal_id": { Type: schema.TypeString, Computed: true, @@ -91,6 +82,7 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) d d.Set("active", user.Active) d.Set(names.AttrARN, user.Arn) d.Set(names.AttrAWSAccountID, awsAccountID) + d.Set("custom_permissions_name", user.CustomPermissionsName) d.Set(names.AttrEmail, user.Email) d.Set("identity_type", user.IdentityType) d.Set("principal_id", user.PrincipalId) diff --git a/internal/service/quicksight/user_data_source_test.go b/internal/service/quicksight/user_data_source_test.go index 9a2ecb1f32ea..b9b5ab00c040 100644 --- a/internal/service/quicksight/user_data_source_test.go +++ b/internal/service/quicksight/user_data_source_test.go @@ -29,12 +29,13 @@ func TestAccQuickSightUserDataSource_basic(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccUserDataSourceConfig(rName), - Check: resource.ComposeTestCheckFunc( + Config: testAccUserDataSourceConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, names.AttrUserName, resourceName, names.AttrUserName), resource.TestCheckResourceAttrPair(dataSourceName, names.AttrARN, resourceName, names.AttrARN), + resource.TestCheckResourceAttr(dataSourceName, "custom_permissions_name", ""), resource.TestCheckResourceAttr(dataSourceName, names.AttrEmail, acctest.DefaultEmailAddress), - resource.TestCheckResourceAttr(dataSourceName, names.AttrNamespace, tfquicksight.DefaultUserNamespace), + resource.TestCheckResourceAttr(dataSourceName, names.AttrNamespace, tfquicksight.DefaultNamespace), resource.TestCheckResourceAttr(dataSourceName, "identity_type", string(awstypes.IdentityTypeQuicksight)), resource.TestCheckResourceAttrSet(dataSourceName, "principal_id"), resource.TestCheckResourceAttr(dataSourceName, "user_role", string(awstypes.UserRoleReader)), @@ -44,7 +45,7 @@ func TestAccQuickSightUserDataSource_basic(t *testing.T) { }) } -func testAccUserDataSourceConfig(rName string) string { +func testAccUserDataSourceConfig_basic(rName string) string { return fmt.Sprintf(` resource "aws_quicksight_user" "test" { user_name = %[1]q diff --git a/internal/service/quicksight/user_test.go b/internal/service/quicksight/user_test.go index 3005af42b657..7438713979ff 100644 --- a/internal/service/quicksight/user_test.go +++ b/internal/service/quicksight/user_test.go @@ -6,7 +6,6 @@ package quicksight_test import ( "context" "fmt" - "os" "testing" awstypes "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -94,12 +93,7 @@ func TestAccQuickSightUser_withInvalidFormattedEmailStillWorks(t *testing.T) { func TestAccQuickSightUser_withNamespace(t *testing.T) { ctx := acctest.Context(t) - key := "QUICKSIGHT_NAMESPACE" - namespace := os.Getenv(key) - if namespace == "" { - t.Skipf("Environment variable %s is not set", key) - } - + namespace := acctest.SkipIfEnvVarNotSet(t, "QUICKSIGHT_NAMESPACE") var user awstypes.User rName := "tfacctest" + sdkacctest.RandString(10) resourceName := "aws_quicksight_user." + rName diff --git a/internal/service/quicksight/vpc_connection.go b/internal/service/quicksight/vpc_connection.go index d540f3ef21f0..c5dab0a81ce0 100644 --- a/internal/service/quicksight/vpc_connection.go +++ b/internal/service/quicksight/vpc_connection.go @@ -28,8 +28,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -63,16 +64,9 @@ const ( func (r *vpcConnectionResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - names.AttrARN: framework.ARNAttributeComputedOnly(), - names.AttrAWSAccountID: schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - names.AttrID: framework.IDAttribute(), + names.AttrARN: framework.ARNAttributeComputedOnly(), + names.AttrAWSAccountID: quicksightschema.AWSAccountIDAttribute(), + names.AttrID: framework.IDAttribute(), "vpc_connection_id": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ @@ -155,37 +149,37 @@ func (r *vpcConnectionResource) Schema(ctx context.Context, req resource.SchemaR } func (r *vpcConnectionResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().QuickSightClient(ctx) - - var plan vpcConnectionResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + var data vpcConnectionResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - - if plan.AWSAccountID.IsUnknown() || plan.AWSAccountID.IsNull() { - plan.AWSAccountID = types.StringValue(r.Meta().AccountID(ctx)) + if data.AWSAccountID.IsUnknown() { + data.AWSAccountID = fwflex.StringValueToFramework(ctx, r.Meta().AccountID(ctx)) } - awsAccountID, vpcConnectionID := flex.StringValueFromFramework(ctx, plan.AWSAccountID), flex.StringValueFromFramework(ctx, plan.VPCConnectionID) + + conn := r.Meta().QuickSightClient(ctx) + + awsAccountID, vpcConnectionID := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.VPCConnectionID) in := &quicksight.CreateVPCConnectionInput{ AwsAccountId: aws.String(awsAccountID), - Name: plan.Name.ValueStringPointer(), - RoleArn: plan.RoleArn.ValueStringPointer(), - SecurityGroupIds: flex.ExpandFrameworkStringValueSet(ctx, plan.SecurityGroupIDs), - SubnetIds: flex.ExpandFrameworkStringValueSet(ctx, plan.SubnetIDs), + Name: data.Name.ValueStringPointer(), + RoleArn: data.RoleArn.ValueStringPointer(), + SecurityGroupIds: fwflex.ExpandFrameworkStringValueSet(ctx, data.SecurityGroupIDs), + SubnetIds: fwflex.ExpandFrameworkStringValueSet(ctx, data.SubnetIDs), Tags: getTagsIn(ctx), VPCConnectionId: aws.String(vpcConnectionID), } - if !plan.DNSResolvers.IsNull() { - in.DnsResolvers = flex.ExpandFrameworkStringValueSet(ctx, plan.DNSResolvers) + if !data.DNSResolvers.IsNull() { + in.DnsResolvers = fwflex.ExpandFrameworkStringValueSet(ctx, data.DNSResolvers) } // account for IAM propagation when attempting to assume role out, err := retryVPCConnectionCreate(ctx, conn, in) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameVPCConnection, plan.Name.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameVPCConnection, data.Name.String(), err), err.Error(), ) return @@ -193,27 +187,27 @@ func (r *vpcConnectionResource) Create(ctx context.Context, req resource.CreateR if out == nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameVPCConnection, plan.Name.String(), nil), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionCreating, resNameVPCConnection, data.Name.String(), nil), errors.New("empty output").Error(), ) return } - plan.ID = flex.StringValueToFramework(ctx, vpcConnectionCreateResourceID(awsAccountID, vpcConnectionID)) + data.ID = fwflex.StringValueToFramework(ctx, vpcConnectionCreateResourceID(awsAccountID, vpcConnectionID)) - waitOut, err := waitVPCConnectionCreated(ctx, conn, awsAccountID, vpcConnectionID, r.CreateTimeout(ctx, plan.Timeouts)) + waitOut, err := waitVPCConnectionCreated(ctx, conn, awsAccountID, vpcConnectionID, r.CreateTimeout(ctx, data.Timeouts)) if err != nil { resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.QuickSight, create.ErrActionWaitingForCreation, resNameVPCConnection, plan.Name.String(), err), + create.ProblemStandardMessage(names.QuickSight, create.ErrActionWaitingForCreation, resNameVPCConnection, data.Name.String(), err), err.Error(), ) return } - plan.ARN = flex.StringToFramework(ctx, waitOut.Arn) - plan.AvailabilityStatus = flex.StringValueToFramework(ctx, waitOut.AvailabilityStatus) + data.ARN = fwflex.StringToFramework(ctx, waitOut.Arn) + data.AvailabilityStatus = fwflex.StringValueToFramework(ctx, waitOut.AvailabilityStatus) - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + resp.Diagnostics.Append(resp.State.Set(ctx, data)...) } func (r *vpcConnectionResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -247,15 +241,15 @@ func (r *vpcConnectionResource) Read(ctx context.Context, req resource.ReadReque return } - state.AWSAccountID = flex.StringValueToFramework(ctx, awsAccountID) - state.VPCConnectionID = flex.StringValueToFramework(ctx, vpcConnectionID) - state.ARN = flex.StringToFramework(ctx, out.Arn) - state.Name = flex.StringToFramework(ctx, out.Name) - state.RoleArn = flex.StringToFramework(ctx, out.RoleArn) - state.SecurityGroupIDs = flex.FlattenFrameworkStringValueSetOfString(ctx, out.SecurityGroupIds) - state.DNSResolvers = flex.FlattenFrameworkStringValueSetOfString(ctx, out.DnsResolvers) - state.AvailabilityStatus = flex.StringValueToFramework(ctx, out.AvailabilityStatus) - state.SubnetIDs = flex.FlattenFrameworkStringValueSetOfString(ctx, tfslices.ApplyToAll(out.NetworkInterfaces, func(v awstypes.NetworkInterface) string { + state.AWSAccountID = fwflex.StringValueToFramework(ctx, awsAccountID) + state.VPCConnectionID = fwflex.StringValueToFramework(ctx, vpcConnectionID) + state.ARN = fwflex.StringToFramework(ctx, out.Arn) + state.Name = fwflex.StringToFramework(ctx, out.Name) + state.RoleArn = fwflex.StringToFramework(ctx, out.RoleArn) + state.SecurityGroupIDs = fwflex.FlattenFrameworkStringValueSetOfString(ctx, out.SecurityGroupIds) + state.DNSResolvers = fwflex.FlattenFrameworkStringValueSetOfString(ctx, out.DnsResolvers) + state.AvailabilityStatus = fwflex.StringValueToFramework(ctx, out.AvailabilityStatus) + state.SubnetIDs = fwflex.FlattenFrameworkStringValueSetOfString(ctx, tfslices.ApplyToAll(out.NetworkInterfaces, func(v awstypes.NetworkInterface) string { return aws.ToString(v.SubnetId) })) @@ -290,13 +284,13 @@ func (r *vpcConnectionResource) Update(ctx context.Context, req resource.UpdateR AwsAccountId: aws.String(awsAccountID), Name: plan.Name.ValueStringPointer(), RoleArn: plan.RoleArn.ValueStringPointer(), - SecurityGroupIds: flex.ExpandFrameworkStringValueSet(ctx, plan.SecurityGroupIDs), - SubnetIds: flex.ExpandFrameworkStringValueSet(ctx, plan.SubnetIDs), + SecurityGroupIds: fwflex.ExpandFrameworkStringValueSet(ctx, plan.SecurityGroupIDs), + SubnetIds: fwflex.ExpandFrameworkStringValueSet(ctx, plan.SubnetIDs), VPCConnectionId: aws.String(vpcConnectionID), } if !plan.DNSResolvers.IsNull() { - in.DnsResolvers = flex.ExpandFrameworkStringValueSet(ctx, plan.DNSResolvers) + in.DnsResolvers = fwflex.ExpandFrameworkStringValueSet(ctx, plan.DNSResolvers) } out, err := conn.UpdateVPCConnection(ctx, &in) diff --git a/internal/service/quicksight/vpc_connection_tags_gen_test.go b/internal/service/quicksight/vpc_connection_tags_gen_test.go index 978d3930a57c..8db5e4f0b754 100644 --- a/internal/service/quicksight/vpc_connection_tags_gen_test.go +++ b/internal/service/quicksight/vpc_connection_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccQuickSightVPCConnection_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -202,6 +203,7 @@ func TestAccQuickSightVPCConnection_tags_null(t *testing.T) { t.Skip("Resource VPCConnection does not support null tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccQuickSightVPCConnection_tags_null(t *testing.T) { func TestAccQuickSightVPCConnection_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -314,6 +317,7 @@ func TestAccQuickSightVPCConnection_tags_EmptyMap(t *testing.T) { func TestAccQuickSightVPCConnection_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -396,6 +400,7 @@ func TestAccQuickSightVPCConnection_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource VPCConnection does not support empty tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -488,6 +493,7 @@ func TestAccQuickSightVPCConnection_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource VPCConnection does not support empty tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -629,6 +635,7 @@ func TestAccQuickSightVPCConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) t.Skip("Resource VPCConnection does not support empty tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -719,6 +726,7 @@ func TestAccQuickSightVPCConnection_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccQuickSightVPCConnection_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -900,6 +908,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_providerOnly(t *testing.T) func TestAccQuickSightVPCConnection_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1060,6 +1069,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccQuickSightVPCConnection_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1236,6 +1246,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_overlapping(t *testing.T) { func TestAccQuickSightVPCConnection_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1326,6 +1337,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_updateToProviderOnly(t *tes func TestAccQuickSightVPCConnection_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1417,6 +1429,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_emptyResourceTag(t *testing t.Skip("Resource VPCConnection does not support empty tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1485,6 +1498,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_emptyProviderOnlyTag(t *tes t.Skip("Resource VPCConnection does not support empty tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1545,6 +1559,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_nullOverlappingResourceTag( t.Skip("Resource VPCConnection does not support null tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1616,6 +1631,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_nullNonOverlappingResourceT t.Skip("Resource VPCConnection does not support null tags") ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1703,7 @@ func TestAccQuickSightVPCConnection_tags_DefaultTags_nullNonOverlappingResourceT func TestAccQuickSightVPCConnection_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1742,6 +1759,7 @@ func TestAccQuickSightVPCConnection_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccQuickSightVPCConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1839,6 +1857,7 @@ func TestAccQuickSightVPCConnection_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccQuickSightVPCConnection_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1926,6 +1945,7 @@ func TestAccQuickSightVPCConnection_tags_ComputedTag_OnUpdate_Replace(t *testing func TestAccQuickSightVPCConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2088,6 +2108,7 @@ func TestAccQuickSightVPCConnection_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccQuickSightVPCConnection_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.VPCConnection resourceName := "aws_quicksight_vpc_connection.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ram/service_endpoint_resolver_gen.go b/internal/service/ram/service_endpoint_resolver_gen.go index 959f8113a33e..56fe3c78e527 100644 --- a/internal/service/ram/service_endpoint_resolver_gen.go +++ b/internal/service/ram/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ram.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ram endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ram endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index e8b3eb7bd383..bd45bfd197b3 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/rbin/service_endpoint_resolver_gen.go b/internal/service/rbin/service_endpoint_resolver_gen.go index 813297889ba5..cf2aee5e7f23 100644 --- a/internal/service/rbin/service_endpoint_resolver_gen.go +++ b/internal/service/rbin/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params rbin.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up rbin endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up rbin endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index 032e7db77dd7..6060e2b61db9 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -604,7 +604,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/rds/certificate_identity_gen_test.go b/internal/service/rds/certificate_identity_gen_test.go index 19e97c9d046d..f7fde18dd51b 100644 --- a/internal/service/rds/certificate_identity_gen_test.go +++ b/internal/service/rds/certificate_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccRDSCertificate_Identity_Basic(t *testing.T) { var v awstypes.Certificate resourceName := "aws_rds_certificate.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func testAccRDSCertificate_Identity_RegionOverride(t *testing.T) { resourceName := "aws_rds_certificate.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -223,7 +223,7 @@ func testAccRDSCertificate_Identity_ExistingResource(t *testing.T) { var v awstypes.Certificate resourceName := "aws_rds_certificate.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index d69681362bd6..36e804df8ba2 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -852,7 +852,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.RestoreDBClusterFromSnapshot(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -1361,7 +1361,7 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta any } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateDBCluster(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") diff --git a/internal/service/rds/cluster_instance.go b/internal/service/rds/cluster_instance.go index 18e2e24db288..1431ea7674af 100644 --- a/internal/service/rds/cluster_instance.go +++ b/internal/service/rds/cluster_instance.go @@ -314,7 +314,7 @@ func resourceClusterInstanceCreate(ctx context.Context, d *schema.ResourceData, } outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateDBInstance(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -508,7 +508,7 @@ func resourceClusterInstanceUpdate(ctx context.Context, d *schema.ResourceData, } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.ModifyDBInstance(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") diff --git a/internal/service/rds/cluster_parameter_group.go b/internal/service/rds/cluster_parameter_group.go index 956c92fe3c17..4c55067d0872 100644 --- a/internal/service/rds/cluster_parameter_group.go +++ b/internal/service/rds/cluster_parameter_group.go @@ -267,7 +267,7 @@ func resourceClusterParameterGroupDelete(ctx context.Context, d *schema.Resource input := rds.DeleteDBClusterParameterGroupInput{ DBClusterParameterGroupName: aws.String(d.Id()), } - _, err := tfresource.RetryWhenIsA[*types.InvalidDBParameterGroupStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidDBParameterGroupStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteDBClusterParameterGroup(ctx, &input) }) diff --git a/internal/service/rds/cluster_role_association.go b/internal/service/rds/cluster_role_association.go index 0189b239c24f..858909645f1b 100644 --- a/internal/service/rds/cluster_role_association.go +++ b/internal/service/rds/cluster_role_association.go @@ -76,12 +76,12 @@ func resourceClusterRoleAssociationCreate(ctx context.Context, d *schema.Resourc RoleArn: aws.String(roleARN), } - _, err := tfresource.RetryWhenIsA[*types.InvalidDBClusterStateFault](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidDBClusterStateFault](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.AddRoleToDBCluster(ctx, &input) }) if tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, errIAMRolePropagationMessage) { - _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.AddRoleToDBCluster(ctx, &input) }, errCodeInvalidParameterValue, errIAMRolePropagationMessage) } @@ -142,7 +142,7 @@ func resourceClusterRoleAssociationDelete(ctx context.Context, d *schema.Resourc FeatureName: aws.String(d.Get("feature_name").(string)), RoleArn: aws.String(roleARN), } - _, err = tfresource.RetryWhenIsA[*types.InvalidDBClusterStateFault](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *types.InvalidDBClusterStateFault](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.RemoveRoleFromDBCluster(ctx, &input) }) diff --git a/internal/service/rds/cluster_snapshot.go b/internal/service/rds/cluster_snapshot.go index 4c9f4eb228e9..c24cd73a6075 100644 --- a/internal/service/rds/cluster_snapshot.go +++ b/internal/service/rds/cluster_snapshot.go @@ -140,7 +140,7 @@ func resourceClusterSnapshotCreate(ctx context.Context, d *schema.ResourceData, const ( timeout = 2 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*types.InvalidDBClusterStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidDBClusterStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateDBClusterSnapshot(ctx, input) }) diff --git a/internal/service/rds/global_cluster_tags_gen_test.go b/internal/service/rds/global_cluster_tags_gen_test.go index a2113d7d02eb..ee74c0519df1 100644 --- a/internal/service/rds/global_cluster_tags_gen_test.go +++ b/internal/service/rds/global_cluster_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccRDSGlobalCluster_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccRDSGlobalCluster_tags(t *testing.T) { func TestAccRDSGlobalCluster_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccRDSGlobalCluster_tags_null(t *testing.T) { func TestAccRDSGlobalCluster_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccRDSGlobalCluster_tags_EmptyMap(t *testing.T) { func TestAccRDSGlobalCluster_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccRDSGlobalCluster_tags_AddOnUpdate(t *testing.T) { func TestAccRDSGlobalCluster_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccRDSGlobalCluster_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccRDSGlobalCluster_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccRDSGlobalCluster_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccRDSGlobalCluster_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccRDSGlobalCluster_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccRDSGlobalCluster_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccRDSGlobalCluster_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccRDSGlobalCluster_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_overlapping(t *testing.T) { func TestAccRDSGlobalCluster_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccRDSGlobalCluster_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccRDSGlobalCluster_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccRDSGlobalCluster_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccRDSGlobalCluster_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccRDSGlobalCluster_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccRDSGlobalCluster_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccRDSGlobalCluster_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccRDSGlobalCluster_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccRDSGlobalCluster_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccRDSGlobalCluster_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccRDSGlobalCluster_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccRDSGlobalCluster_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccRDSGlobalCluster_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccRDSGlobalCluster_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccRDSGlobalCluster_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.GlobalCluster resourceName := "aws_rds_global_cluster.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index e33b92a744f6..dc5347e37a55 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -2430,7 +2430,7 @@ func resourceInstanceImport(_ context.Context, d *schema.ResourceData, meta any) func dbInstanceCreateReadReplica(ctx context.Context, conn *rds.Client, input *rds.CreateDBInstanceReadReplicaInput) (*rds.CreateDBInstanceReadReplicaOutput, error) { outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, - func() (any, error) { + func(ctx context.Context) (any, error) { return conn.CreateDBInstanceReadReplica(ctx, input) }, errCodeInvalidParameterValue, "ENHANCED_MONITORING") diff --git a/internal/service/rds/instance_data_source_tags_gen_test.go b/internal/service/rds/instance_data_source_tags_gen_test.go index 8ad1aef5c04e..cc154b456b85 100644 --- a/internal/service/rds/instance_data_source_tags_gen_test.go +++ b/internal/service/rds/instance_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccRDSDBInstanceDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccRDSDBInstanceDataSource_tags(t *testing.T) { func TestAccRDSDBInstanceDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccRDSDBInstanceDataSource_tags_NullMap(t *testing.T) { func TestAccRDSDBInstanceDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccRDSDBInstanceDataSource_tags_EmptyMap(t *testing.T) { func TestAccRDSDBInstanceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccRDSDBInstanceDataSource_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccRDSDBInstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccRDSDBInstanceDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccRDSDBInstanceDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/rds/instance_role_association.go b/internal/service/rds/instance_role_association.go index 769db0bc1f94..c020d8d993da 100644 --- a/internal/service/rds/instance_role_association.go +++ b/internal/service/rds/instance_role_association.go @@ -82,12 +82,12 @@ func resourceInstanceRoleAssociationCreate(ctx context.Context, d *schema.Resour RoleArn: aws.String(roleARN), } - _, err := tfresource.RetryWhenIsA[*types.InvalidDBInstanceStateFault](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidDBInstanceStateFault](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.AddRoleToDBInstance(ctx, &input) }) if tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, errIAMRolePropagationMessage) { - _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.AddRoleToDBInstance(ctx, &input) }, errCodeInvalidParameterValue, errIAMRolePropagationMessage) } @@ -148,7 +148,7 @@ func resourceInstanceRoleAssociationDelete(ctx context.Context, d *schema.Resour FeatureName: aws.String(d.Get("feature_name").(string)), RoleArn: aws.String(roleARN), } - _, err = tfresource.RetryWhenIsA[*types.InvalidDBInstanceStateFault](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *types.InvalidDBInstanceStateFault](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.RemoveRoleFromDBInstance(ctx, &input) }) diff --git a/internal/service/rds/instance_tags_gen_test.go b/internal/service/rds/instance_tags_gen_test.go index 1d363552f4f0..c4f5e91e9b7e 100644 --- a/internal/service/rds/instance_tags_gen_test.go +++ b/internal/service/rds/instance_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccRDSDBInstance_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccRDSDBInstance_tags(t *testing.T) { func TestAccRDSDBInstance_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccRDSDBInstance_tags_null(t *testing.T) { func TestAccRDSDBInstance_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccRDSDBInstance_tags_EmptyMap(t *testing.T) { func TestAccRDSDBInstance_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccRDSDBInstance_tags_AddOnUpdate(t *testing.T) { func TestAccRDSDBInstance_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccRDSDBInstance_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccRDSDBInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccRDSDBInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccRDSDBInstance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccRDSDBInstance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_overlapping(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccRDSDBInstance_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccRDSDBInstance_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccRDSDBInstance_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccRDSDBInstance_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccRDSDBInstance_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccRDSDBInstance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccRDSDBInstance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccRDSDBInstance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccRDSDBInstance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccRDSDBInstance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccRDSDBInstance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccRDSDBInstance_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DBInstance resourceName := "aws_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/rds/integration.go b/internal/service/rds/integration.go index 76c13ce114a9..f8e779810e6f 100644 --- a/internal/service/rds/integration.go +++ b/internal/service/rds/integration.go @@ -37,6 +37,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/rds/types;awstypes;awstypes.Integration") // @Testing(tagsTest=false) +// @Testing(preIdentityVersion="v5.100.0") func newIntegrationResource(_ context.Context) (resource.ResourceWithConfigure, error) { r := &integrationResource{} diff --git a/internal/service/rds/integration_identity_gen_test.go b/internal/service/rds/integration_identity_gen_test.go index 90bcd2b3b9b3..46abfc8d024f 100644 --- a/internal/service/rds/integration_identity_gen_test.go +++ b/internal/service/rds/integration_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccRDSIntegration_Identity_Basic(t *testing.T) { resourceName := "aws_rds_integration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccRDSIntegration_Identity_RegionOverride(t *testing.T) { resourceName := "aws_rds_integration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccRDSIntegration_Identity_ExistingResource(t *testing.T) { resourceName := "aws_rds_integration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/rds/option_group.go b/internal/service/rds/option_group.go index 754ee6f35e0c..821c3163eb9f 100644 --- a/internal/service/rds/option_group.go +++ b/internal/service/rds/option_group.go @@ -229,7 +229,7 @@ func resourceOptionGroupUpdate(ctx context.Context, d *schema.ResourceData, meta input.OptionsToRemove = optionsToRemove } - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.ModifyOptionGroup(ctx, input) }, errCodeInvalidParameterValue, "IAM role ARN value is invalid or does not include the required permissions") @@ -252,7 +252,7 @@ func resourceOptionGroupDelete(ctx context.Context, d *schema.ResourceData, meta } log.Printf("[DEBUG] Deleting RDS DB Option Group: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*types.InvalidOptionGroupStateFault](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidOptionGroupStateFault](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteOptionGroup(ctx, &rds.DeleteOptionGroupInput{ OptionGroupName: aws.String(d.Id()), }) diff --git a/internal/service/rds/parameter_group.go b/internal/service/rds/parameter_group.go index adc7878d255c..100bd3bae4af 100644 --- a/internal/service/rds/parameter_group.go +++ b/internal/service/rds/parameter_group.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - tfiters "github.com/hashicorp/terraform-provider-aws/internal/iters" + tfiter "github.com/hashicorp/terraform-provider-aws/internal/iter" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -308,7 +308,7 @@ func resourceParameterGroupDelete(ctx context.Context, d *schema.ResourceData, m input := rds.DeleteDBParameterGroupInput{ DBParameterGroupName: aws.String(d.Id()), } - _, err := tfresource.RetryWhenIsA[*types.InvalidDBParameterGroupStateFault](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidDBParameterGroupStateFault](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteDBParameterGroup(ctx, &input) }) @@ -466,5 +466,5 @@ parameterLoop: chunks = append(chunks, slices.Chunk(immediate, maxChunkSize)) chunks = append(chunks, slices.Chunk(pendingReboot, maxChunkSize)) - return tfiters.Concat(chunks...) + return tfiter.Concat(chunks...) } diff --git a/internal/service/rds/service_endpoint_resolver_gen.go b/internal/service/rds/service_endpoint_resolver_gen.go index 486582c554c8..99451257bcad 100644 --- a/internal/service/rds/service_endpoint_resolver_gen.go +++ b/internal/service/rds/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params rds.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up rds endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up rds endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index 9cd63a012820..e6eaf5d924dd 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/redshift/cluster.go b/internal/service/redshift/cluster.go index 9231f874f120..091b59400ab7 100644 --- a/internal/service/redshift/cluster.go +++ b/internal/service/redshift/cluster.go @@ -858,8 +858,8 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta any ClusterIdentifier: aws.String(d.Id()), } - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidClusterStateFault](ctx, clusterInvalidClusterStateFaultTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidClusterStateFault](ctx, clusterInvalidClusterStateFaultTimeout, + func(ctx context.Context) (any, error) { return conn.RebootCluster(ctx, input) }) @@ -954,8 +954,8 @@ func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta any } log.Printf("[DEBUG] Deleting Redshift Cluster: %s", d.Id()) - _, err := tfresource.RetryWhenIsA[*awstypes.InvalidClusterStateFault](ctx, clusterInvalidClusterStateFaultTimeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidClusterStateFault](ctx, clusterInvalidClusterStateFaultTimeout, + func(ctx context.Context) (any, error) { return conn.DeleteCluster(ctx, input) }) diff --git a/internal/service/redshift/service_endpoint_resolver_gen.go b/internal/service/redshift/service_endpoint_resolver_gen.go index e58256a51949..897e9ee5cc44 100644 --- a/internal/service/redshift/service_endpoint_resolver_gen.go +++ b/internal/service/redshift/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params redshift.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up redshift endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up redshift endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index aebf72d90c98..13aeb1d8c9ad 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/redshiftdata/service_endpoint_resolver_gen.go b/internal/service/redshiftdata/service_endpoint_resolver_gen.go index aa9ae936fc35..39c2fda38639 100644 --- a/internal/service/redshiftdata/service_endpoint_resolver_gen.go +++ b/internal/service/redshiftdata/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params redshiftdata.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up redshiftdata endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up redshiftdata endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index a9d436b731b5..c27671c121eb 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -603,7 +603,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/redshiftserverless/service_endpoint_resolver_gen.go b/internal/service/redshiftserverless/service_endpoint_resolver_gen.go index cf7bfb53201d..208813d32a42 100644 --- a/internal/service/redshiftserverless/service_endpoint_resolver_gen.go +++ b/internal/service/redshiftserverless/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params redshiftserverle }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up redshiftserverless endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up redshiftserverless endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 5f40d9b7bb80..8e1186bd137e 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/rekognition/service_endpoint_resolver_gen.go b/internal/service/rekognition/service_endpoint_resolver_gen.go index aaaef06461e4..f63a3d0b9563 100644 --- a/internal/service/rekognition/service_endpoint_resolver_gen.go +++ b/internal/service/rekognition/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params rekognition.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up rekognition endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up rekognition endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index e771e2319732..db55fd4f2e02 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/resiliencehub/resiliency_policy_tags_gen_test.go b/internal/service/resiliencehub/resiliency_policy_tags_gen_test.go index df7c22a3ecab..9e27cbc3559c 100644 --- a/internal/service/resiliencehub/resiliency_policy_tags_gen_test.go +++ b/internal/service/resiliencehub/resiliency_policy_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccResilienceHubResiliencyPolicy_tags(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -208,6 +209,7 @@ func TestAccResilienceHubResiliencyPolicy_tags(t *testing.T) { func TestAccResilienceHubResiliencyPolicy_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_null(t *testing.T) { func TestAccResilienceHubResiliencyPolicy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -324,6 +327,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_EmptyMap(t *testing.T) { func TestAccResilienceHubResiliencyPolicy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_AddOnUpdate(t *testing.T) { func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnUpdate_Add(t *testing. func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_EmptyTag_OnUpdate_Replace(t *test func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -924,6 +932,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_providerOnly(t *testi func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1090,6 +1099,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nonOverlapping(t *tes func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_overlapping(t *testin func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1364,6 +1375,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_updateToProviderOnly( func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1455,6 +1467,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_updateToResourceOnly( func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1536,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_emptyResourceTag(t *t func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1583,6 +1597,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_emptyProviderOnlyTag( func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1669,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nullOverlappingResour func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1743,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_DefaultTags_nullNonOverlappingRes func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1784,6 +1801,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnCreate(t *testing.T func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1883,6 +1901,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnUpdate_Add(t *testi func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1972,6 +1991,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_ComputedTag_OnUpdate_Replace(t *t func TestAccResilienceHubResiliencyPolicy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2134,6 +2154,7 @@ func TestAccResilienceHubResiliencyPolicy_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccResilienceHubResiliencyPolicy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v resiliencehub.DescribeResiliencyPolicyOutput resourceName := "aws_resiliencehub_resiliency_policy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/resiliencehub/service_endpoint_resolver_gen.go b/internal/service/resiliencehub/service_endpoint_resolver_gen.go index 65ff86dc7655..eb6a31e9e5e4 100644 --- a/internal/service/resiliencehub/service_endpoint_resolver_gen.go +++ b/internal/service/resiliencehub/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params resiliencehub.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up resiliencehub endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up resiliencehub endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/resiliencehub/service_endpoints_gen_test.go b/internal/service/resiliencehub/service_endpoints_gen_test.go index 02287ed7a959..727894287629 100644 --- a/internal/service/resiliencehub/service_endpoints_gen_test.go +++ b/internal/service/resiliencehub/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/resourceexplorer2/index.go b/internal/service/resourceexplorer2/index.go index ce1ee29de647..820cbe54d6a0 100644 --- a/internal/service/resourceexplorer2/index.go +++ b/internal/service/resourceexplorer2/index.go @@ -35,6 +35,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(serialize=true) // @Testing(generator=false) +// @Testing(preIdentityVersion="v5.100.0") func newIndexResource(context.Context) (resource.ResourceWithConfigure, error) { r := &indexResource{} diff --git a/internal/service/resourceexplorer2/index_identity_gen_test.go b/internal/service/resourceexplorer2/index_identity_gen_test.go index 793f9c4aaedc..1b3d84484779 100644 --- a/internal/service/resourceexplorer2/index_identity_gen_test.go +++ b/internal/service/resourceexplorer2/index_identity_gen_test.go @@ -32,9 +32,10 @@ func testAccResourceExplorer2Index_IdentitySerial(t *testing.T) { func testAccResourceExplorer2Index_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_resourceexplorer2_index.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -110,7 +111,7 @@ func testAccResourceExplorer2Index_Identity_RegionOverride(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -220,9 +221,10 @@ func testAccResourceExplorer2Index_Identity_RegionOverride(t *testing.T) { func testAccResourceExplorer2Index_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_resourceexplorer2_index.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/resourceexplorer2/service_endpoint_resolver_gen.go b/internal/service/resourceexplorer2/service_endpoint_resolver_gen.go index ef6e34136798..1a217daa9c7e 100644 --- a/internal/service/resourceexplorer2/service_endpoint_resolver_gen.go +++ b/internal/service/resourceexplorer2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params resourceexplorer }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up resourceexplorer2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up resourceexplorer2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index 91ddb46d1b1a..9f6ea618e48e 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/resourceexplorer2/view.go b/internal/service/resourceexplorer2/view.go index bd2a2bd6671f..8c03ea10d217 100644 --- a/internal/service/resourceexplorer2/view.go +++ b/internal/service/resourceexplorer2/view.go @@ -41,6 +41,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/resourceexplorer2;resourceexplorer2.GetViewOutput") // @Testing(serialize=true) +// @Testing(preIdentityVersion="v5.100.0") func newViewResource(context.Context) (resource.ResourceWithConfigure, error) { return &viewResource{}, nil } diff --git a/internal/service/resourceexplorer2/view_identity_gen_test.go b/internal/service/resourceexplorer2/view_identity_gen_test.go index 5be4c313b984..d9ac41340d6c 100644 --- a/internal/service/resourceexplorer2/view_identity_gen_test.go +++ b/internal/service/resourceexplorer2/view_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccResourceExplorer2View_Identity_Basic(t *testing.T) { resourceName := "aws_resourceexplorer2_view.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -124,7 +124,7 @@ func testAccResourceExplorer2View_Identity_RegionOverride(t *testing.T) { resourceName := "aws_resourceexplorer2_view.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -245,7 +245,7 @@ func testAccResourceExplorer2View_Identity_ExistingResource(t *testing.T) { resourceName := "aws_resourceexplorer2_view.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/resourcegroups/service_endpoint_resolver_gen.go b/internal/service/resourcegroups/service_endpoint_resolver_gen.go index f9caa3d54001..072467d822df 100644 --- a/internal/service/resourcegroups/service_endpoint_resolver_gen.go +++ b/internal/service/resourcegroups/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params resourcegroups.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up resourcegroups endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up resourcegroups endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index 7c778f417e8a..cb703d531f36 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/resourcegroupstaggingapi/service_endpoint_resolver_gen.go b/internal/service/resourcegroupstaggingapi/service_endpoint_resolver_gen.go index 9cdfcb5d725f..3a9dcfc902a2 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoint_resolver_gen.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params resourcegroupsta }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up resourcegroupstaggingapi endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up resourcegroupstaggingapi endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 55642655f8c9..1abb942868b9 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/rolesanywhere/service_endpoint_resolver_gen.go b/internal/service/rolesanywhere/service_endpoint_resolver_gen.go index d9a4c06680a6..a1af15e5a5f6 100644 --- a/internal/service/rolesanywhere/service_endpoint_resolver_gen.go +++ b/internal/service/rolesanywhere/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params rolesanywhere.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up rolesanywhere endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up rolesanywhere endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index 8b56319933c9..a3ef2bfe0852 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/route53/cidr_collection.go b/internal/service/route53/cidr_collection.go index 346018b730ef..97dc90b5d00d 100644 --- a/internal/service/route53/cidr_collection.go +++ b/internal/service/route53/cidr_collection.go @@ -83,7 +83,7 @@ func (r *cidrCollectionResource) Create(ctx context.Context, request resource.Cr const ( timeout = 2 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModification](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModification](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateCidrCollection(ctx, input) }) diff --git a/internal/service/route53/hosted_zone_dnssec.go b/internal/service/route53/hosted_zone_dnssec.go index 04260a722d6a..7cdd2ab3c1bf 100644 --- a/internal/service/route53/hosted_zone_dnssec.go +++ b/internal/service/route53/hosted_zone_dnssec.go @@ -178,7 +178,7 @@ func hostedZoneDNSSECDisable(ctx context.Context, conn *route53.Client, hostedZo const ( timeout = 5 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.KeySigningKeyInParentDSRecord](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.KeySigningKeyInParentDSRecord](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DisableHostedZoneDNSSEC(ctx, input) }) diff --git a/internal/service/route53/record.go b/internal/service/route53/record.go index 720fa883f35a..10b95ec0c7fd 100644 --- a/internal/service/route53/record.go +++ b/internal/service/route53/record.go @@ -365,7 +365,7 @@ func resourceRecordCreate(ctx context.Context, d *schema.ResourceData, meta any) HostedZoneId: aws.String(cleanZoneID(aws.ToString(zoneRecord.HostedZone.Id))), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.NoSuchHostedZone](ctx, 1*time.Minute, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.NoSuchHostedZone](ctx, 1*time.Minute, func(ctx context.Context) (any, error) { return conn.ChangeResourceRecordSets(ctx, input) }) diff --git a/internal/service/route53/record_identity_gen_test.go b/internal/service/route53/record_identity_gen_test.go index 3b48d5668a3e..500c6ee31b02 100644 --- a/internal/service/route53/record_identity_gen_test.go +++ b/internal/service/route53/record_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccRoute53Record_Identity_Basic(t *testing.T) { zoneName := acctest.RandomDomain() recordName := zoneName.RandomSubdomain() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -125,7 +125,7 @@ func TestAccRoute53Record_Identity_ExistingResource(t *testing.T) { zoneName := acctest.RandomDomain() recordName := zoneName.RandomSubdomain() - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/route53/service_endpoint_resolver_gen.go b/internal/service/route53/service_endpoint_resolver_gen.go index b0f533b789df..769b9f127c51 100644 --- a/internal/service/route53/service_endpoint_resolver_gen.go +++ b/internal/service/route53/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index fc5cbaf4589e..183aba217aea 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/route53/traffic_policy.go b/internal/service/route53/traffic_policy.go index 02510340155d..73e79ef3f250 100644 --- a/internal/service/route53/traffic_policy.go +++ b/internal/service/route53/traffic_policy.go @@ -102,7 +102,7 @@ func resourceTrafficPolicyCreate(ctx context.Context, d *schema.ResourceData, me input.Comment = aws.String(v.(string)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.NoSuchTrafficPolicy](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.NoSuchTrafficPolicy](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateTrafficPolicy(ctx, input) }) diff --git a/internal/service/route53/traffic_policy_instance.go b/internal/service/route53/traffic_policy_instance.go index beae6f62bbfa..6763bd241b11 100644 --- a/internal/service/route53/traffic_policy_instance.go +++ b/internal/service/route53/traffic_policy_instance.go @@ -89,7 +89,7 @@ func resourceTrafficPolicyInstanceCreate(ctx context.Context, d *schema.Resource TTL: aws.Int64(int64(d.Get("ttl").(int))), } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.NoSuchTrafficPolicy](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.NoSuchTrafficPolicy](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateTrafficPolicyInstance(ctx, input) }) diff --git a/internal/service/route53/vpc_association_authorization.go b/internal/service/route53/vpc_association_authorization.go index 592b17a2492c..bdede6a17020 100644 --- a/internal/service/route53/vpc_association_authorization.go +++ b/internal/service/route53/vpc_association_authorization.go @@ -80,7 +80,7 @@ func resourceVPCAssociationAuthorizationCreate(ctx context.Context, d *schema.Re input.VPC.VPCRegion = awstypes.VPCRegion(v.(string)) } - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ConcurrentModification](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModification](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateVPCAssociationAuthorization(ctx, input) }) @@ -106,7 +106,7 @@ func resourceVPCAssociationAuthorizationRead(ctx context.Context, d *schema.Reso // InvalidPaginationToken errors can manifest when many authorization resources are // managed concurrently. Retry these errors for a short duration. - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.InvalidPaginationToken](ctx, d.Timeout(schema.TimeoutRead), func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.InvalidPaginationToken](ctx, d.Timeout(schema.TimeoutRead), func(ctx context.Context) (any, error) { return findVPCAssociationAuthorizationByTwoPartKey(ctx, conn, zoneID, vpcID) }) @@ -138,7 +138,7 @@ func resourceVPCAssociationAuthorizationDelete(ctx context.Context, d *schema.Re } log.Printf("[INFO] Deleting Route53 VPC Association Authorization: %s", d.Id()) - _, err = tfresource.RetryWhenIsA[*awstypes.ConcurrentModification](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err = tfresource.RetryWhenIsA[any, *awstypes.ConcurrentModification](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.DeleteVPCAssociationAuthorization(ctx, &route53.DeleteVPCAssociationAuthorizationInput{ HostedZoneId: aws.String(zoneID), VPC: &awstypes.VPC{ diff --git a/internal/service/route53domains/service_endpoint_resolver_gen.go b/internal/service/route53domains/service_endpoint_resolver_gen.go index ab8175410911..ae435ddaf9e4 100644 --- a/internal/service/route53domains/service_endpoint_resolver_gen.go +++ b/internal/service/route53domains/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53domains.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53domains endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53domains endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index 252cb7d94189..bd00d191ff12 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/route53profiles/service_endpoint_resolver_gen.go b/internal/service/route53profiles/service_endpoint_resolver_gen.go index 47b741a48264..760bbe696fed 100644 --- a/internal/service/route53profiles/service_endpoint_resolver_gen.go +++ b/internal/service/route53profiles/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53profiles. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53profiles endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53profiles endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53recoverycontrolconfig/service_endpoint_resolver_gen.go b/internal/service/route53recoverycontrolconfig/service_endpoint_resolver_gen.go index e2ba03523c01..0be4875ac319 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoint_resolver_gen.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53recoveryc }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53recoverycontrolconfig endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53recoverycontrolconfig endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index e612ca2b8535..b6c25ffc7307 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/route53recoveryreadiness/service_endpoint_resolver_gen.go b/internal/service/route53recoveryreadiness/service_endpoint_resolver_gen.go index 81057239e997..2e7bfb205352 100644 --- a/internal/service/route53recoveryreadiness/service_endpoint_resolver_gen.go +++ b/internal/service/route53recoveryreadiness/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53recoveryr }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53recoveryreadiness endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53recoveryreadiness endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index a6b2bb817ecf..7736ce3cf01f 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/route53resolver/endpoint_test.go b/internal/service/route53resolver/endpoint_test.go index fdbdd9a051b5..3222b19a4049 100644 --- a/internal/service/route53resolver/endpoint_test.go +++ b/internal/service/route53resolver/endpoint_test.go @@ -203,6 +203,37 @@ func TestAccRoute53ResolverEndpoint_updateOutbound(t *testing.T) { }) } +func TestAccRoute53ResolverEndpoint_directionInboundDelegation(t *testing.T) { + ctx := acctest.Context(t) + var ep awstypes.ResolverEndpoint + resourceName := "aws_route53_resolver_endpoint.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.Route53ResolverServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckEndpointDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccEndpointConfig_directionInboundDelegation(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckEndpointExists(ctx, resourceName, &ep), + resource.TestCheckResourceAttr(resourceName, "direction", "INBOUND_DELEGATION"), + resource.TestCheckResourceAttr(resourceName, "ip_address.#", "3"), + resource.TestCheckResourceAttr(resourceName, "resolver_endpoint_type", "IPV4"), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccRoute53ResolverEndpoint_resolverEndpointType(t *testing.T) { ctx := acctest.Context(t) var ep awstypes.ResolverEndpoint @@ -533,6 +564,31 @@ resource "aws_route53_resolver_endpoint" "test" { `, name)) } +func testAccEndpointConfig_directionInboundDelegation(rName string) string { + return acctest.ConfigCompose(testAccEndpointConfig_base(rName), fmt.Sprintf(` +resource "aws_route53_resolver_endpoint" "test" { + direction = "INBOUND_DELEGATION" + name = %[1]q + + resolver_endpoint_type = "IPV4" + + security_group_ids = aws_security_group.test[*].id + + ip_address { + subnet_id = aws_subnet.test[0].id + } + + ip_address { + subnet_id = aws_subnet.test[1].id + } + + ip_address { + subnet_id = aws_subnet.test[2].id + } +} +`, rName)) +} + func testAccEndpointConfig_resolverEndpointType(rName, resolverEndpointType string) string { return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` resource "aws_vpc" "test" { diff --git a/internal/service/route53resolver/service_endpoint_resolver_gen.go b/internal/service/route53resolver/service_endpoint_resolver_gen.go index 7164590704ac..9f6ffdc09394 100644 --- a/internal/service/route53resolver/service_endpoint_resolver_gen.go +++ b/internal/service/route53resolver/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params route53resolver. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up route53resolver endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up route53resolver endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index 26d4771475cd..6db715396314 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/rum/service_endpoint_resolver_gen.go b/internal/service/rum/service_endpoint_resolver_gen.go index 6c385f7c4a3a..791f1501d1c7 100644 --- a/internal/service/rum/service_endpoint_resolver_gen.go +++ b/internal/service/rum/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params rum.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up rum endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up rum endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index 33885afc50e0..11b99f63f9bc 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/s3/bucket.go b/internal/service/s3/bucket.go index 32e86d1a3da8..05351829e78c 100644 --- a/internal/service/s3/bucket.go +++ b/internal/service/s3/bucket.go @@ -768,7 +768,7 @@ func resourceBucketCreate(ctx context.Context, d *schema.ResourceData, meta any) input.ObjectLockEnabledForBucket = aws.Bool(true) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateBucket(ctx, input) }, errCodeOperationAborted) @@ -1173,7 +1173,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) } if policy == "" { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketPolicy(ctx, &s3.DeleteBucketPolicyInput{ Bucket: aws.String(d.Id()), }) @@ -1188,7 +1188,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) Policy: aws.String(policy), } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketPolicy(ctx, input) }, errCodeMalformedPolicy, errCodeNoSuchBucket) @@ -1203,7 +1203,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) // if d.HasChange("cors_rule") { if v, ok := d.GetOk("cors_rule"); !ok || len(v.([]any)) == 0 { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketCors(ctx, &s3.DeleteBucketCorsInput{ Bucket: aws.String(d.Id()), }) @@ -1220,7 +1220,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) }, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketCors(ctx, input) }, errCodeNoSuchBucket) @@ -1235,7 +1235,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) // if d.HasChange("website") { if v, ok := d.GetOk("website"); !ok || len(v.([]any)) == 0 || v.([]any)[0] == nil { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketWebsite(ctx, &s3.DeleteBucketWebsiteInput{ Bucket: aws.String(d.Id()), }) @@ -1255,7 +1255,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) WebsiteConfiguration: websiteConfig, } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketWebsite(ctx, input) }, errCodeNoSuchBucket) @@ -1284,7 +1284,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) VersioningConfiguration: versioningConfig, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketVersioning(ctx, input) }, errCodeNoSuchBucket) @@ -1308,7 +1308,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) Bucket: aws.String(d.Id()), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketAcl(ctx, input) }, errCodeNoSuchBucket) @@ -1334,7 +1334,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) Bucket: aws.String(d.Id()), } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketAcl(ctx, input) }, errCodeNoSuchBucket) @@ -1366,7 +1366,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) } } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketLogging(ctx, input) }, errCodeNoSuchBucket) @@ -1380,7 +1380,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) // if d.HasChange("lifecycle_rule") { if v, ok := d.GetOk("lifecycle_rule"); !ok || len(v.([]any)) == 0 { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketLifecycle(ctx, &s3.DeleteBucketLifecycleInput{ Bucket: aws.String(d.Id()), }) @@ -1397,7 +1397,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) }, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketLifecycleConfiguration(ctx, input) }, errCodeNoSuchBucket) @@ -1418,7 +1418,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) Bucket: aws.String(d.Id()), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketAccelerateConfiguration(ctx, input) }, errCodeNoSuchBucket) @@ -1438,7 +1438,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) }, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketRequestPayment(ctx, input) }, errCodeNoSuchBucket) @@ -1452,7 +1452,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) // if d.HasChange("replication_configuration") { if v, ok := d.GetOk("replication_configuration"); !ok || len(v.([]any)) == 0 || v.([]any)[0] == nil { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketReplication(ctx, &s3.DeleteBucketReplicationInput{ Bucket: aws.String(d.Id()), }) @@ -1506,7 +1506,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) // if d.HasChange("server_side_encryption_configuration") { if v, ok := d.GetOk("server_side_encryption_configuration"); !ok || len(v.([]any)) == 0 { - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.DeleteBucketEncryption(ctx, &s3.DeleteBucketEncryptionInput{ Bucket: aws.String(d.Id()), }) @@ -1523,7 +1523,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) }, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutBucketEncryption(ctx, input) }, errCodeNoSuchBucket, errCodeOperationAborted) @@ -1543,7 +1543,7 @@ func resourceBucketUpdate(ctx context.Context, d *schema.ResourceData, meta any) ObjectLockConfiguration: expandBucketObjectLockConfiguration(d.Get("object_lock_configuration").([]any)), } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutUpdate), func(ctx context.Context) (any, error) { return conn.PutObjectLockConfiguration(ctx, input) }, errCodeNoSuchBucket) @@ -1660,7 +1660,7 @@ func findBucketRegion(ctx context.Context, c *conns.AWSClient, bucket string, op } func retryWhenNoSuchBucketError[T any](ctx context.Context, timeout time.Duration, f func() (T, error)) (T, error) { - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return f() }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_accelerate_configuration.go b/internal/service/s3/bucket_accelerate_configuration.go index 9b659f247946..ee3af7e50af2 100644 --- a/internal/service/s3/bucket_accelerate_configuration.go +++ b/internal/service/s3/bucket_accelerate_configuration.go @@ -76,7 +76,7 @@ func resourceBucketAccelerateConfigurationCreate(ctx context.Context, d *schema. input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketAccelerateConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_acl.go b/internal/service/s3/bucket_acl.go index 8c4a5159516d..553a44d6df12 100644 --- a/internal/service/s3/bucket_acl.go +++ b/internal/service/s3/bucket_acl.go @@ -172,7 +172,7 @@ func resourceBucketACLCreate(ctx context.Context, d *schema.ResourceData, meta a input.AccessControlPolicy = expandAccessControlPolicy(v.([]any)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketAcl(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_analytics_configuration.go b/internal/service/s3/bucket_analytics_configuration.go index 567fef0e6e6c..953e8001d8e4 100644 --- a/internal/service/s3/bucket_analytics_configuration.go +++ b/internal/service/s3/bucket_analytics_configuration.go @@ -158,7 +158,7 @@ func resourceBucketAnalyticsConfigurationPut(ctx context.Context, d *schema.Reso AnalyticsConfiguration: analyticsConfiguration, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketAnalyticsConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_cors_configuration.go b/internal/service/s3/bucket_cors_configuration.go index 527be24a1544..3dad9dfce247 100644 --- a/internal/service/s3/bucket_cors_configuration.go +++ b/internal/service/s3/bucket_cors_configuration.go @@ -109,7 +109,7 @@ func resourceBucketCorsConfigurationCreate(ctx context.Context, d *schema.Resour input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketCors(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_identity_gen_test.go b/internal/service/s3/bucket_identity_gen_test.go index d5fabea5a0aa..2fd91ed63401 100644 --- a/internal/service/s3/bucket_identity_gen_test.go +++ b/internal/service/s3/bucket_identity_gen_test.go @@ -22,10 +22,11 @@ import ( func TestAccS3Bucket_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +113,7 @@ func TestAccS3Bucket_Identity_RegionOverride(t *testing.T) { resourceName := "aws_s3_bucket.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -196,10 +197,11 @@ func TestAccS3Bucket_Identity_RegionOverride(t *testing.T) { func TestAccS3Bucket_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/s3/bucket_intelligent_tiering_configuration.go b/internal/service/s3/bucket_intelligent_tiering_configuration.go index 2628534e2742..9690b4f7e614 100644 --- a/internal/service/s3/bucket_intelligent_tiering_configuration.go +++ b/internal/service/s3/bucket_intelligent_tiering_configuration.go @@ -123,7 +123,7 @@ func resourceBucketIntelligentTieringConfigurationPut(ctx context.Context, d *sc IntelligentTieringConfiguration: intelligentTieringConfiguration, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketIntelligentTieringConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_inventory.go b/internal/service/s3/bucket_inventory.go index 9b9fbe2a525f..0af863452d97 100644 --- a/internal/service/s3/bucket_inventory.go +++ b/internal/service/s3/bucket_inventory.go @@ -219,7 +219,7 @@ func resourceBucketInventoryPut(ctx context.Context, d *schema.ResourceData, met InventoryConfiguration: inventoryConfiguration, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketInventoryConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_lifecycle_configuration.go b/internal/service/s3/bucket_lifecycle_configuration.go index 0f3397fe71cd..3bb4bdc8a09d 100644 --- a/internal/service/s3/bucket_lifecycle_configuration.go +++ b/internal/service/s3/bucket_lifecycle_configuration.go @@ -423,7 +423,7 @@ func (r *bucketLifecycleConfigurationResource) Create(ctx context.Context, reque input.LifecycleConfiguration = &lifecycleConfiguraton - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketLifecycleConfiguration(ctx, &input) }, errCodeNoSuchBucket) if tfawserr.ErrMessageContains(err, errCodeInvalidArgument, "LifecycleConfiguration is not valid, expected CreateBucketConfiguration") { @@ -542,7 +542,7 @@ func (r *bucketLifecycleConfigurationResource) Update(ctx context.Context, reque input.LifecycleConfiguration = &lifecycleConfiguraton - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketLifecycleConfiguration(ctx, &input) }, errCodeNoSuchBucket) if err != nil { diff --git a/internal/service/s3/bucket_logging.go b/internal/service/s3/bucket_logging.go index 45c4751505fa..ce6ea789b611 100644 --- a/internal/service/s3/bucket_logging.go +++ b/internal/service/s3/bucket_logging.go @@ -166,7 +166,7 @@ func resourceBucketLoggingCreate(ctx context.Context, d *schema.ResourceData, me input.BucketLoggingStatus.LoggingEnabled.TargetObjectKeyFormat = expandTargetObjectKeyFormat(v.([]any)[0].(map[string]any)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketLogging(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_metric.go b/internal/service/s3/bucket_metric.go index 4a0f08e5a3a1..35ae683ae752 100644 --- a/internal/service/s3/bucket_metric.go +++ b/internal/service/s3/bucket_metric.go @@ -104,7 +104,7 @@ func resourceBucketMetricPut(ctx context.Context, d *schema.ResourceData, meta a MetricsConfiguration: metricsConfiguration, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketMetricsConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_notification.go b/internal/service/s3/bucket_notification.go index 8b8472252967..83cf5d373865 100644 --- a/internal/service/s3/bucket_notification.go +++ b/internal/service/s3/bucket_notification.go @@ -309,7 +309,7 @@ func resourceBucketNotificationPut(ctx context.Context, d *schema.ResourceData, NotificationConfiguration: notificationConfiguration, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketNotificationConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_object_data_source_tags_gen_test.go b/internal/service/s3/bucket_object_data_source_tags_gen_test.go index 61fd79fdf916..04b8b3bada42 100644 --- a/internal/service/s3/bucket_object_data_source_tags_gen_test.go +++ b/internal/service/s3/bucket_object_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccS3BucketObjectDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccS3BucketObjectDataSource_tags(t *testing.T) { func TestAccS3BucketObjectDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccS3BucketObjectDataSource_tags_NullMap(t *testing.T) { func TestAccS3BucketObjectDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccS3BucketObjectDataSource_tags_EmptyMap(t *testing.T) { func TestAccS3BucketObjectDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccS3BucketObjectDataSource_tags_DefaultTags_nonOverlapping(t *testing. func TestAccS3BucketObjectDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccS3BucketObjectDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testi func TestAccS3BucketObjectDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/bucket_object_identity_gen_test.go b/internal/service/s3/bucket_object_identity_gen_test.go index 47f05e22799a..36933eb03f20 100644 --- a/internal/service/s3/bucket_object_identity_gen_test.go +++ b/internal/service/s3/bucket_object_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccS3BucketObject_Identity_Basic(t *testing.T) { resourceName := "aws_s3_bucket_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -123,7 +123,7 @@ func TestAccS3BucketObject_Identity_RegionOverride(t *testing.T) { resourceName := "aws_s3_bucket_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -224,7 +224,7 @@ func TestAccS3BucketObject_Identity_ExistingResource(t *testing.T) { resourceName := "aws_s3_bucket_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/s3/bucket_object_lock_configuration.go b/internal/service/s3/bucket_object_lock_configuration.go index f98fa19e2c83..fc0e86e16d07 100644 --- a/internal/service/s3/bucket_object_lock_configuration.go +++ b/internal/service/s3/bucket_object_lock_configuration.go @@ -128,7 +128,7 @@ func resourceBucketObjectLockConfigurationCreate(ctx context.Context, d *schema. input.Token = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutObjectLockConfiguration(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_object_tags_gen_test.go b/internal/service/s3/bucket_object_tags_gen_test.go index ddcd724e8533..cd71f1404235 100644 --- a/internal/service/s3/bucket_object_tags_gen_test.go +++ b/internal/service/s3/bucket_object_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccS3BucketObject_tags(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccS3BucketObject_tags(t *testing.T) { func TestAccS3BucketObject_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccS3BucketObject_tags_null(t *testing.T) { func TestAccS3BucketObject_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccS3BucketObject_tags_EmptyMap(t *testing.T) { func TestAccS3BucketObject_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccS3BucketObject_tags_AddOnUpdate(t *testing.T) { func TestAccS3BucketObject_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccS3BucketObject_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccS3BucketObject_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccS3BucketObject_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccS3BucketObject_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccS3BucketObject_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccS3BucketObject_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccS3BucketObject_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccS3BucketObject_tags_DefaultTags_overlapping(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccS3BucketObject_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccS3BucketObject_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccS3BucketObject_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccS3BucketObject_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccS3BucketObject_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccS3BucketObject_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccS3BucketObject_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccS3BucketObject_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccS3BucketObject_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccS3BucketObject_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccS3BucketObject_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccS3BucketObject_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccS3BucketObject_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccS3BucketObject_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccS3BucketObject_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccS3BucketObject_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccS3BucketObject_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_bucket_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/bucket_ownership_controls.go b/internal/service/s3/bucket_ownership_controls.go index 3bbd5944662b..ff974a9d9b18 100644 --- a/internal/service/s3/bucket_ownership_controls.go +++ b/internal/service/s3/bucket_ownership_controls.go @@ -163,7 +163,7 @@ func resourceBucketOwnershipControlsDelete(ctx context.Context, d *schema.Resour } log.Printf("[DEBUG] Deleting S3 Bucket Ownership Controls: %s", d.Id()) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func(ctx context.Context) (any, error) { return conn.DeleteBucketOwnershipControls(ctx, &s3.DeleteBucketOwnershipControlsInput{ Bucket: aws.String(bucket), }) diff --git a/internal/service/s3/bucket_policy.go b/internal/service/s3/bucket_policy.go index 5de1d5707035..712aecff1d27 100644 --- a/internal/service/s3/bucket_policy.go +++ b/internal/service/s3/bucket_policy.go @@ -63,7 +63,7 @@ func resourceBucketPolicyPut(ctx context.Context, d *schema.ResourceData, meta a Policy: aws.String(policy), } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketPolicy(ctx, input) }, errCodeMalformedPolicy, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_public_access_block.go b/internal/service/s3/bucket_public_access_block.go index 4beac69adf48..72963ae0252e 100644 --- a/internal/service/s3/bucket_public_access_block.go +++ b/internal/service/s3/bucket_public_access_block.go @@ -84,7 +84,7 @@ func resourceBucketPublicAccessBlockCreate(ctx context.Context, d *schema.Resour }, } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutPublicAccessBlock(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_request_payment_configuration.go b/internal/service/s3/bucket_request_payment_configuration.go index a0c2c8287914..dfbd7a572d4a 100644 --- a/internal/service/s3/bucket_request_payment_configuration.go +++ b/internal/service/s3/bucket_request_payment_configuration.go @@ -76,7 +76,7 @@ func resourceBucketRequestPaymentConfigurationCreate(ctx context.Context, d *sch input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketRequestPayment(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_server_side_encryption_configuration.go b/internal/service/s3/bucket_server_side_encryption_configuration.go index 00e58ecb44d4..5ed5b471f0c2 100644 --- a/internal/service/s3/bucket_server_side_encryption_configuration.go +++ b/internal/service/s3/bucket_server_side_encryption_configuration.go @@ -101,7 +101,7 @@ func resourceBucketServerSideEncryptionConfigurationCreate(ctx context.Context, input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketEncryption(ctx, input) }, errCodeNoSuchBucket, errCodeOperationAborted) @@ -179,7 +179,7 @@ func resourceBucketServerSideEncryptionConfigurationUpdate(ctx context.Context, input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketEncryption(ctx, input) }, errCodeNoSuchBucket, errCodeOperationAborted) diff --git a/internal/service/s3/bucket_tags_gen_test.go b/internal/service/s3/bucket_tags_gen_test.go index 0b98b8606bb7..6ec02a57caa4 100644 --- a/internal/service/s3/bucket_tags_gen_test.go +++ b/internal/service/s3/bucket_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccS3Bucket_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccS3Bucket_tags(t *testing.T) { func TestAccS3Bucket_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccS3Bucket_tags_null(t *testing.T) { func TestAccS3Bucket_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccS3Bucket_tags_EmptyMap(t *testing.T) { func TestAccS3Bucket_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccS3Bucket_tags_AddOnUpdate(t *testing.T) { func TestAccS3Bucket_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccS3Bucket_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccS3Bucket_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccS3Bucket_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccS3Bucket_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccS3Bucket_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccS3Bucket_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccS3Bucket_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccS3Bucket_tags_DefaultTags_overlapping(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccS3Bucket_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccS3Bucket_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccS3Bucket_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccS3Bucket_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccS3Bucket_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccS3Bucket_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccS3Bucket_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T func TestAccS3Bucket_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccS3Bucket_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccS3Bucket_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccS3Bucket_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccS3Bucket_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccS3Bucket_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccS3Bucket_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccS3Bucket_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccS3Bucket_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/bucket_versioning.go b/internal/service/s3/bucket_versioning.go index dd7ddc45904e..132fc6002a8d 100644 --- a/internal/service/s3/bucket_versioning.go +++ b/internal/service/s3/bucket_versioning.go @@ -129,7 +129,7 @@ func resourceBucketVersioningCreate(ctx context.Context, d *schema.ResourceData, input.MFA = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketVersioning(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/bucket_website_configuration.go b/internal/service/s3/bucket_website_configuration.go index 32a61dd01299..52b9a81a3168 100644 --- a/internal/service/s3/bucket_website_configuration.go +++ b/internal/service/s3/bucket_website_configuration.go @@ -223,7 +223,7 @@ func resourceBucketWebsiteConfigurationCreate(ctx context.Context, d *schema.Res input.ExpectedBucketOwner = aws.String(expectedBucketOwner) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketPropagationTimeout, func(ctx context.Context) (any, error) { return conn.PutBucketWebsite(ctx, input) }, errCodeNoSuchBucket) diff --git a/internal/service/s3/directory_bucket_tags_gen_test.go b/internal/service/s3/directory_bucket_tags_gen_test.go index 56bfc23824a2..0d64ab62b4e5 100644 --- a/internal/service/s3/directory_bucket_tags_gen_test.go +++ b/internal/service/s3/directory_bucket_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccS3DirectoryBucket_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -210,6 +211,7 @@ func TestAccS3DirectoryBucket_tags(t *testing.T) { func TestAccS3DirectoryBucket_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccS3DirectoryBucket_tags_null(t *testing.T) { func TestAccS3DirectoryBucket_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -322,6 +325,7 @@ func TestAccS3DirectoryBucket_tags_EmptyMap(t *testing.T) { func TestAccS3DirectoryBucket_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -404,6 +408,7 @@ func TestAccS3DirectoryBucket_tags_AddOnUpdate(t *testing.T) { func TestAccS3DirectoryBucket_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -499,6 +504,7 @@ func TestAccS3DirectoryBucket_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccS3DirectoryBucket_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccS3DirectoryBucket_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccS3DirectoryBucket_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccS3DirectoryBucket_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccS3DirectoryBucket_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -927,6 +935,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccS3DirectoryBucket_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1095,6 +1104,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3DirectoryBucket_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1279,6 +1289,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_overlapping(t *testing.T) { func TestAccS3DirectoryBucket_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1371,6 +1382,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_updateToProviderOnly(t *testing.T func TestAccS3DirectoryBucket_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1462,6 +1474,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_updateToResourceOnly(t *testing.T func TestAccS3DirectoryBucket_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1530,6 +1543,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccS3DirectoryBucket_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1604,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T func TestAccS3DirectoryBucket_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1659,6 +1674,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_nullOverlappingResourceTag(t *tes func TestAccS3DirectoryBucket_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1730,6 +1746,7 @@ func TestAccS3DirectoryBucket_tags_DefaultTags_nullNonOverlappingResourceTag(t * func TestAccS3DirectoryBucket_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1787,6 +1804,7 @@ func TestAccS3DirectoryBucket_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccS3DirectoryBucket_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1886,6 +1904,7 @@ func TestAccS3DirectoryBucket_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccS3DirectoryBucket_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1975,6 +1994,7 @@ func TestAccS3DirectoryBucket_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccS3DirectoryBucket_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2136,6 +2156,7 @@ func TestAccS3DirectoryBucket_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccS3DirectoryBucket_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_directory_bucket.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/object_copy_tags_gen_test.go b/internal/service/s3/object_copy_tags_gen_test.go index ebdbb3771ef1..29a621255fc8 100644 --- a/internal/service/s3/object_copy_tags_gen_test.go +++ b/internal/service/s3/object_copy_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccS3ObjectCopy_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -154,6 +155,7 @@ func TestAccS3ObjectCopy_tags(t *testing.T) { func TestAccS3ObjectCopy_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -209,6 +211,7 @@ func TestAccS3ObjectCopy_tags_null(t *testing.T) { func TestAccS3ObjectCopy_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +265,7 @@ func TestAccS3ObjectCopy_tags_EmptyMap(t *testing.T) { func TestAccS3ObjectCopy_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +334,7 @@ func TestAccS3ObjectCopy_tags_AddOnUpdate(t *testing.T) { func TestAccS3ObjectCopy_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -397,6 +402,7 @@ func TestAccS3ObjectCopy_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -509,6 +515,7 @@ func TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -585,6 +592,7 @@ func TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -714,6 +722,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -831,6 +840,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -958,6 +968,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_overlapping(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1033,6 +1044,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1108,6 +1120,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1156,6 +1169,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1198,6 +1212,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1258,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag(t *testing. func TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1288,6 +1304,7 @@ func TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testi func TestAccS3ObjectCopy_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1331,6 +1348,7 @@ func TestAccS3ObjectCopy_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1414,6 +1432,7 @@ func TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1489,6 +1508,7 @@ func TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1650,6 +1670,7 @@ func TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_s3_object_copy.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/object_data_source_tags_gen_test.go b/internal/service/s3/object_data_source_tags_gen_test.go index 1f8385b1b65a..d84a80401174 100644 --- a/internal/service/s3/object_data_source_tags_gen_test.go +++ b/internal/service/s3/object_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccS3ObjectDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccS3ObjectDataSource_tags(t *testing.T) { func TestAccS3ObjectDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccS3ObjectDataSource_tags_NullMap(t *testing.T) { func TestAccS3ObjectDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccS3ObjectDataSource_tags_EmptyMap(t *testing.T) { func TestAccS3ObjectDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccS3ObjectDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3ObjectDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccS3ObjectDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccS3ObjectDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/object_identity_gen_test.go b/internal/service/s3/object_identity_gen_test.go index a4a4d2a44315..c194a258b21b 100644 --- a/internal/service/s3/object_identity_gen_test.go +++ b/internal/service/s3/object_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccS3Object_Identity_Basic(t *testing.T) { resourceName := "aws_s3_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccS3Object_Identity_RegionOverride(t *testing.T) { resourceName := "aws_s3_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -216,7 +216,7 @@ func TestAccS3Object_Identity_ExistingResource(t *testing.T) { resourceName := "aws_s3_object.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/s3/object_tags_gen_test.go b/internal/service/s3/object_tags_gen_test.go index b34d4332d892..dbbb1f436bdb 100644 --- a/internal/service/s3/object_tags_gen_test.go +++ b/internal/service/s3/object_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccS3Object_tags(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccS3Object_tags(t *testing.T) { func TestAccS3Object_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccS3Object_tags_null(t *testing.T) { func TestAccS3Object_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccS3Object_tags_EmptyMap(t *testing.T) { func TestAccS3Object_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccS3Object_tags_AddOnUpdate(t *testing.T) { func TestAccS3Object_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccS3Object_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccS3Object_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccS3Object_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccS3Object_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccS3Object_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccS3Object_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccS3Object_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccS3Object_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccS3Object_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccS3Object_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccS3Object_tags_DefaultTags_overlapping(t *testing.T) { func TestAccS3Object_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccS3Object_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccS3Object_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccS3Object_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccS3Object_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccS3Object_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccS3Object_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccS3Object_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccS3Object_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccS3Object_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccS3Object_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccS3Object_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T func TestAccS3Object_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccS3Object_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccS3Object_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccS3Object_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccS3Object_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccS3Object_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccS3Object_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccS3Object_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccS3Object_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v s3.GetObjectOutput resourceName := "aws_s3_object.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/s3/service_endpoint_resolver_gen.go b/internal/service/s3/service_endpoint_resolver_gen.go index 09052d858cf7..18e5b0555bf3 100644 --- a/internal/service/s3/service_endpoint_resolver_gen.go +++ b/internal/service/s3/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params s3.EndpointParam }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up s3 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up s3 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 6b9189d4ec56..5f8289c28b08 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -753,7 +753,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/s3control/access_grant.go b/internal/service/s3control/access_grant.go index 2465dc2defdc..52c2db9ec177 100644 --- a/internal/service/s3control/access_grant.go +++ b/internal/service/s3control/access_grant.go @@ -173,7 +173,7 @@ func (r *accessGrantResource) Create(ctx context.Context, request resource.Creat input.Tags = getTagsIn(ctx) // "InvalidRequest: Invalid Grantee in the request". - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, s3PropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, s3PropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateAccessGrant(ctx, &input) }, errCodeInvalidRequest, "Invalid Grantee in the request") diff --git a/internal/service/s3control/access_grants_location.go b/internal/service/s3control/access_grants_location.go index f363e2771381..81bfb98492e3 100644 --- a/internal/service/s3control/access_grants_location.go +++ b/internal/service/s3control/access_grants_location.go @@ -105,7 +105,7 @@ func (r *accessGrantsLocationResource) Create(ctx context.Context, request resou // Additional fields. input.Tags = getTagsIn(ctx) - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateAccessGrantsLocation(ctx, &input) }, errCodeInvalidIAMRole) @@ -190,7 +190,7 @@ func (r *accessGrantsLocationResource) Update(ctx context.Context, request resou return } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func(ctx context.Context) (any, error) { return conn.UpdateAccessGrantsLocation(ctx, &input) }, errCodeInvalidIAMRole) @@ -218,7 +218,7 @@ func (r *accessGrantsLocationResource) Delete(ctx context.Context, request resou AccountId: fwflex.StringFromFramework(ctx, data.AccountID), } // "AccessGrantsLocationNotEmptyError: Please delete access grants before deleting access grants location". - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, s3PropagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteAccessGrantsLocation(ctx, &input) }, errCodeAccessGrantsLocationNotEmptyError) diff --git a/internal/service/s3control/access_point.go b/internal/service/s3control/access_point.go index efa63bd57db5..395d3dfa99ac 100644 --- a/internal/service/s3control/access_point.go +++ b/internal/service/s3control/access_point.go @@ -22,12 +22,14 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) // @SDKResource("aws_s3_access_point, name="Access Point") +// @Tags(identifierAttribute="arn") func resourceAccessPoint() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceAccessPointCreate, @@ -128,6 +130,8 @@ func resourceAccessPoint() *schema.Resource { }, }, }, + names.AttrTags: tftags.TagsSchema(), + names.AttrTagsAll: tftags.TagsSchemaComputed(), names.AttrVPCConfiguration: { Type: schema.TypeList, Optional: true, @@ -162,6 +166,7 @@ func resourceAccessPointCreate(ctx context.Context, d *schema.ResourceData, meta AccountId: aws.String(accountID), Bucket: aws.String(d.Get(names.AttrBucket).(string)), Name: aws.String(name), + Tags: getTagsIn(ctx), } if v, ok := d.GetOk("bucket_account_id"); ok { diff --git a/internal/service/s3control/access_point_data_source.go b/internal/service/s3control/access_point_data_source.go index 2830332e88bb..052611507424 100644 --- a/internal/service/s3control/access_point_data_source.go +++ b/internal/service/s3control/access_point_data_source.go @@ -15,10 +15,12 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/names" ) // @FrameworkDataSource("aws_s3_access_point", name="Access Point") +// @Tags(identifierAttribute="arn") func newAccessPointDataSource(context.Context) (datasource.DataSourceWithConfigure, error) { return &accessPointDataSource{}, nil } @@ -67,6 +69,7 @@ func (d *accessPointDataSource) Schema(ctx context.Context, request datasource.S Computed: true, }, "public_access_block_configuration": framework.DataSourceComputedListOfObjectAttribute[publicAccessBlockConfigurationModel](ctx), + names.AttrTags: tftags.TagsAttributeComputedOnly(), names.AttrVPCConfiguration: framework.DataSourceComputedListOfObjectAttribute[vpcConfigurationModel](ctx), }, } @@ -117,6 +120,7 @@ type accessPointDataSourceModel struct { Name types.String `tfsdk:"name"` NetworkOrigin types.String `tfsdk:"network_origin"` PublicAccessBlockConfiguration fwtypes.ListNestedObjectValueOf[publicAccessBlockConfigurationModel] `tfsdk:"public_access_block_configuration"` + Tags tftags.Map `tfsdk:"tags"` VPCConfiguration fwtypes.ListNestedObjectValueOf[vpcConfigurationModel] `tfsdk:"vpc_configuration"` } diff --git a/internal/service/s3control/access_point_data_source_test.go b/internal/service/s3control/access_point_data_source_test.go index 4379d0688f48..9b8f59c73184 100644 --- a/internal/service/s3control/access_point_data_source_test.go +++ b/internal/service/s3control/access_point_data_source_test.go @@ -33,6 +33,7 @@ func TestAccS3ControlAccessPointDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, names.AttrBucket, dataSourceName, names.AttrBucket), resource.TestCheckResourceAttrPair(resourceName, "bucket_account_id", dataSourceName, "bucket_account_id"), resource.TestCheckResourceAttrPair(resourceName, names.AttrName, dataSourceName, names.AttrName), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsPercent, dataSourceName, acctest.CtTagsPercent), resource.TestCheckResourceAttrPair(resourceName, "network_origin", dataSourceName, "network_origin"), ), }, @@ -41,7 +42,7 @@ func TestAccS3ControlAccessPointDataSource_basic(t *testing.T) { } func testAccAccessPointDataSourceConfig_basic(bucketName, accessPointName string) string { - return acctest.ConfigCompose(testAccAccessPointConfig_basic(bucketName, accessPointName), ` + return acctest.ConfigCompose(testAccAccessPointConfig_tags1(bucketName, accessPointName, acctest.CtKey1, acctest.CtValue1), ` data "aws_s3_access_point" "test" { name = aws_s3_access_point.test.name } diff --git a/internal/service/s3control/access_point_test.go b/internal/service/s3control/access_point_test.go index ab4509db3b35..ff4764422fe0 100644 --- a/internal/service/s3control/access_point_test.go +++ b/internal/service/s3control/access_point_test.go @@ -14,6 +14,7 @@ import ( sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/statecheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" @@ -40,7 +41,7 @@ func TestAccS3ControlAccessPoint_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAccessPointConfig_basic(bucketName, accessPointName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAccessPointExists(ctx, resourceName, &v), acctest.CheckResourceAttrAccountID(ctx, resourceName, names.AttrAccountID), // https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-alias.html: @@ -59,6 +60,7 @@ func TestAccS3ControlAccessPoint_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_policy", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.ignore_public_acls", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.restrict_public_buckets", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "0"), resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), ), }, @@ -91,6 +93,11 @@ func TestAccS3ControlAccessPoint_disappears(t *testing.T) { acctest.CheckResourceDisappears(ctx, acctest.Provider, tfs3control.ResourceAccessPoint(), resourceName), ), ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, }, }, }) @@ -359,6 +366,53 @@ func TestAccS3ControlAccessPoint_directoryBucket_basic(t *testing.T) { }) } +func TestAccS3ControlAccessPoint_tags(t *testing.T) { + ctx := acctest.Context(t) + var v s3control.GetAccessPointOutput + bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + accessPointName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_s3_access_point.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.S3ControlServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAccessPointDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAccessPointConfig_tags1(bucketName, accessPointName, acctest.CtKey1, acctest.CtValue1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAccessPointExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAccessPointConfig_tags2(bucketName, accessPointName, acctest.CtKey1, acctest.CtValue1Updated, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAccessPointExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "2"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey1, acctest.CtValue1Updated), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + { + Config: testAccAccessPointConfig_tags1(bucketName, accessPointName, acctest.CtKey2, acctest.CtValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAccessPointExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "1"), + resource.TestCheckResourceAttr(resourceName, acctest.CtTagsKey2, acctest.CtValue2), + ), + }, + }, + }) +} + func testAccCheckAccessPointDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).S3ControlClient(ctx) @@ -676,3 +730,38 @@ resource "aws_s3_access_point" "test" { } `, rName)) } + +func testAccAccessPointConfig_tags1(bucketName, accessPointName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = aws_s3_bucket.test.bucket + name = %[2]q + + tags = { + %[3]q = %[4]q + } +} +`, bucketName, accessPointName, tagKey1, tagValue1) +} + +func testAccAccessPointConfig_tags2(bucketName, accessPointName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = aws_s3_bucket.test.bucket + name = %[2]q + + tags = { + %[3]q = %[4]q + %[5]q = %[6]q + } +} +`, bucketName, accessPointName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/internal/service/s3control/account_public_access_block_identity_gen_test.go b/internal/service/s3control/account_public_access_block_identity_gen_test.go index 78235fc8ec6e..d0549e12b97d 100644 --- a/internal/service/s3control/account_public_access_block_identity_gen_test.go +++ b/internal/service/s3control/account_public_access_block_identity_gen_test.go @@ -36,7 +36,7 @@ func testAccS3ControlAccountPublicAccessBlock_Identity_Basic(t *testing.T) { var v awstypes.PublicAccessBlockConfiguration resourceName := "aws_s3_account_public_access_block.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -107,7 +107,7 @@ func testAccS3ControlAccountPublicAccessBlock_Identity_ExistingResource(t *testi var v awstypes.PublicAccessBlockConfiguration resourceName := "aws_s3_account_public_access_block.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/s3control/bucket.go b/internal/service/s3control/bucket.go index e3df9434bb6e..f827cec6c134 100644 --- a/internal/service/s3control/bucket.go +++ b/internal/service/s3control/bucket.go @@ -186,7 +186,7 @@ func resourceBucketDelete(ctx context.Context, d *schema.ResourceData, meta any) // can occur on deletion: // InvalidBucketState: Bucket is in an invalid state log.Printf("[DEBUG] Deleting S3 Control Bucket: %s", d.Id()) - _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketStatePropagationTimeout, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, bucketStatePropagationTimeout, func(ctx context.Context) (any, error) { return conn.DeleteBucket(ctx, input) }, errCodeInvalidBucketState) diff --git a/internal/service/s3control/service_endpoint_resolver_gen.go b/internal/service/s3control/service_endpoint_resolver_gen.go index 29593cd2fde3..f8cabada3ce8 100644 --- a/internal/service/s3control/service_endpoint_resolver_gen.go +++ b/internal/service/s3control/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params s3control.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up s3control endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up s3control endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/s3control/service_package_gen.go b/internal/service/s3control/service_package_gen.go index 463e508b3ce4..b5b51773383b 100644 --- a/internal/service/s3control/service_package_gen.go +++ b/internal/service/s3control/service_package_gen.go @@ -24,7 +24,10 @@ func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*inttypes.S Factory: newAccessPointDataSource, TypeName: "aws_s3_access_point", Name: "Access Point", - Region: unique.Make(inttypes.ResourceRegionDefault()), + Tags: unique.Make(inttypes.ServicePackageResourceTags{ + IdentifierAttribute: names.AttrARN, + }), + Region: unique.Make(inttypes.ResourceRegionDefault()), }, } } @@ -96,7 +99,10 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa Factory: resourceAccessPoint, TypeName: "aws_s3_access_point", Name: "Access Point", - Region: unique.Make(inttypes.ResourceRegionDefault()), + Tags: unique.Make(inttypes.ServicePackageResourceTags{ + IdentifierAttribute: names.AttrARN, + }), + Region: unique.Make(inttypes.ResourceRegionDefault()), }, { Factory: resourceAccountPublicAccessBlock, diff --git a/internal/service/s3outposts/service_endpoint_resolver_gen.go b/internal/service/s3outposts/service_endpoint_resolver_gen.go index f457b581e30a..346ca329bd22 100644 --- a/internal/service/s3outposts/service_endpoint_resolver_gen.go +++ b/internal/service/s3outposts/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params s3outposts.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up s3outposts endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up s3outposts endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index 7bf7c0cd9a2a..2ba1a8a5cb95 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/s3tables/exports_test.go b/internal/service/s3tables/exports_test.go index d50b5c17dc29..44ea3e7acf15 100644 --- a/internal/service/s3tables/exports_test.go +++ b/internal/service/s3tables/exports_test.go @@ -10,11 +10,11 @@ var ( NewResourceTableBucketPolicy = newTableBucketPolicyResource ResourceTablePolicy = newTablePolicyResource - FindNamespace = findNamespace - FindTable = findTable - FindTableBucket = findTableBucket - FindTableBucketPolicy = findTableBucketPolicy - FindTablePolicy = findTablePolicy + FindNamespace = findNamespace + FindTableByThreePartKey = findTableByThreePartKey + FindTableBucket = findTableBucket + FindTableBucketPolicy = findTableBucketPolicy + FindTablePolicy = findTablePolicy TableIDFromTableARN = tableIDFromTableARN ) diff --git a/internal/service/s3tables/service_endpoint_resolver_gen.go b/internal/service/s3tables/service_endpoint_resolver_gen.go index 5e03ccf49e00..69db7bbf695c 100644 --- a/internal/service/s3tables/service_endpoint_resolver_gen.go +++ b/internal/service/s3tables/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params s3tables.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up s3tables endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up s3tables endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/s3tables/service_endpoints_gen_test.go b/internal/service/s3tables/service_endpoints_gen_test.go index c7f3191876ba..357a3ddbdc14 100644 --- a/internal/service/s3tables/service_endpoints_gen_test.go +++ b/internal/service/s3tables/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/s3tables/table.go b/internal/service/s3tables/table.go index d0eb32add6fe..a48b29cbe760 100644 --- a/internal/service/s3tables/table.go +++ b/internal/service/s3tables/table.go @@ -31,10 +31,10 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" - "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -45,16 +45,12 @@ func newTableResource(_ context.Context) (resource.ResourceWithConfigure, error) return &tableResource{}, nil } -const ( - ResNameTable = "Table" -) - type tableResource struct { framework.ResourceWithModel[tableResourceModel] } -func (r *tableResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ +func (r *tableResource) Schema(ctx context.Context, request resource.SchemaRequest, response *resource.SchemaResponse) { + response.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ names.AttrARN: framework.ARNAttributeComputedOnly(), names.AttrCreatedAt: schema.StringAttribute{ @@ -235,396 +231,393 @@ func (r *tableResource) Schema(ctx context.Context, req resource.SchemaRequest, } } -func (r *tableResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - conn := r.Meta().S3TablesClient(ctx) - - var plan tableResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) - if resp.Diagnostics.HasError() { +func (r *tableResource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { + var data tableResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &data)...) + if response.Diagnostics.HasError() { return } + conn := r.Meta().S3TablesClient(ctx) + + name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) var input s3tables.CreateTableInput - resp.Diagnostics.Append(flex.Expand(ctx, plan, &input)...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Expand(ctx, data, &input)...) + if response.Diagnostics.HasError() { return } - // Handle metadata separately since it's an interface type - if !plan.Metadata.IsNull() && !plan.Metadata.IsUnknown() { - metadataModel, d := plan.Metadata.ToPtr(ctx) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + // Handle metadata separately since it's an interface type. + if !data.Metadata.IsNull() && !data.Metadata.IsUnknown() { + metadataModel, diags := data.Metadata.ToPtr(ctx) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } - resp.Diagnostics.Append(flex.Expand(ctx, metadataModel, &input.Metadata)...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Expand(ctx, metadataModel, &input.Metadata)...) + if response.Diagnostics.HasError() { return } } _, err := conn.CreateTable(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, ResNameTable, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("creating S3 Tables Table (%s)", name), err.Error()) + return } - if !plan.MaintenanceConfiguration.IsUnknown() && !plan.MaintenanceConfiguration.IsNull() { - mc, d := plan.MaintenanceConfiguration.ToPtr(ctx) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + if !data.MaintenanceConfiguration.IsUnknown() && !data.MaintenanceConfiguration.IsNull() { + mc, diags := data.MaintenanceConfiguration.ToPtr(ctx) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } if !mc.IcebergCompaction.IsNull() { + typ := awstypes.TableMaintenanceTypeIcebergCompaction input := s3tables.PutTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - Type: awstypes.TableMaintenanceTypeIcebergCompaction, + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + Type: typ, } - value, d := expandTableMaintenanceIcebergCompaction(ctx, mc.IcebergCompaction) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + value, diags := expandTableMaintenanceIcebergCompaction(ctx, mc.IcebergCompaction) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } input.Value = &value _, err := conn.PutTableMaintenanceConfiguration(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("putting S3 Tables Table (%s) maintenance configuration (%s)", name, typ), err.Error()) + return } } if !mc.IcebergSnapshotManagement.IsNull() { + typ := awstypes.TableMaintenanceTypeIcebergSnapshotManagement input := s3tables.PutTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - Type: awstypes.TableMaintenanceTypeIcebergSnapshotManagement, + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + Type: typ, } - value, d := expandTableMaintenanceIcebergSnapshotManagement(ctx, mc.IcebergSnapshotManagement) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + value, diags := expandTableMaintenanceIcebergSnapshotManagement(ctx, mc.IcebergSnapshotManagement) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } input.Value = &value _, err := conn.PutTableMaintenanceConfiguration(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("putting S3 Tables Table (%s) maintenance configuration (%s)", name, typ), err.Error()) + return } } } - table, err := findTable(ctx, conn, plan.TableBucketARN.ValueString(), plan.Namespace.ValueString(), plan.Name.ValueString()) + outputGT, err := findTableByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, ResNameTable, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s)", name), err.Error()) + return } - resp.Diagnostics.Append(flex.Flatten(ctx, table, &plan, flex.WithFieldNamePrefix("Table"))...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Flatten(ctx, outputGT, &data, fwflex.WithFieldNamePrefix("Table"))...) + if response.Diagnostics.HasError() { return } - plan.Namespace = types.StringValue(table.Namespace[0]) + data.Namespace = types.StringValue(outputGT.Namespace[0]) + + outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + + switch { + case tfresource.NotFound(err): + case err != nil: + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) - awsMaintenanceConfig, err := conn.GetTableMaintenanceConfiguration(ctx, &s3tables.GetTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - }) - if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) - } - maintenanceConfiguration, d := flattenTableMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { return + default: + value, diags := flattenTableMaintenanceConfiguration(ctx, outputGTMC) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { + return + } + data.MaintenanceConfiguration = value } - plan.MaintenanceConfiguration = maintenanceConfiguration - awsEncryptionConfig, err := conn.GetTableEncryption(ctx, &s3tables.GetTableEncryptionInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - }) + outputGTE, err := findTableEncryptionByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + switch { - case errs.IsA[*awstypes.NotFoundException](err): + case tfresource.NotFound(err): case err != nil: - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) encryption", name), err.Error()) + + return default: var encryptionConfiguration encryptionConfigurationModel - resp.Diagnostics.Append(flex.Flatten(ctx, awsEncryptionConfig.EncryptionConfiguration, &encryptionConfiguration)...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Flatten(ctx, outputGTE.EncryptionConfiguration, &encryptionConfiguration)...) + if response.Diagnostics.HasError() { return } - plan.EncryptionConfiguration, d = fwtypes.NewObjectValueOf(ctx, &encryptionConfiguration) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + var diags diag.Diagnostics + data.EncryptionConfiguration, diags = fwtypes.NewObjectValueOf(ctx, &encryptionConfiguration) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } } - resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) + response.Diagnostics.Append(response.State.Set(ctx, data)...) } -func (r *tableResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - conn := r.Meta().S3TablesClient(ctx) - - var state tableResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - if resp.Diagnostics.HasError() { +func (r *tableResource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { + var data tableResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { return } - out, err := findTable(ctx, conn, state.TableBucketARN.ValueString(), state.Namespace.ValueString(), state.Name.ValueString()) + conn := r.Meta().S3TablesClient(ctx) + + name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) + outputGT, err := findTableByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + if tfresource.NotFound(err) { - resp.State.RemoveResource(ctx) + response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + response.State.RemoveResource(ctx) + return } + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, ResNameTable, state.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s)", name), err.Error()) + return } - resp.Diagnostics.Append(flex.Flatten(ctx, out, &state, flex.WithFieldNamePrefix("Table"))...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Flatten(ctx, outputGT, &data, fwflex.WithFieldNamePrefix("Table"))...) + if response.Diagnostics.HasError() { return } - state.Namespace = types.StringValue(out.Namespace[0]) + data.Namespace = types.StringValue(outputGT.Namespace[0]) + + outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + + switch { + case tfresource.NotFound(err): + case err != nil: + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) - awsMaintenanceConfig, err := conn.GetTableMaintenanceConfiguration(ctx, &s3tables.GetTableMaintenanceConfigurationInput{ - Name: state.Name.ValueStringPointer(), - Namespace: state.Namespace.ValueStringPointer(), - TableBucketARN: state.TableBucketARN.ValueStringPointer(), - }) - if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, state.Name.String(), err), - err.Error(), - ) - } - maintenanceConfiguration, d := flattenTableMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { return + default: + value, diags := flattenTableMaintenanceConfiguration(ctx, outputGTMC) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { + return + } + data.MaintenanceConfiguration = value } - state.MaintenanceConfiguration = maintenanceConfiguration - awsEncryptionConfig, err := conn.GetTableEncryption(ctx, &s3tables.GetTableEncryptionInput{ - Name: state.Name.ValueStringPointer(), - Namespace: state.Namespace.ValueStringPointer(), - TableBucketARN: state.TableBucketARN.ValueStringPointer(), - }) - if err != nil { - if !errs.IsA[*awstypes.NotFoundException](err) { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, state.Name.String(), err), - err.Error(), - ) - } - } else { + outputGTE, err := findTableEncryptionByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + + switch { + case tfresource.NotFound(err): + case err != nil: + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) encryption", name), err.Error()) + + return + default: var encryptionConfiguration encryptionConfigurationModel - resp.Diagnostics.Append(flex.Flatten(ctx, awsEncryptionConfig.EncryptionConfiguration, &encryptionConfiguration)...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Flatten(ctx, outputGTE.EncryptionConfiguration, &encryptionConfiguration)...) + if response.Diagnostics.HasError() { return } - state.EncryptionConfiguration, d = fwtypes.NewObjectValueOf(ctx, &encryptionConfiguration) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + var diags diag.Diagnostics + data.EncryptionConfiguration, diags = fwtypes.NewObjectValueOf(ctx, &encryptionConfiguration) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } } - resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) + response.Diagnostics.Append(response.State.Set(ctx, &data)...) } -func (r *tableResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - conn := r.Meta().S3TablesClient(ctx) - - var plan, state tableResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - if resp.Diagnostics.HasError() { +func (r *tableResource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { + var new, old tableResourceModel + response.Diagnostics.Append(request.Plan.Get(ctx, &new)...) + if response.Diagnostics.HasError() { return } + response.Diagnostics.Append(request.State.Get(ctx, &old)...) + if response.Diagnostics.HasError() { + return + } + + conn := r.Meta().S3TablesClient(ctx) + + // New name and namespace. + name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, new.Name), fwflex.StringValueFromFramework(ctx, new.Namespace), fwflex.StringValueFromFramework(ctx, new.TableBucketARN) - if !plan.Name.Equal(state.Name) || !plan.Namespace.Equal(state.Namespace) { + if !new.Name.Equal(old.Name) || !new.Namespace.Equal(old.Namespace) { input := s3tables.RenameTableInput{ - TableBucketARN: state.TableBucketARN.ValueStringPointer(), - Namespace: state.Namespace.ValueStringPointer(), - Name: state.Name.ValueStringPointer(), + Name: old.Name.ValueStringPointer(), + Namespace: old.Namespace.ValueStringPointer(), + TableBucketARN: aws.String(tableBucketARN), } - if !plan.Name.Equal(state.Name) { - input.NewName = plan.Name.ValueStringPointer() + if !new.Name.Equal(old.Name) { + input.NewName = aws.String(name) } - if !plan.Namespace.Equal(state.Namespace) { - input.NewNamespaceName = plan.Namespace.ValueStringPointer() + if !new.Namespace.Equal(old.Namespace) { + input.NewNamespaceName = aws.String(namespace) } _, err := conn.RenameTable(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, ResNameTable, state.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("renaming S3 Tables Table (%s)", name), err.Error()) + + return } } - if !plan.MaintenanceConfiguration.Equal(state.MaintenanceConfiguration) { - planMC, d := plan.MaintenanceConfiguration.ToPtr(ctx) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + if !new.MaintenanceConfiguration.Equal(old.MaintenanceConfiguration) { + newMC, d := new.MaintenanceConfiguration.ToPtr(ctx) + response.Diagnostics.Append(d...) + if response.Diagnostics.HasError() { return } - stateMC, d := state.MaintenanceConfiguration.ToPtr(ctx) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + oldMC, d := old.MaintenanceConfiguration.ToPtr(ctx) + response.Diagnostics.Append(d...) + if response.Diagnostics.HasError() { return } - if !planMC.IcebergCompaction.Equal(stateMC.IcebergCompaction) { + if !newMC.IcebergCompaction.Equal(oldMC.IcebergCompaction) { + typ := awstypes.TableMaintenanceTypeIcebergCompaction input := s3tables.PutTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - Type: awstypes.TableMaintenanceTypeIcebergCompaction, + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + Type: typ, } - value, d := expandTableMaintenanceIcebergCompaction(ctx, planMC.IcebergCompaction) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + value, diags := expandTableMaintenanceIcebergCompaction(ctx, newMC.IcebergCompaction) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { return } input.Value = &value _, err := conn.PutTableMaintenanceConfiguration(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("putting S3 Tables Table (%s) maintenance configuration (%s)", name, typ), err.Error()) + return } } - if !planMC.IcebergSnapshotManagement.Equal(stateMC.IcebergSnapshotManagement) { + if !newMC.IcebergSnapshotManagement.Equal(oldMC.IcebergSnapshotManagement) { + typ := awstypes.TableMaintenanceTypeIcebergSnapshotManagement input := s3tables.PutTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - Type: awstypes.TableMaintenanceTypeIcebergSnapshotManagement, + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + Type: typ, } - value, d := expandTableMaintenanceIcebergSnapshotManagement(ctx, planMC.IcebergSnapshotManagement) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { + value, d := expandTableMaintenanceIcebergSnapshotManagement(ctx, newMC.IcebergSnapshotManagement) + response.Diagnostics.Append(d...) + if response.Diagnostics.HasError() { return } input.Value = &value _, err := conn.PutTableMaintenanceConfiguration(ctx, &input) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("putting S3 Tables Table (%s) maintenance configuration (%s)", name, typ), err.Error()) + return } } } - table, err := findTable(ctx, conn, plan.TableBucketARN.ValueString(), plan.Namespace.ValueString(), plan.Name.ValueString()) + outputGT, err := findTableByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, ResNameTable, plan.Name.String(), err), - err.Error(), - ) + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s)", name), err.Error()) + return } - resp.Diagnostics.Append(flex.Flatten(ctx, table, &plan, flex.WithFieldNamePrefix("Table"))...) - if resp.Diagnostics.HasError() { + response.Diagnostics.Append(fwflex.Flatten(ctx, outputGT, &new, fwflex.WithFieldNamePrefix("Table"))...) + if response.Diagnostics.HasError() { return } - plan.Namespace = types.StringValue(table.Namespace[0]) + new.Namespace = types.StringValue(outputGT.Namespace[0]) + + outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) + + switch { + case tfresource.NotFound(err): + case err != nil: + response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) - awsMaintenanceConfig, err := conn.GetTableMaintenanceConfiguration(ctx, &s3tables.GetTableMaintenanceConfigurationInput{ - Name: plan.Name.ValueStringPointer(), - Namespace: plan.Namespace.ValueStringPointer(), - TableBucketARN: plan.TableBucketARN.ValueStringPointer(), - }) - if err != nil { - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, resNameTableBucket, plan.Name.String(), err), - err.Error(), - ) - } - maintenanceConfiguration, d := flattenTableMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { return + default: + value, diags := flattenTableMaintenanceConfiguration(ctx, outputGTMC) + response.Diagnostics.Append(diags...) + if response.Diagnostics.HasError() { + return + } + new.MaintenanceConfiguration = value } - plan.MaintenanceConfiguration = maintenanceConfiguration - resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) + response.Diagnostics.Append(response.State.Set(ctx, &new)...) } -func (r *tableResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - conn := r.Meta().S3TablesClient(ctx) - - var state tableResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - if resp.Diagnostics.HasError() { +func (r *tableResource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { + var data tableResourceModel + response.Diagnostics.Append(request.State.Get(ctx, &data)...) + if response.Diagnostics.HasError() { return } + conn := r.Meta().S3TablesClient(ctx) + + name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) input := s3tables.DeleteTableInput{ - Name: state.Name.ValueStringPointer(), - Namespace: state.Namespace.ValueStringPointer(), - TableBucketARN: state.TableBucketARN.ValueStringPointer(), + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), } - _, err := conn.DeleteTable(ctx, &input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return + } + if err != nil { - if errs.IsA[*awstypes.NotFoundException](err) { - return - } + response.Diagnostics.AddError(fmt.Sprintf("deleting S3 Tables Table (%s)", name), err.Error()) - resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionDeleting, ResNameTable, state.Name.String(), err), - err.Error(), - ) return } } @@ -643,30 +636,94 @@ func (r *tableResource) ImportState(ctx context.Context, req resource.ImportStat identifier.PopulateState(ctx, &resp.State, &resp.Diagnostics) } -func findTable(ctx context.Context, conn *s3tables.Client, bucketARN, namespace, name string) (*s3tables.GetTableOutput, error) { - in := s3tables.GetTableInput{ +func findTableByThreePartKey(ctx context.Context, conn *s3tables.Client, tableBucketARN, namespace, name string) (*s3tables.GetTableOutput, error) { + input := s3tables.GetTableInput{ + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + } + + return findTable(ctx, conn, &input) +} + +func findTable(ctx context.Context, conn *s3tables.Client, input *s3tables.GetTableInput) (*s3tables.GetTableOutput, error) { + output, err := conn.GetTable(ctx, input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + +func findTableEncryptionByThreePartKey(ctx context.Context, conn *s3tables.Client, tableBucketARN, namespace, name string) (*s3tables.GetTableEncryptionOutput, error) { + input := s3tables.GetTableEncryptionInput{ Name: aws.String(name), Namespace: aws.String(namespace), - TableBucketARN: aws.String(bucketARN), + TableBucketARN: aws.String(tableBucketARN), + } + + return findTableEncryption(ctx, conn, &input) +} + +func findTableEncryption(ctx context.Context, conn *s3tables.Client, input *s3tables.GetTableEncryptionInput) (*s3tables.GetTableEncryptionOutput, error) { + output, err := conn.GetTableEncryption(ctx, input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + } } - out, err := conn.GetTable(ctx, &in) if err != nil { - if errs.IsA[*awstypes.NotFoundException](err) { - return nil, &retry.NotFoundError{ - LastError: err, - LastRequest: in, - } + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + +func findTableMaintenanceConfigurationByThreePartKey(ctx context.Context, conn *s3tables.Client, tableBucketARN, namespace, name string) (*s3tables.GetTableMaintenanceConfigurationOutput, error) { + input := s3tables.GetTableMaintenanceConfigurationInput{ + Name: aws.String(name), + Namespace: aws.String(namespace), + TableBucketARN: aws.String(tableBucketARN), + } + + return findTableMaintenanceConfiguration(ctx, conn, &input) +} + +func findTableMaintenanceConfiguration(ctx context.Context, conn *s3tables.Client, input *s3tables.GetTableMaintenanceConfigurationInput) (*s3tables.GetTableMaintenanceConfigurationOutput, error) { + output, err := conn.GetTableMaintenanceConfiguration(ctx, input) + + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, } + } + if err != nil { return nil, err } - if out == nil { - return nil, tfresource.NewEmptyResultError(in) + if output == nil { + return nil, tfresource.NewEmptyResultError(input) } - return out, nil + return output, nil } type tableResourceModel struct { @@ -779,7 +836,7 @@ func expandIcebergCompactionSettings(ctx context.Context, in fwtypes.ObjectValue var value awstypes.IcebergCompactionSettings - diags.Append(flex.Expand(ctx, model, &value)...) + diags.Append(fwflex.Expand(ctx, model, &value)...) return &awstypes.TableMaintenanceSettingsMemberIcebergCompaction{ Value: value, @@ -790,7 +847,7 @@ func flattenIcebergCompactionSettings(ctx context.Context, in awstypes.TableMain switch t := in.(type) { case *awstypes.TableMaintenanceSettingsMemberIcebergCompaction: var model icebergCompactionSettingsModel - diags.Append(flex.Flatten(ctx, t.Value, &model)...) + diags.Append(fwflex.Flatten(ctx, t.Value, &model)...) result = fwtypes.NewObjectValueOfMust(ctx, &model) case *awstypes.UnknownUnionMember: @@ -849,7 +906,7 @@ func expandIcebergSnapshotManagementSettings(ctx context.Context, in fwtypes.Obj var value awstypes.IcebergSnapshotManagementSettings - diags.Append(flex.Expand(ctx, model, &value)...) + diags.Append(fwflex.Expand(ctx, model, &value)...) return &awstypes.TableMaintenanceSettingsMemberIcebergSnapshotManagement{ Value: value, @@ -860,7 +917,7 @@ func flattenIcebergSnapshotManagementSettings(ctx context.Context, in awstypes.T switch t := in.(type) { case *awstypes.TableMaintenanceSettingsMemberIcebergSnapshotManagement: var model icebergSnapshotManagementSettingsModel - diags.Append(flex.Flatten(ctx, t.Value, &model)...) + diags.Append(fwflex.Flatten(ctx, t.Value, &model)...) result = fwtypes.NewObjectValueOfMust(ctx, &model) case *awstypes.UnknownUnionMember: @@ -955,7 +1012,7 @@ type icebergSchemaFieldModel struct { } var ( - _ flex.Expander = tableMetadataModel{} + _ fwflex.Expander = tableMetadataModel{} ) func (m tableMetadataModel) Expand(ctx context.Context) (out any, diags diag.Diagnostics) { @@ -970,7 +1027,7 @@ func (m tableMetadataModel) Expand(ctx context.Context) (out any, diags diag.Dia // Create Iceberg schema var schema awstypes.IcebergMetadata - diags.Append(flex.Expand(ctx, icebergModel, &schema)...) + diags.Append(fwflex.Expand(ctx, icebergModel, &schema)...) if diags.HasError() { return nil, diags } diff --git a/internal/service/s3tables/table_bucket.go b/internal/service/s3tables/table_bucket.go index a4ecd768546c..3f599fe834e4 100644 --- a/internal/service/s3tables/table_bucket.go +++ b/internal/service/s3tables/table_bucket.go @@ -176,6 +176,7 @@ func (r *tableBucketResource) Create(ctx context.Context, req resource.CreateReq create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, resNameTableBucket, plan.Name.String(), err), err.Error(), ) + return } resp.Diagnostics.Append(flex.Flatten(ctx, bucket, &plan)...) @@ -183,21 +184,22 @@ func (r *tableBucketResource) Create(ctx context.Context, req resource.CreateReq return } - awsMaintenanceConfig, err := conn.GetTableBucketMaintenanceConfiguration(ctx, &s3tables.GetTableBucketMaintenanceConfigurationInput{ - TableBucketARN: bucket.Arn, - }) - if err != nil { + awsMaintenanceConfig, err := findTableBucketMaintenanceConfiguration(ctx, conn, plan.ARN.ValueString()) + switch { + case tfresource.NotFound(err): + case err != nil: resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionCreating, resNameTableBucket, plan.Name.String(), err), + create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, plan.Name.String(), err), err.Error(), ) + default: + maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + plan.MaintenanceConfiguration = maintenanceConfiguration } - maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { - return - } - plan.MaintenanceConfiguration = maintenanceConfiguration awsEncryptionConfig, err := findTableBucketEncryptionConfiguration(ctx, conn, plan.ARN.ValueString()) switch { @@ -246,21 +248,22 @@ func (r *tableBucketResource) Read(ctx context.Context, req resource.ReadRequest return } - awsMaintenanceConfig, err := conn.GetTableBucketMaintenanceConfiguration(ctx, &s3tables.GetTableBucketMaintenanceConfigurationInput{ - TableBucketARN: state.ARN.ValueStringPointer(), - }) - if err != nil { + awsMaintenanceConfig, err := findTableBucketMaintenanceConfiguration(ctx, conn, state.ARN.ValueString()) + switch { + case tfresource.NotFound(err): + case err != nil: resp.Diagnostics.AddError( create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, state.Name.String(), err), err.Error(), ) + default: + maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + state.MaintenanceConfiguration = maintenanceConfiguration } - maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { - return - } - state.MaintenanceConfiguration = maintenanceConfiguration awsEncryptionConfig, err := findTableBucketEncryptionConfiguration(ctx, conn, state.ARN.ValueString()) switch { @@ -356,21 +359,22 @@ func (r *tableBucketResource) Update(ctx context.Context, req resource.UpdateReq } } - awsMaintenanceConfig, err := conn.GetTableBucketMaintenanceConfiguration(ctx, &s3tables.GetTableBucketMaintenanceConfigurationInput{ - TableBucketARN: state.ARN.ValueStringPointer(), - }) - if err != nil { + awsMaintenanceConfig, err := findTableBucketMaintenanceConfiguration(ctx, conn, plan.ARN.ValueString()) + switch { + case tfresource.NotFound(err): + case err != nil: resp.Diagnostics.AddError( - create.ProblemStandardMessage(names.S3Tables, create.ErrActionUpdating, resNameTableBucket, plan.Name.String(), err), + create.ProblemStandardMessage(names.S3Tables, create.ErrActionReading, resNameTableBucket, plan.Name.String(), err), err.Error(), ) + default: + maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + plan.MaintenanceConfiguration = maintenanceConfiguration } - maintenanceConfiguration, d := flattenTableBucketMaintenanceConfiguration(ctx, awsMaintenanceConfig) - resp.Diagnostics.Append(d...) - if resp.Diagnostics.HasError() { - return - } - plan.MaintenanceConfiguration = maintenanceConfiguration } resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) @@ -450,6 +454,26 @@ func findTableBucketEncryptionConfiguration(ctx context.Context, conn *s3tables. return out.EncryptionConfiguration, nil } +func findTableBucketMaintenanceConfiguration(ctx context.Context, conn *s3tables.Client, arn string) (*s3tables.GetTableBucketMaintenanceConfigurationOutput, error) { + in := s3tables.GetTableBucketMaintenanceConfigurationInput{ + TableBucketARN: aws.String(arn), + } + + out, err := conn.GetTableBucketMaintenanceConfiguration(ctx, &in) + if err != nil { + if errs.IsA[*awstypes.NotFoundException](err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + return nil, err + } + + return out, nil +} + type tableBucketResourceModel struct { framework.WithRegionModel ARN types.String `tfsdk:"arn"` diff --git a/internal/service/s3tables/table_test.go b/internal/service/s3tables/table_test.go index aaa6c18833cd..77484d277ffa 100644 --- a/internal/service/s3tables/table_test.go +++ b/internal/service/s3tables/table_test.go @@ -5,7 +5,6 @@ package s3tables_test import ( "context" - "errors" "fmt" "strings" "testing" @@ -25,7 +24,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/create" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -129,6 +127,11 @@ func TestAccS3TablesTable_disappears(t *testing.T) { acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfs3tables.NewResourceTable, resourceName), ), ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + }, }, }, }) @@ -592,48 +595,47 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { continue } - _, err := tfs3tables.FindTable(ctx, conn, + _, err := tfs3tables.FindTableByThreePartKey(ctx, conn, rs.Primary.Attributes["table_bucket_arn"], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrName], ) + if tfresource.NotFound(err) { - return nil + continue } + if err != nil { - return create.Error(names.S3Tables, create.ErrActionCheckingDestroyed, tfs3tables.ResNameTable, rs.Primary.ID, err) + return err } - return create.Error(names.S3Tables, create.ErrActionCheckingDestroyed, tfs3tables.ResNameTable, rs.Primary.ID, errors.New("not destroyed")) + return fmt.Errorf("S3 Tables Table %s still exists", rs.Primary.Attributes[names.AttrName]) } return nil } } -func testAccCheckTableExists(ctx context.Context, name string, table *s3tables.GetTableOutput) resource.TestCheckFunc { +func testAccCheckTableExists(ctx context.Context, n string, v *s3tables.GetTableOutput) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] + rs, ok := s.RootModule().Resources[n] if !ok { - return create.Error(names.S3Tables, create.ErrActionCheckingExistence, tfs3tables.ResNameTable, name, errors.New("not found")) - } - - if rs.Primary.Attributes["table_bucket_arn"] == "" || rs.Primary.Attributes[names.AttrNamespace] == "" || rs.Primary.Attributes[names.AttrName] == "" { - return create.Error(names.S3Tables, create.ErrActionCheckingExistence, tfs3tables.ResNameTable, name, errors.New("not set")) + return fmt.Errorf("Not found: %s", n) } conn := acctest.Provider.Meta().(*conns.AWSClient).S3TablesClient(ctx) - resp, err := tfs3tables.FindTable(ctx, conn, + output, err := tfs3tables.FindTableByThreePartKey(ctx, conn, rs.Primary.Attributes["table_bucket_arn"], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrName], ) + if err != nil { - return create.Error(names.S3Tables, create.ErrActionCheckingExistence, tfs3tables.ResNameTable, rs.Primary.ID, err) + return err } - *table = *resp + *v = *output return nil } diff --git a/internal/service/s3vectors/generate.go b/internal/service/s3vectors/generate.go new file mode 100644 index 000000000000..b5fabf66b3e9 --- /dev/null +++ b/internal/service/s3vectors/generate.go @@ -0,0 +1,7 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +//go:generate go run ../../generate/servicepackage/main.go +// ONLY generate directives and package declaration! Do not add anything else to this file. + +package s3vectors diff --git a/internal/service/s3vectors/service_endpoint_resolver_gen.go b/internal/service/s3vectors/service_endpoint_resolver_gen.go new file mode 100644 index 000000000000..1db1fb115fb0 --- /dev/null +++ b/internal/service/s3vectors/service_endpoint_resolver_gen.go @@ -0,0 +1,82 @@ +// Code generated by internal/generate/servicepackage/main.go; DO NOT EDIT. + +package s3vectors + +import ( + "context" + "fmt" + "net" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/s3vectors" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-provider-aws/internal/errs" +) + +var _ s3vectors.EndpointResolverV2 = resolverV2{} + +type resolverV2 struct { + defaultResolver s3vectors.EndpointResolverV2 +} + +func newEndpointResolverV2() resolverV2 { + return resolverV2{ + defaultResolver: s3vectors.NewDefaultEndpointResolverV2(), + } +} + +func (r resolverV2) ResolveEndpoint(ctx context.Context, params s3vectors.EndpointParameters) (endpoint smithyendpoints.Endpoint, err error) { + params = params.WithDefaults() + useFIPS := aws.ToBool(params.UseFIPS) + + if eps := params.Endpoint; aws.ToString(eps) != "" { + tflog.Debug(ctx, "setting endpoint", map[string]any{ + "tf_aws.endpoint": endpoint, + }) + + if useFIPS { + tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") + params.UseFIPS = aws.Bool(false) + } + + return r.defaultResolver.ResolveEndpoint(ctx, params) + } else if useFIPS { + ctx = tflog.SetField(ctx, "tf_aws.use_fips", useFIPS) + + endpoint, err = r.defaultResolver.ResolveEndpoint(ctx, params) + if err != nil { + return endpoint, err + } + + tflog.Debug(ctx, "endpoint resolved", map[string]any{ + "tf_aws.endpoint": endpoint.URI.String(), + }) + + hostname := endpoint.URI.Hostname() + _, err = net.LookupHost(hostname) + if err != nil { + if dnsErr, ok := errs.As[*net.DNSError](err); ok && dnsErr.IsNotFound { + tflog.Debug(ctx, "default endpoint host not found, disabling FIPS", map[string]any{ + "tf_aws.hostname": hostname, + }) + params.UseFIPS = aws.Bool(false) + } else { + err = fmt.Errorf("looking up s3vectors endpoint %q: %w", hostname, err) + return + } + } else { + return endpoint, err + } + } + + return r.defaultResolver.ResolveEndpoint(ctx, params) +} + +func withBaseEndpoint(endpoint string) func(*s3vectors.Options) { + return func(o *s3vectors.Options) { + if endpoint != "" { + o.BaseEndpoint = aws.String(endpoint) + } + } +} diff --git a/internal/service/s3vectors/service_endpoints_gen_test.go b/internal/service/s3vectors/service_endpoints_gen_test.go new file mode 100644 index 000000000000..8bf60804b3f3 --- /dev/null +++ b/internal/service/s3vectors/service_endpoints_gen_test.go @@ -0,0 +1,602 @@ +// Code generated by internal/generate/serviceendpointtests/main.go; DO NOT EDIT. + +package s3vectors_test + +import ( + "context" + "errors" + "fmt" + "maps" + "net" + "net/url" + "os" + "path/filepath" + "reflect" + "strings" + "testing" + + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/s3vectors" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/google/go-cmp/cmp" + "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + terraformsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type endpointTestCase struct { + with []setupFunc + expected caseExpectations +} + +type caseSetup struct { + config map[string]any + configFile configFile + environmentVariables map[string]string +} + +type configFile struct { + baseUrl string + serviceUrl string +} + +type caseExpectations struct { + diags diag.Diagnostics + endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string +} + +type setupFunc func(setup *caseSetup) + +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams + +const ( + packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" + awsServiceEnvvarEndpoint = "https://service-envvar.endpoint.test/" + baseEnvvarEndpoint = "https://base-envvar.endpoint.test/" + serviceConfigFileEndpoint = "https://service-configfile.endpoint.test/" + baseConfigFileEndpoint = "https://base-configfile.endpoint.test/" +) + +const ( + packageName = "s3vectors" + awsEnvVar = "AWS_ENDPOINT_URL_S3VECTORS" + baseEnvVar = "AWS_ENDPOINT_URL" + configParam = "s3vectors" +) + +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + +func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv + ctx := t.Context() + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion + + testcases := map[string]endpointTestCase{ + "no config": { + with: []setupFunc{withNoConfig}, + expected: expectDefaultEndpoint(ctx, t, expectedEndpointRegion), + }, + + // Package name endpoint on Config + + "package name endpoint config": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides aws service envvar": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withAwsEnvVar, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides base envvar": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withBaseEnvVar, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides service config file": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withServiceEndpointInConfigFile, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + "package name endpoint config overrides base config file": { + with: []setupFunc{ + withPackageNameEndpointInConfig, + withBaseEndpointInConfigFile, + }, + expected: expectPackageNameConfigEndpoint(), + }, + + // Service endpoint in AWS envvar + + "service aws envvar": { + with: []setupFunc{ + withAwsEnvVar, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides base envvar": { + with: []setupFunc{ + withAwsEnvVar, + withBaseEnvVar, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides service config file": { + with: []setupFunc{ + withAwsEnvVar, + withServiceEndpointInConfigFile, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + "service aws envvar overrides base config file": { + with: []setupFunc{ + withAwsEnvVar, + withBaseEndpointInConfigFile, + }, + expected: expectAwsEnvVarEndpoint(), + }, + + // Base endpoint in envvar + + "base endpoint envvar": { + with: []setupFunc{ + withBaseEnvVar, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + "base endpoint envvar overrides service config file": { + with: []setupFunc{ + withBaseEnvVar, + withServiceEndpointInConfigFile, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + "base endpoint envvar overrides base config file": { + with: []setupFunc{ + withBaseEnvVar, + withBaseEndpointInConfigFile, + }, + expected: expectBaseEnvVarEndpoint(), + }, + + // Service endpoint in config file + + "service config file": { + with: []setupFunc{ + withServiceEndpointInConfigFile, + }, + expected: expectServiceConfigFileEndpoint(), + }, + + "service config file overrides base config file": { + with: []setupFunc{ + withServiceEndpointInConfigFile, + withBaseEndpointInConfigFile, + }, + expected: expectServiceConfigFileEndpoint(), + }, + + // Base endpoint in config file + + "base endpoint config file": { + with: []setupFunc{ + withBaseEndpointInConfigFile, + }, + expected: expectBaseConfigFileEndpoint(), + }, + + // Use FIPS endpoint on Config + + "use fips config": { + with: []setupFunc{ + withUseFIPSInConfig, + }, + expected: expectDefaultFIPSEndpoint(ctx, t, expectedEndpointRegion), + }, + + "use fips config with package name endpoint config": { + with: []setupFunc{ + withUseFIPSInConfig, + withPackageNameEndpointInConfig, + }, + expected: expectPackageNameConfigEndpoint(), + }, + } + + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + t.Run(name, func(t *testing.T) { + testEndpointCase(ctx, t, providerRegion, testcase, callService) + }) + } +} + +func defaultEndpoint(ctx context.Context, region string) (url.URL, error) { + r := s3vectors.NewDefaultEndpointResolverV2() + + ep, err := r.ResolveEndpoint(ctx, s3vectors.EndpointParameters{ + Region: aws.String(region), + }) + if err != nil { + return url.URL{}, err + } + + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI, nil +} + +func defaultFIPSEndpoint(ctx context.Context, region string) (url.URL, error) { + r := s3vectors.NewDefaultEndpointResolverV2() + + ep, err := r.ResolveEndpoint(ctx, s3vectors.EndpointParameters{ + Region: aws.String(region), + UseFIPS: aws.Bool(true), + }) + if err != nil { + return url.URL{}, err + } + + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI, nil +} + +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { + t.Helper() + + client := meta.S3VectorsClient(ctx) + + var result apiCallParams + + input := s3vectors.ListVectorBucketsInput{} + _, err := client.ListVectorBuckets(ctx, &input, + func(opts *s3vectors.Options) { + opts.APIOptions = append(opts.APIOptions, + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), + addCancelRequestMiddleware(), + ) + }, + ) + if err == nil { + t.Fatal("Expected an error, got none") + } else if !errors.Is(err, errCancelOperation) { + t.Fatalf("Unexpected error: %s", err) + } + + return result +} + +func withNoConfig(_ *caseSetup) { + // no-op +} + +func withPackageNameEndpointInConfig(setup *caseSetup) { + if _, ok := setup.config[names.AttrEndpoints]; !ok { + setup.config[names.AttrEndpoints] = []any{ + map[string]any{}, + } + } + endpoints := setup.config[names.AttrEndpoints].([]any)[0].(map[string]any) + endpoints[packageName] = packageNameConfigEndpoint +} + +func withAwsEnvVar(setup *caseSetup) { + setup.environmentVariables[awsEnvVar] = awsServiceEnvvarEndpoint +} + +func withBaseEnvVar(setup *caseSetup) { + setup.environmentVariables[baseEnvVar] = baseEnvvarEndpoint +} + +func withServiceEndpointInConfigFile(setup *caseSetup) { + setup.configFile.serviceUrl = serviceConfigFileEndpoint +} + +func withBaseEndpointInConfigFile(setup *caseSetup) { + setup.configFile.baseUrl = baseConfigFileEndpoint +} + +func withUseFIPSInConfig(setup *caseSetup) { + setup.config["use_fips_endpoint"] = true +} + +func expectDefaultEndpoint(ctx context.Context, t *testing.T, region string) caseExpectations { + t.Helper() + + endpoint, err := defaultEndpoint(ctx, region) + if err != nil { + t.Fatalf("resolving accessanalyzer default endpoint: %s", err) + } + + return caseExpectations{ + endpoint: endpoint.String(), + region: expectedCallRegion, + } +} + +func expectDefaultFIPSEndpoint(ctx context.Context, t *testing.T, region string) caseExpectations { + t.Helper() + + endpoint, err := defaultFIPSEndpoint(ctx, region) + if err != nil { + t.Fatalf("resolving accessanalyzer FIPS endpoint: %s", err) + } + + hostname := endpoint.Hostname() + _, err = net.LookupHost(hostname) + if dnsErr, ok := errs.As[*net.DNSError](err); ok && dnsErr.IsNotFound { + return expectDefaultEndpoint(ctx, t, region) + } else if err != nil { + t.Fatalf("looking up accessanalyzer endpoint %q: %s", hostname, err) + } + + return caseExpectations{ + endpoint: endpoint.String(), + region: expectedCallRegion, + } +} + +func expectPackageNameConfigEndpoint() caseExpectations { + return caseExpectations{ + endpoint: packageNameConfigEndpoint, + region: expectedCallRegion, + } +} + +func expectAwsEnvVarEndpoint() caseExpectations { + return caseExpectations{ + endpoint: awsServiceEnvvarEndpoint, + region: expectedCallRegion, + } +} + +func expectBaseEnvVarEndpoint() caseExpectations { + return caseExpectations{ + endpoint: baseEnvvarEndpoint, + region: expectedCallRegion, + } +} + +func expectServiceConfigFileEndpoint() caseExpectations { + return caseExpectations{ + endpoint: serviceConfigFileEndpoint, + region: expectedCallRegion, + } +} + +func expectBaseConfigFileEndpoint() caseExpectations { + return caseExpectations{ + endpoint: baseConfigFileEndpoint, + region: expectedCallRegion, + } +} + +func testEndpointCase(ctx context.Context, t *testing.T, region string, testcase endpointTestCase, callF callFunc) { + t.Helper() + + setup := caseSetup{ + config: map[string]any{}, + environmentVariables: map[string]string{}, + } + + for _, f := range testcase.with { + f(&setup) + } + + config := map[string]any{ + names.AttrAccessKey: servicemocks.MockStaticAccessKey, + names.AttrSecretKey: servicemocks.MockStaticSecretKey, + names.AttrRegion: region, + names.AttrSkipCredentialsValidation: true, + names.AttrSkipRequestingAccountID: true, + } + + maps.Copy(config, setup.config) + + if setup.configFile.baseUrl != "" || setup.configFile.serviceUrl != "" { + config[names.AttrProfile] = "default" + tempDir := t.TempDir() + writeSharedConfigFile(t, &config, tempDir, generateSharedConfigFile(setup.configFile)) + } + + for k, v := range setup.environmentVariables { + t.Setenv(k, v) + } + + p, err := sdkv2.NewProvider(ctx) + if err != nil { + t.Fatal(err) + } + + p.TerraformVersion = "1.0.0" + + expectedDiags := testcase.expected.diags + diags := p.Configure(ctx, terraformsdk.NewResourceConfigRaw(config)) + + if diff := cmp.Diff(diags, expectedDiags, cmp.Comparer(sdkdiag.Comparer)); diff != "" { + t.Errorf("unexpected diagnostics difference: %s", diff) + } + + if diags.HasError() { + return + } + + meta := p.Meta().(*conns.AWSClient) + + callParams := callF(ctx, t, meta) + + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) + } +} + +func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + retrieveEndpointURLMiddleware(t, endpoint), + middleware.After, + ) + } +} + +func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Retrieve Endpoint", + func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + t.Helper() + + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) + } + + url := request.URL + url.RawQuery = "" + url.Path = "/" + + *endpoint = url.String() + + return next.HandleFinalize(ctx, in) + }) +} + +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + +var errCancelOperation = errors.New("Test: Canceling request") + +func addCancelRequestMiddleware() func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + cancelRequestMiddleware(), + middleware.After, + ) + } +} + +// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it +func cancelRequestMiddleware() middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Cancel Requests", + func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation + }) +} + +func fullTypeName(i any) string { + return fullValueTypeName(reflect.ValueOf(i)) +} + +func fullValueTypeName(v reflect.Value) string { + if v.Kind() == reflect.Ptr { + return "*" + fullValueTypeName(reflect.Indirect(v)) + } + + requestType := v.Type() + return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) +} + +func generateSharedConfigFile(config configFile) string { + var buf strings.Builder + + buf.WriteString(` +[default] +aws_access_key_id = DefaultSharedCredentialsAccessKey +aws_secret_access_key = DefaultSharedCredentialsSecretKey +`) + if config.baseUrl != "" { + fmt.Fprintf(&buf, "endpoint_url = %s\n", config.baseUrl) + } + + if config.serviceUrl != "" { + fmt.Fprintf(&buf, ` +services = endpoint-test + +[services endpoint-test] +%[1]s = + endpoint_url = %[2]s +`, configParam, serviceConfigFileEndpoint) + } + + return buf.String() +} + +func writeSharedConfigFile(t *testing.T, config *map[string]any, tempDir, content string) string { + t.Helper() + + file, err := os.Create(filepath.Join(tempDir, "aws-sdk-go-base-shared-configuration-file")) + if err != nil { + t.Fatalf("creating shared configuration file: %s", err) + } + + _, err = file.WriteString(content) + if err != nil { + t.Fatalf(" writing shared configuration file: %s", err) + } + + if v, ok := (*config)[names.AttrSharedConfigFiles]; !ok { + (*config)[names.AttrSharedConfigFiles] = []any{file.Name()} + } else { + (*config)[names.AttrSharedConfigFiles] = append(v.([]any), file.Name()) + } + + return file.Name() +} diff --git a/internal/service/s3vectors/service_package_gen.go b/internal/service/s3vectors/service_package_gen.go new file mode 100644 index 000000000000..322b72386a78 --- /dev/null +++ b/internal/service/s3vectors/service_package_gen.go @@ -0,0 +1,88 @@ +// Code generated by internal/generate/servicepackage/main.go; DO NOT EDIT. + +package s3vectors + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/service/s3vectors" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/internal/vcr" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type servicePackage struct{} + +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*inttypes.ServicePackageFrameworkDataSource { + return []*inttypes.ServicePackageFrameworkDataSource{} +} + +func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.ServicePackageFrameworkResource { + return []*inttypes.ServicePackageFrameworkResource{} +} + +func (p *servicePackage) SDKDataSources(ctx context.Context) []*inttypes.ServicePackageSDKDataSource { + return []*inttypes.ServicePackageSDKDataSource{} +} + +func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePackageSDKResource { + return []*inttypes.ServicePackageSDKResource{} +} + +func (p *servicePackage) ServicePackageName() string { + return names.S3Vectors +} + +// NewClient returns a new AWS SDK for Go v2 client for this service package's AWS API. +func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (*s3vectors.Client, error) { + cfg := *(config["aws_sdkv2_config"].(*aws.Config)) + optFns := []func(*s3vectors.Options){ + s3vectors.WithEndpointResolverV2(newEndpointResolverV2()), + withBaseEndpoint(config[names.AttrEndpoint].(string)), + func(o *s3vectors.Options) { + if region := config[names.AttrRegion].(string); o.Region != region { + tflog.Info(ctx, "overriding provider-configured AWS API region", map[string]any{ + "service": p.ServicePackageName(), + "original_region": o.Region, + "override_region": region, + }) + o.Region = region + } + }, + func(o *s3vectors.Options) { + if inContext, ok := conns.FromContext(ctx); ok && inContext.VCREnabled() { + tflog.Info(ctx, "overriding retry behavior to immediately return VCR errors") + o.Retryer = conns.AddIsErrorRetryables(cfg.Retryer().(aws.RetryerV2), retry.IsErrorRetryableFunc(vcr.InteractionNotFoundRetryableFunc)) + } + }, + withExtraOptions(ctx, p, config), + } + + return s3vectors.NewFromConfig(cfg, optFns...), nil +} + +// withExtraOptions returns a functional option that allows this service package to specify extra API client options. +// This option is always called after any generated options. +func withExtraOptions(ctx context.Context, sp conns.ServicePackage, config map[string]any) func(*s3vectors.Options) { + if v, ok := sp.(interface { + withExtraOptions(context.Context, map[string]any) []func(*s3vectors.Options) + }); ok { + optFns := v.withExtraOptions(ctx, config) + + return func(o *s3vectors.Options) { + for _, optFn := range optFns { + optFn(o) + } + } + } + + return func(*s3vectors.Options) {} +} + +func ServicePackage(ctx context.Context) conns.ServicePackage { + return &servicePackage{} +} diff --git a/internal/service/sagemaker/device_fleet.go b/internal/service/sagemaker/device_fleet.go index 5f807aacb7a1..2192e12a11c8 100644 --- a/internal/service/sagemaker/device_fleet.go +++ b/internal/service/sagemaker/device_fleet.go @@ -114,7 +114,7 @@ func resourceDeviceFleetCreate(ctx context.Context, d *schema.ResourceData, meta input.Description = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func(ctx context.Context) (any, error) { return conn.CreateDeviceFleet(ctx, input) }, ErrCodeValidationException) if err != nil { diff --git a/internal/service/sagemaker/flow_definition.go b/internal/service/sagemaker/flow_definition.go index f52133ea08f7..1a359bed24a9 100644 --- a/internal/service/sagemaker/flow_definition.go +++ b/internal/service/sagemaker/flow_definition.go @@ -274,7 +274,7 @@ func resourceFlowDefinitionCreate(ctx context.Context, d *schema.ResourceData, m } log.Printf("[DEBUG] Creating SageMaker AI Flow Definition: %#v", input) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateFlowDefinition(ctx, input) }, ErrCodeValidationException) diff --git a/internal/service/sagemaker/image.go b/internal/service/sagemaker/image.go index 9c1bafbd181f..da1e9e1cd724 100644 --- a/internal/service/sagemaker/image.go +++ b/internal/service/sagemaker/image.go @@ -49,7 +49,7 @@ func resourceImage() *schema.Resource { ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z](-*[0-9A-Za-z])*$`), "Valid characters are a-z, A-Z, 0-9, and - (hyphen)."), + validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z]([-.]?[0-9A-Za-z])*$`), "Valid characters are a-z, A-Z, 0-9, - (hyphen), and . (dot)."), ), }, names.AttrRoleARN: { diff --git a/internal/service/sagemaker/model.go b/internal/service/sagemaker/model.go index c1df6adba83b..0f3588c90b6d 100644 --- a/internal/service/sagemaker/model.go +++ b/internal/service/sagemaker/model.go @@ -445,7 +445,7 @@ func resourceModelCreate(ctx context.Context, d *schema.ResourceData, meta any) } log.Printf("[DEBUG] SageMaker AI model create config: %#v", *createOpts) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func(ctx context.Context) (any, error) { return conn.CreateModel(ctx, createOpts) }, ErrCodeValidationException) diff --git a/internal/service/sagemaker/project.go b/internal/service/sagemaker/project.go index 8c6e0fae5202..094c1c290cc9 100644 --- a/internal/service/sagemaker/project.go +++ b/internal/service/sagemaker/project.go @@ -121,7 +121,7 @@ func resourceProjectCreate(ctx context.Context, d *schema.ResourceData, meta any input.ProjectDescription = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func(ctx context.Context) (any, error) { return conn.CreateProject(ctx, input) }, ErrCodeValidationException) if err != nil { diff --git a/internal/service/sagemaker/service_endpoint_resolver_gen.go b/internal/service/sagemaker/service_endpoint_resolver_gen.go index 59805710c056..bc7779c6046a 100644 --- a/internal/service/sagemaker/service_endpoint_resolver_gen.go +++ b/internal/service/sagemaker/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sagemaker.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sagemaker endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sagemaker endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index ad85533825ce..12646ba4423f 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sagemaker/servicecatalog_portfolio_status_identity_gen_test.go b/internal/service/sagemaker/servicecatalog_portfolio_status_identity_gen_test.go index a1bd1972eb4d..6513ab96cdc2 100644 --- a/internal/service/sagemaker/servicecatalog_portfolio_status_identity_gen_test.go +++ b/internal/service/sagemaker/servicecatalog_portfolio_status_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccSageMakerServicecatalogPortfolioStatus_Identity_Basic(t *testing.T) var v sagemaker.GetSagemakerServicecatalogPortfolioStatusOutput resourceName := "aws_sagemaker_servicecatalog_portfolio_status.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func testAccSageMakerServicecatalogPortfolioStatus_Identity_RegionOverride(t *te resourceName := "aws_sagemaker_servicecatalog_portfolio_status.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -223,7 +223,7 @@ func testAccSageMakerServicecatalogPortfolioStatus_Identity_ExistingResource(t * var v sagemaker.GetSagemakerServicecatalogPortfolioStatusOutput resourceName := "aws_sagemaker_servicecatalog_portfolio_status.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/sagemaker/user_profile.go b/internal/service/sagemaker/user_profile.go index 49975cc4b7b3..66e94cf659a6 100644 --- a/internal/service/sagemaker/user_profile.go +++ b/internal/service/sagemaker/user_profile.go @@ -78,7 +78,7 @@ func resourceUserProfile() *schema.Resource { ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(1, 63), - validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z](-*[0-9A-Za-z]){0,62}`), "Valid characters are a-z, A-Z, 0-9, and - (hyphen)."), + validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z](-*[0-9A-Za-z]){0,62}$`), "Valid characters are a-z, A-Z, 0-9, and - (hyphen)."), ), }, "user_settings": { diff --git a/internal/service/sagemaker/user_profile_identity_gen_test.go b/internal/service/sagemaker/user_profile_identity_gen_test.go index 0bcb3fbd9093..9271bde0f308 100644 --- a/internal/service/sagemaker/user_profile_identity_gen_test.go +++ b/internal/service/sagemaker/user_profile_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccSageMakerUserProfile_Identity_Basic(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -128,7 +128,7 @@ func testAccSageMakerUserProfile_Identity_RegionOverride(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -222,7 +222,7 @@ func testAccSageMakerUserProfile_Identity_ExistingResource(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/sagemaker/workteam.go b/internal/service/sagemaker/workteam.go index efb05ffe2a00..0ba7029f9782 100644 --- a/internal/service/sagemaker/workteam.go +++ b/internal/service/sagemaker/workteam.go @@ -206,7 +206,7 @@ func resourceWorkteamCreate(ctx context.Context, d *schema.ResourceData, meta an input.WorkforceName = aws.String(v.(string)) } - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func(ctx context.Context) (any, error) { return conn.CreateWorkteam(ctx, input) }, ErrCodeValidationException) diff --git a/internal/service/scheduler/service_endpoint_resolver_gen.go b/internal/service/scheduler/service_endpoint_resolver_gen.go index 17dae0750335..b2e5d62a0525 100644 --- a/internal/service/scheduler/service_endpoint_resolver_gen.go +++ b/internal/service/scheduler/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params scheduler.Endpoi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up scheduler endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up scheduler endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index f07d545e26bf..d4a4b4dfe8b0 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/schemas/service_endpoint_resolver_gen.go b/internal/service/schemas/service_endpoint_resolver_gen.go index 7168432f8af8..f8a8f3fe733d 100644 --- a/internal/service/schemas/service_endpoint_resolver_gen.go +++ b/internal/service/schemas/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params schemas.Endpoint }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up schemas endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up schemas endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index 81b8c5187c0f..fde853fd8979 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/secretsmanager/generate.go b/internal/service/secretsmanager/generate.go index a90febca32cf..1eed653fc132 100644 --- a/internal/service/secretsmanager/generate.go +++ b/internal/service/secretsmanager/generate.go @@ -4,6 +4,7 @@ //go:generate go run ../../generate/tags/main.go -ListTagsInIDElem=SecretId -ServiceTagsSlice -TagInIDElem=SecretId -UpdateTags //go:generate go run ../../generate/servicepackage/main.go //go:generate go run ../../generate/tagstests/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package secretsmanager diff --git a/internal/service/secretsmanager/secret.go b/internal/service/secretsmanager/secret.go index 99437232e8bf..70e53cbf1709 100644 --- a/internal/service/secretsmanager/secret.go +++ b/internal/service/secretsmanager/secret.go @@ -35,7 +35,9 @@ import ( // @SDKResource("aws_secretsmanager_secret", name="Secret") // @Tags(identifierAttribute="arn") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/secretsmanager;secretsmanager.DescribeSecretOutput") +// @Testing(preIdentityVersion="v6.8.0") // @Testing(importIgnore="force_overwrite_replica_secret;recovery_window_in_days") +// @ArnIdentity func resourceSecret() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSecretCreate, @@ -43,10 +45,6 @@ func resourceSecret() *schema.Resource { UpdateWithoutTimeout: resourceSecretUpdate, DeleteWithoutTimeout: resourceSecretDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ names.AttrARN: { Type: schema.TypeString, diff --git a/internal/service/secretsmanager/secret_data_source_tags_gen_test.go b/internal/service/secretsmanager/secret_data_source_tags_gen_test.go index 6a8264db86a6..3cd0b2e0e048 100644 --- a/internal/service/secretsmanager/secret_data_source_tags_gen_test.go +++ b/internal/service/secretsmanager/secret_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSecretsManagerSecretDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSecretsManagerSecretDataSource_tags(t *testing.T) { func TestAccSecretsManagerSecretDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSecretsManagerSecretDataSource_tags_NullMap(t *testing.T) { func TestAccSecretsManagerSecretDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSecretsManagerSecretDataSource_tags_EmptyMap(t *testing.T) { func TestAccSecretsManagerSecretDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSecretsManagerSecretDataSource_tags_DefaultTags_nonOverlapping(t *te func TestAccSecretsManagerSecretDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSecretsManagerSecretDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccSecretsManagerSecretDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/secretsmanager/secret_identity_gen_test.go b/internal/service/secretsmanager/secret_identity_gen_test.go new file mode 100644 index 000000000000..a8a2b5cead5c --- /dev/null +++ b/internal/service/secretsmanager/secret_identity_gen_test.go @@ -0,0 +1,302 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package secretsmanager_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSecretsManagerSecret_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.DescribeSecretOutput + resourceName := "aws_secretsmanager_secret.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_overwrite_replica_secret", "recovery_window_in_days", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccSecretsManagerSecret_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_secretsmanager_secret.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_overwrite_replica_secret", "recovery_window_in_days", + }, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_overwrite_replica_secret", "recovery_window_in_days", + }, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSecretsManagerSecret_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.DescribeSecretOutput + resourceName := "aws_secretsmanager_secret.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Secret/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/secretsmanager/secret_policy.go b/internal/service/secretsmanager/secret_policy.go index b12dcdec346f..e4071f7f9aad 100644 --- a/internal/service/secretsmanager/secret_policy.go +++ b/internal/service/secretsmanager/secret_policy.go @@ -24,6 +24,9 @@ import ( ) // @SDKResource("aws_secretsmanager_secret_policy", name="Secret Policy") +// @ArnIdentity("secret_arn") +// @Testing(preIdentityVersion="v6.8.0") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/secretsmanager;secretsmanager.GetResourcePolicyOutput") func resourceSecretPolicy() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSecretPolicyCreate, @@ -31,10 +34,6 @@ func resourceSecretPolicy() *schema.Resource { UpdateWithoutTimeout: resourceSecretPolicyUpdate, DeleteWithoutTimeout: resourceSecretPolicyDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ "block_public_policy": { Type: schema.TypeBool, diff --git a/internal/service/secretsmanager/secret_policy_identity_gen_test.go b/internal/service/secretsmanager/secret_policy_identity_gen_test.go new file mode 100644 index 000000000000..4ec75f6f75bf --- /dev/null +++ b/internal/service/secretsmanager/secret_policy_identity_gen_test.go @@ -0,0 +1,283 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package secretsmanager_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSecretsManagerSecretPolicy_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.GetResourcePolicyOutput + resourceName := "aws_secretsmanager_secret_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretPolicyExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("secret_arn"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_arn": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_arn")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_arn"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_arn"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccSecretsManagerSecretPolicy_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_secretsmanager_secret_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("secret_arn"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_arn": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_arn")), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_arn"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_arn"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_arn"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSecretsManagerSecretPolicy_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.GetResourcePolicyOutput + resourceName := "aws_secretsmanager_secret_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretPolicyDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretPolicyExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SecretPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_arn": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_arn")), + }, + }, + }, + }) +} diff --git a/internal/service/secretsmanager/secret_rotation.go b/internal/service/secretsmanager/secret_rotation.go index 8e8e71cb1675..46c88406455a 100644 --- a/internal/service/secretsmanager/secret_rotation.go +++ b/internal/service/secretsmanager/secret_rotation.go @@ -24,6 +24,10 @@ import ( ) // @SDKResource("aws_secretsmanager_secret_rotation", name="Secret Rotation") +// @ArnIdentity("secret_id") +// @Testing(preIdentityVersion="v6.8.0") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/secretsmanager;secretsmanager.DescribeSecretOutput") +// @Testing(importIgnore="rotate_immediately") func resourceSecretRotation() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSecretRotationCreate, @@ -31,10 +35,6 @@ func resourceSecretRotation() *schema.Resource { UpdateWithoutTimeout: resourceSecretRotationUpdate, DeleteWithoutTimeout: resourceSecretRotationDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, StateUpgraders: []schema.StateUpgrader{ { @@ -113,7 +113,7 @@ func resourceSecretRotationCreate(ctx context.Context, d *schema.ResourceData, m } // AccessDeniedException: Secrets Manager cannot invoke the specified Lambda function. - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 1*time.Minute, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 1*time.Minute, func(ctx context.Context) (any, error) { return conn.RotateSecret(ctx, input) }, "AccessDeniedException") @@ -176,7 +176,7 @@ func resourceSecretRotationUpdate(ctx context.Context, d *schema.ResourceData, m } // AccessDeniedException: Secrets Manager cannot invoke the specified Lambda function. - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 1*time.Minute, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 1*time.Minute, func(ctx context.Context) (any, error) { return conn.RotateSecret(ctx, input) }, "AccessDeniedException", "InvalidRequestException") diff --git a/internal/service/secretsmanager/secret_rotation_identity_gen_test.go b/internal/service/secretsmanager/secret_rotation_identity_gen_test.go new file mode 100644 index 000000000000..21adc550dcb9 --- /dev/null +++ b/internal/service/secretsmanager/secret_rotation_identity_gen_test.go @@ -0,0 +1,302 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package secretsmanager_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSecretsManagerSecretRotation_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.DescribeSecretOutput + resourceName := "aws_secretsmanager_secret_rotation.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretRotationDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretRotationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("secret_id"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_id": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_id")), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "rotate_immediately", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccSecretsManagerSecretRotation_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_secretsmanager_secret_rotation.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New("secret_id"), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_id": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_id")), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "rotate_immediately", + }, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "rotate_immediately", + }, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("secret_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSecretsManagerSecretRotation_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v secretsmanager.DescribeSecretOutput + resourceName := "aws_secretsmanager_secret_rotation.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SecretsManagerServiceID), + CheckDestroy: testAccCheckSecretRotationDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckSecretRotationExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SecretRotation/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + "secret_id": knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New("secret_id")), + }, + }, + }, + }) +} diff --git a/internal/service/secretsmanager/secret_tags_gen_test.go b/internal/service/secretsmanager/secret_tags_gen_test.go index 00304c28c979..503b16f982d9 100644 --- a/internal/service/secretsmanager/secret_tags_gen_test.go +++ b/internal/service/secretsmanager/secret_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccSecretsManagerSecret_tags(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccSecretsManagerSecret_tags(t *testing.T) { func TestAccSecretsManagerSecret_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccSecretsManagerSecret_tags_null(t *testing.T) { func TestAccSecretsManagerSecret_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccSecretsManagerSecret_tags_EmptyMap(t *testing.T) { func TestAccSecretsManagerSecret_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccSecretsManagerSecret_tags_AddOnUpdate(t *testing.T) { func TestAccSecretsManagerSecret_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccSecretsManagerSecret_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSecretsManagerSecret_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccSecretsManagerSecret_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSecretsManagerSecret_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccSecretsManagerSecret_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSecretsManagerSecret_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSecretsManagerSecret_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSecretsManagerSecret_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSecretsManagerSecret_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccSecretsManagerSecret_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccSecretsManagerSecret_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccSecretsManagerSecret_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccSecretsManagerSecret_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccSecretsManagerSecret_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccSecretsManagerSecret_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccSecretsManagerSecret_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccSecretsManagerSecret_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSecretsManagerSecret_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccSecretsManagerSecret_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSecretsManagerSecret_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccSecretsManagerSecret_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccSecretsManagerSecret_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccSecretsManagerSecret_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccSecretsManagerSecret_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v secretsmanager.DescribeSecretOutput resourceName := "aws_secretsmanager_secret.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/secretsmanager/service_endpoint_resolver_gen.go b/internal/service/secretsmanager/service_endpoint_resolver_gen.go index 41ea6fde8b01..2ef0c39780ca 100644 --- a/internal/service/secretsmanager/service_endpoint_resolver_gen.go +++ b/internal/service/secretsmanager/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params secretsmanager.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up secretsmanager endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up secretsmanager endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index 223699aef5d5..46e5ebee758e 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/secretsmanager/service_package_gen.go b/internal/service/secretsmanager/service_package_gen.go index 683f9b9c3d2f..c96633c4a540 100644 --- a/internal/service/secretsmanager/service_package_gen.go +++ b/internal/service/secretsmanager/service_package_gen.go @@ -98,18 +98,36 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrARN, }), Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceSecretPolicy, TypeName: "aws_secretsmanager_secret_policy", Name: "Secret Policy", Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentityNamed("secret_arn", + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceSecretRotation, TypeName: "aws_secretsmanager_secret_rotation", Name: "Secret Rotation", Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentityNamed("secret_id", + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceSecretVersion, diff --git a/internal/service/secretsmanager/testdata/Secret/basic/main_gen.tf b/internal/service/secretsmanager/testdata/Secret/basic/main_gen.tf new file mode 100644 index 000000000000..054c39ce7a93 --- /dev/null +++ b/internal/service/secretsmanager/testdata/Secret/basic/main_gen.tf @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/Secret/basic_v6.8.0/main_gen.tf b/internal/service/secretsmanager/testdata/Secret/basic_v6.8.0/main_gen.tf new file mode 100644 index 000000000000..4c3fd98e435e --- /dev/null +++ b/internal/service/secretsmanager/testdata/Secret/basic_v6.8.0/main_gen.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.8.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/secretsmanager/testdata/Secret/region_override/main_gen.tf b/internal/service/secretsmanager/testdata/Secret/region_override/main_gen.tf new file mode 100644 index 000000000000..cd074c4983aa --- /dev/null +++ b/internal/service/secretsmanager/testdata/Secret/region_override/main_gen.tf @@ -0,0 +1,20 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret" "test" { + region = var.region + + name = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/SecretPolicy/basic/main_gen.tf b/internal/service/secretsmanager/testdata/SecretPolicy/basic/main_gen.tf new file mode 100644 index 000000000000..a2198c371dcf --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretPolicy/basic/main_gen.tf @@ -0,0 +1,30 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_policy" "test" { + secret_arn = aws_secretsmanager_secret.test.arn + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Sid = "EnableAllPermissions" + Effect = "Allow" + Principal = { + AWS = "*" + } + Action = "secretsmanager:GetSecretValue" + Resource = "*" + }] + }) +} + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/SecretPolicy/basic_v6.8.0/main_gen.tf b/internal/service/secretsmanager/testdata/SecretPolicy/basic_v6.8.0/main_gen.tf new file mode 100644 index 000000000000..ce90b4b87248 --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretPolicy/basic_v6.8.0/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_policy" "test" { + secret_arn = aws_secretsmanager_secret.test.arn + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Sid = "EnableAllPermissions" + Effect = "Allow" + Principal = { + AWS = "*" + } + Action = "secretsmanager:GetSecretValue" + Resource = "*" + }] + }) +} + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.8.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/secretsmanager/testdata/SecretPolicy/region_override/main_gen.tf b/internal/service/secretsmanager/testdata/SecretPolicy/region_override/main_gen.tf new file mode 100644 index 000000000000..64e35d2db90a --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretPolicy/region_override/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_policy" "test" { + region = var.region + + secret_arn = aws_secretsmanager_secret.test.arn + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Sid = "EnableAllPermissions" + Effect = "Allow" + Principal = { + AWS = "*" + } + Action = "secretsmanager:GetSecretValue" + Resource = "*" + }] + }) +} + +resource "aws_secretsmanager_secret" "test" { + region = var.region + + name = var.rName +} + + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/SecretRotation/basic/main_gen.tf b/internal/service/secretsmanager/testdata/SecretRotation/basic/main_gen.tf new file mode 100644 index 000000000000..0e19bc1763c5 --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretRotation/basic/main_gen.tf @@ -0,0 +1,85 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_rotation" "test" { + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test.arn + + rotation_rules { + automatically_after_days = 7 + } + + depends_on = [aws_lambda_permission.test] +} + +data "aws_partition" "current" { +} + +resource "aws_iam_role" "test" { + name = var.rName + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "lambda.amazonaws.com" + } + }] + }) +} + +resource "aws_iam_role_policy" "test" { + name = var.rName + role = aws_iam_role.test.id + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue", + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecretVersionStage", + ] + Effect = "Allow" + Resource = aws_secretsmanager_secret.test.arn + }] + }) +} + +resource "aws_iam_role_policy_attachment" "test" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + role = aws_iam_role.test.name +} + +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = var.rName + handler = "exports.example" + role = aws_iam_role.test.arn + runtime = "nodejs20.x" +} + +resource "aws_lambda_permission" "test" { + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" +} + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + +resource "aws_secretsmanager_secret_version" "test" { + secret_id = aws_secretsmanager_secret.test.id + secret_string = "test-string" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/SecretRotation/basic_v6.8.0/main_gen.tf b/internal/service/secretsmanager/testdata/SecretRotation/basic_v6.8.0/main_gen.tf new file mode 100644 index 000000000000..06c70e9db689 --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretRotation/basic_v6.8.0/main_gen.tf @@ -0,0 +1,95 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_rotation" "test" { + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test.arn + + rotation_rules { + automatically_after_days = 7 + } + + depends_on = [aws_lambda_permission.test] +} + +data "aws_partition" "current" { +} + +resource "aws_iam_role" "test" { + name = var.rName + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "lambda.amazonaws.com" + } + }] + }) +} + +resource "aws_iam_role_policy" "test" { + name = var.rName + role = aws_iam_role.test.id + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue", + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecretVersionStage", + ] + Effect = "Allow" + Resource = aws_secretsmanager_secret.test.arn + }] + }) +} + +resource "aws_iam_role_policy_attachment" "test" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + role = aws_iam_role.test.name +} + +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = var.rName + handler = "exports.example" + role = aws_iam_role.test.arn + runtime = "nodejs20.x" +} + +resource "aws_lambda_permission" "test" { + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" +} + +resource "aws_secretsmanager_secret" "test" { + name = var.rName +} + +resource "aws_secretsmanager_secret_version" "test" { + secret_id = aws_secretsmanager_secret.test.id + secret_string = "test-string" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.8.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/secretsmanager/testdata/SecretRotation/region_override/main_gen.tf b/internal/service/secretsmanager/testdata/SecretRotation/region_override/main_gen.tf new file mode 100644 index 000000000000..3e9df6d639bb --- /dev/null +++ b/internal/service/secretsmanager/testdata/SecretRotation/region_override/main_gen.tf @@ -0,0 +1,101 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_secretsmanager_secret_rotation" "test" { + region = var.region + + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test.arn + + rotation_rules { + automatically_after_days = 7 + } + + depends_on = [aws_lambda_permission.test] +} + +data "aws_partition" "current" { +} + +resource "aws_iam_role" "test" { + name = var.rName + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "lambda.amazonaws.com" + } + }] + }) +} + +resource "aws_iam_role_policy" "test" { + name = var.rName + role = aws_iam_role.test.id + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue", + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecretVersionStage", + ] + Effect = "Allow" + Resource = aws_secretsmanager_secret.test.arn + }] + }) +} + +resource "aws_iam_role_policy_attachment" "test" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + role = aws_iam_role.test.name +} + +resource "aws_lambda_function" "test" { + region = var.region + + filename = "test-fixtures/lambdatest.zip" + function_name = var.rName + handler = "exports.example" + role = aws_iam_role.test.arn + runtime = "nodejs20.x" +} + +resource "aws_lambda_permission" "test" { + region = var.region + + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" +} + +resource "aws_secretsmanager_secret" "test" { + region = var.region + + name = var.rName +} + +resource "aws_secretsmanager_secret_version" "test" { + region = var.region + + secret_id = aws_secretsmanager_secret.test.id + secret_string = "test-string" +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/secretsmanager/testdata/tmpl/secret_policy_tags.gtpl b/internal/service/secretsmanager/testdata/tmpl/secret_policy_tags.gtpl new file mode 100644 index 000000000000..e564687934d8 --- /dev/null +++ b/internal/service/secretsmanager/testdata/tmpl/secret_policy_tags.gtpl @@ -0,0 +1,23 @@ +resource "aws_secretsmanager_secret_policy" "test" { +{{- template "region" }} + secret_arn = aws_secretsmanager_secret.test.arn + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Sid = "EnableAllPermissions" + Effect = "Allow" + Principal = { + AWS = "*" + } + Action = "secretsmanager:GetSecretValue" + Resource = "*" + }] + }) +} + +resource "aws_secretsmanager_secret" "test" { +{{- template "region" }} + name = var.rName +} + diff --git a/internal/service/secretsmanager/testdata/tmpl/secret_rotation_tags.gtpl b/internal/service/secretsmanager/testdata/tmpl/secret_rotation_tags.gtpl new file mode 100644 index 000000000000..371c71adbbd9 --- /dev/null +++ b/internal/service/secretsmanager/testdata/tmpl/secret_rotation_tags.gtpl @@ -0,0 +1,81 @@ +resource "aws_secretsmanager_secret_rotation" "test" { +{{- template "region" }} + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test.arn + + rotation_rules { + automatically_after_days = 7 + } + + depends_on = [aws_lambda_permission.test] +} + +data "aws_partition" "current" { +} + +resource "aws_iam_role" "test" { + name = var.rName + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "lambda.amazonaws.com" + } + }] + }) +} + +resource "aws_iam_role_policy" "test" { + name = var.rName + role = aws_iam_role.test.id + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue", + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecretVersionStage", + ] + Effect = "Allow" + Resource = aws_secretsmanager_secret.test.arn + }] + }) +} + +resource "aws_iam_role_policy_attachment" "test" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + role = aws_iam_role.test.name +} + +resource "aws_lambda_function" "test" { +{{- template "region" }} + filename = "test-fixtures/lambdatest.zip" + function_name = var.rName + handler = "exports.example" + role = aws_iam_role.test.arn + runtime = "nodejs20.x" +} + +resource "aws_lambda_permission" "test" { +{{- template "region" }} + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" +} + +resource "aws_secretsmanager_secret" "test" { +{{- template "region" }} + name = var.rName +} + +resource "aws_secretsmanager_secret_version" "test" { +{{- template "region" }} + secret_id = aws_secretsmanager_secret.test.id + secret_string = "test-string" +} diff --git a/internal/service/secretsmanager/testdata/tmpl/secret_tags.gtpl b/internal/service/secretsmanager/testdata/tmpl/secret_tags.gtpl index 44f92d6ad62e..3e1e7624d0dd 100644 --- a/internal/service/secretsmanager/testdata/tmpl/secret_tags.gtpl +++ b/internal/service/secretsmanager/testdata/tmpl/secret_tags.gtpl @@ -1,4 +1,5 @@ resource "aws_secretsmanager_secret" "test" { +{{- template "region" }} name = var.rName {{- template "tags" . }} diff --git a/internal/service/securityhub/account.go b/internal/service/securityhub/account.go index 7fa8ee2fd51c..eef020e2cb43 100644 --- a/internal/service/securityhub/account.go +++ b/internal/service/securityhub/account.go @@ -181,7 +181,7 @@ func resourceAccountDelete(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).SecurityHubClient(ctx) log.Printf("[DEBUG] Deleting Security Hub Account: %s", d.Id()) - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, adminAccountDeletedTimeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, adminAccountDeletedTimeout, func(ctx context.Context) (any, error) { return conn.DisableSecurityHub(ctx, &securityhub.DisableSecurityHubInput{}) }, errCodeInvalidInputException, "Cannot disable Security Hub on the Security Hub administrator") diff --git a/internal/service/securityhub/automation_rule.go b/internal/service/securityhub/automation_rule.go index 314f8d9c56d5..a790e1f208b1 100644 --- a/internal/service/securityhub/automation_rule.go +++ b/internal/service/securityhub/automation_rule.go @@ -37,6 +37,7 @@ import ( // @ArnIdentity(identityDuplicateAttributes="id") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/securityhub/types;awstypes;awstypes.AutomationRulesConfig") // @Testing(serialize=true) +// @Testing(preIdentityVersion="v5.100.0") func newAutomationRuleResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &automationRuleResource{}, nil } diff --git a/internal/service/securityhub/automation_rule_identity_gen_test.go b/internal/service/securityhub/automation_rule_identity_gen_test.go index 4b07853a6c49..97bd71520038 100644 --- a/internal/service/securityhub/automation_rule_identity_gen_test.go +++ b/internal/service/securityhub/automation_rule_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccSecurityHubAutomationRule_Identity_Basic(t *testing.T) { resourceName := "aws_securityhub_automation_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -124,7 +124,7 @@ func testAccSecurityHubAutomationRule_Identity_RegionOverride(t *testing.T) { resourceName := "aws_securityhub_automation_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -245,7 +245,7 @@ func testAccSecurityHubAutomationRule_Identity_ExistingResource(t *testing.T) { resourceName := "aws_securityhub_automation_rule.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/securityhub/organization_admin_account.go b/internal/service/securityhub/organization_admin_account.go index 03068c055446..2415aef6d762 100644 --- a/internal/service/securityhub/organization_admin_account.go +++ b/internal/service/securityhub/organization_admin_account.go @@ -57,7 +57,7 @@ func resourceOrganizationAdminAccountCreate(ctx context.Context, d *schema.Resou const ( timeout = 2 * time.Minute ) - _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, timeout, func(ctx context.Context) (any, error) { return conn.EnableOrganizationAdminAccount(ctx, input) }, errCodeResourceConflictException) diff --git a/internal/service/securityhub/organization_configuration.go b/internal/service/securityhub/organization_configuration.go index a17b9def3be5..55ba2861bf43 100644 --- a/internal/service/securityhub/organization_configuration.go +++ b/internal/service/securityhub/organization_configuration.go @@ -93,7 +93,7 @@ func resourceOrganizationConfigurationUpdate(ctx context.Context, d *schema.Reso } // e.g. "DataUnavailableException: Central configuration couldn't be enabled because data from organization o-ira6i4k380 is still syncing. Retry later." - _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateOrganizationConfiguration(ctx, input) }, errCodeDataUnavailableException, "Retry later") diff --git a/internal/service/securityhub/service_endpoint_resolver_gen.go b/internal/service/securityhub/service_endpoint_resolver_gen.go index 0df275daeb97..fc23da696d12 100644 --- a/internal/service/securityhub/service_endpoint_resolver_gen.go +++ b/internal/service/securityhub/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params securityhub.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up securityhub endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up securityhub endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index db311162d392..380b6941b96a 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/securitylake/data_lake.go b/internal/service/securitylake/data_lake.go index 25efbad5677b..fdaf200cbd7b 100644 --- a/internal/service/securitylake/data_lake.go +++ b/internal/service/securitylake/data_lake.go @@ -585,7 +585,7 @@ func retryDataLakeConflictWithMutex[T any](ctx context.Context, f func() (T, err const dataLakeTimeout = 2 * time.Minute - raw, err := tfresource.RetryWhenIsA[*awstypes.ConflictException](ctx, dataLakeTimeout, func() (any, error) { + raw, err := tfresource.RetryWhenIsA[any, *awstypes.ConflictException](ctx, dataLakeTimeout, func(ctx context.Context) (any, error) { return f() }) if err != nil { diff --git a/internal/service/securitylake/service_endpoint_resolver_gen.go b/internal/service/securitylake/service_endpoint_resolver_gen.go index 778dbe064603..d094f2b3d973 100644 --- a/internal/service/securitylake/service_endpoint_resolver_gen.go +++ b/internal/service/securitylake/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params securitylake.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up securitylake endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up securitylake endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index c26cf6747109..6ce173c3c796 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/serverlessrepo/service_endpoint_resolver_gen.go b/internal/service/serverlessrepo/service_endpoint_resolver_gen.go index 1425a6a4ad4d..2b372654ed1a 100644 --- a/internal/service/serverlessrepo/service_endpoint_resolver_gen.go +++ b/internal/service/serverlessrepo/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params serverlessapplic }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up serverlessapplicationrepository endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up serverlessapplicationrepository endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index 19ee8ee7ac4c..3d31b0e9df9e 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -678,7 +678,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/servicecatalog/portfolio_data_source_tags_gen_test.go b/internal/service/servicecatalog/portfolio_data_source_tags_gen_test.go index 4b302a15a3db..e353ec4611d0 100644 --- a/internal/service/servicecatalog/portfolio_data_source_tags_gen_test.go +++ b/internal/service/servicecatalog/portfolio_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccServiceCatalogPortfolioDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccServiceCatalogPortfolioDataSource_tags(t *testing.T) { func TestAccServiceCatalogPortfolioDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccServiceCatalogPortfolioDataSource_tags_NullMap(t *testing.T) { func TestAccServiceCatalogPortfolioDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccServiceCatalogPortfolioDataSource_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogPortfolioDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccServiceCatalogPortfolioDataSource_tags_DefaultTags_nonOverlapping(t func TestAccServiceCatalogPortfolioDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccServiceCatalogPortfolioDataSource_tags_IgnoreTags_Overlap_DefaultTag func TestAccServiceCatalogPortfolioDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalog/portfolio_tags_gen_test.go b/internal/service/servicecatalog/portfolio_tags_gen_test.go index a85052e5c3f8..4f6a2c98b53e 100644 --- a/internal/service/servicecatalog/portfolio_tags_gen_test.go +++ b/internal/service/servicecatalog/portfolio_tags_gen_test.go @@ -24,6 +24,7 @@ import ( func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -206,6 +207,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -273,6 +275,7 @@ func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { func TestAccServiceCatalogPortfolio_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -336,6 +339,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -419,6 +423,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Portfolio does not support empty tags") ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -510,6 +515,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Portfolio does not support empty tags") ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -649,6 +655,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) t.Skip("Resource Portfolio does not support empty tags") ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -738,6 +745,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -919,6 +927,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1079,6 +1088,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1255,6 +1265,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1345,6 +1356,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1436,6 +1448,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing t.Skip("Resource Portfolio does not support empty tags") ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1503,6 +1516,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyProviderOnlyTag(t *tes t.Skip("Resource Portfolio does not support empty tags") ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1560,6 +1574,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyProviderOnlyTag(t *tes func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1622,6 +1637,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1684,6 +1700,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1739,6 +1756,7 @@ func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1836,6 +1854,7 @@ func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnUpdate_Add(t *testing.T) func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -1923,6 +1942,7 @@ func TestAccServiceCatalogPortfolio_tags_ComputedTag_OnUpdate_Replace(t *testing func TestAccServiceCatalogPortfolio_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) @@ -2085,6 +2105,7 @@ func TestAccServiceCatalogPortfolio_tags_IgnoreTags_Overlap_DefaultTag(t *testin func TestAccServiceCatalogPortfolio_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalog.DescribePortfolioOutput resourceName := "aws_servicecatalog_portfolio.test" rName := sdkacctest.RandString(5) diff --git a/internal/service/servicecatalog/product_data_source_tags_gen_test.go b/internal/service/servicecatalog/product_data_source_tags_gen_test.go index bb43734aedc1..59558e44eee6 100644 --- a/internal/service/servicecatalog/product_data_source_tags_gen_test.go +++ b/internal/service/servicecatalog/product_data_source_tags_gen_test.go @@ -21,6 +21,7 @@ import ( func TestAccServiceCatalogProductDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccServiceCatalogProductDataSource_tags(t *testing.T) { func TestAccServiceCatalogProductDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -73,6 +75,7 @@ func TestAccServiceCatalogProductDataSource_tags_NullMap(t *testing.T) { func TestAccServiceCatalogProductDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -97,6 +100,7 @@ func TestAccServiceCatalogProductDataSource_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogProductDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -129,6 +133,7 @@ func TestAccServiceCatalogProductDataSource_tags_DefaultTags_nonOverlapping(t *t func TestAccServiceCatalogProductDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -167,6 +172,7 @@ func TestAccServiceCatalogProductDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccServiceCatalogProductDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalog/product_tags_gen_test.go b/internal/service/servicecatalog/product_tags_gen_test.go index 4912d0fbff2a..96dc93e27bf2 100644 --- a/internal/service/servicecatalog/product_tags_gen_test.go +++ b/internal/service/servicecatalog/product_tags_gen_test.go @@ -22,6 +22,7 @@ import ( func TestAccServiceCatalogProduct_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -215,6 +216,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { func TestAccServiceCatalogProduct_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -284,6 +286,7 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { func TestAccServiceCatalogProduct_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -349,6 +352,7 @@ func TestAccServiceCatalogProduct_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -434,6 +438,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Product does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -530,6 +535,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Product does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -674,6 +680,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Product does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -765,6 +772,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -957,6 +965,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1125,6 +1134,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1401,6 +1412,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T t.Skip("Resource Product does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1563,6 +1576,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyProviderOnlyTag(t *testi t.Skip("Resource Product does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1686,6 +1701,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1750,6 +1766,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccServiceCatalogProduct_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1807,6 +1824,7 @@ func TestAccServiceCatalogProduct_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccServiceCatalogProduct_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1906,6 +1924,7 @@ func TestAccServiceCatalogProduct_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccServiceCatalogProduct_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1995,6 +2014,7 @@ func TestAccServiceCatalogProduct_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccServiceCatalogProduct_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2156,6 +2176,7 @@ func TestAccServiceCatalogProduct_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccServiceCatalogProduct_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalog_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalog/provisioned_product_tags_gen_test.go b/internal/service/servicecatalog/provisioned_product_tags_gen_test.go index 747b355d88e2..9b7fd5ad543a 100644 --- a/internal/service/servicecatalog/provisioned_product_tags_gen_test.go +++ b/internal/service/servicecatalog/provisioned_product_tags_gen_test.go @@ -23,6 +23,7 @@ import ( func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -221,6 +222,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -291,6 +293,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { func TestAccServiceCatalogProvisionedProduct_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -357,6 +360,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -443,6 +447,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T t.Skip("Resource ProvisionedProduct does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -540,6 +545,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi t.Skip("Resource ProvisionedProduct does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -685,6 +691,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t t.Skip("Resource ProvisionedProduct does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -777,6 +784,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -974,6 +982,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1145,6 +1154,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1330,6 +1340,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1423,6 +1434,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1517,6 +1529,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t t.Skip("Resource ProvisionedProduct does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1587,6 +1600,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyProviderOnlyT t.Skip("Resource ProvisionedProduct does not support empty tags") ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1647,6 +1661,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyProviderOnlyT func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1712,6 +1727,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1777,6 +1793,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1835,6 +1852,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnCreate(t *testin func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1935,6 +1953,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnUpdate_Add(t *te func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2025,6 +2044,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_ComputedTag_OnUpdate_Replace(t func TestAccServiceCatalogProvisionedProduct_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2187,6 +2207,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_IgnoreTags_Overlap_DefaultTag( func TestAccServiceCatalogProvisionedProduct_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.ProvisionedProductDetail resourceName := "aws_servicecatalog_provisioned_product.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalog/service_endpoint_resolver_gen.go b/internal/service/servicecatalog/service_endpoint_resolver_gen.go index 2bb71adfe74a..0d54ece32b50 100644 --- a/internal/service/servicecatalog/service_endpoint_resolver_gen.go +++ b/internal/service/servicecatalog/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params servicecatalog.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up servicecatalog endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up servicecatalog endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index 5558bede9de2..eae203f9cff8 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/servicecatalogappregistry/application_data_source_tags_gen_test.go b/internal/service/servicecatalogappregistry/application_data_source_tags_gen_test.go index 0d9042d1996f..d86b140550ec 100644 --- a/internal/service/servicecatalogappregistry/application_data_source_tags_gen_test.go +++ b/internal/service/servicecatalogappregistry/application_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccServiceCatalogAppRegistryApplicationDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccServiceCatalogAppRegistryApplicationDataSource_tags(t *testing.T) { func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_NullMap(t *testi func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_EmptyMap(t *test func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_DefaultTags_nonO func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_IgnoreTags_Overl func TestAccServiceCatalogAppRegistryApplicationDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalogappregistry/application_tags_gen_test.go b/internal/service/servicecatalogappregistry/application_tags_gen_test.go index 29601d84c02b..ffa1845339e9 100644 --- a/internal/service/servicecatalogappregistry/application_tags_gen_test.go +++ b/internal/service/servicecatalogappregistry/application_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccServiceCatalogAppRegistryApplication_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags(t *testing.T) { func TestAccServiceCatalogAppRegistryApplication_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -259,6 +261,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_null(t *testing.T) { func TestAccServiceCatalogAppRegistryApplication_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -308,6 +311,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_EmptyMap(t *testing.T) { func TestAccServiceCatalogAppRegistryApplication_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -387,6 +391,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_AddOnUpdate(t *testing.T) func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -476,6 +481,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnCreate(t *testi func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -614,6 +620,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnUpdate_Add(t *t func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -703,6 +710,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_EmptyTag_OnUpdate_Replace( func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -883,6 +891,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_providerOnly(t func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1042,6 +1051,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nonOverlapping func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1217,6 +1227,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_overlapping(t func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1306,6 +1317,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_updateToProvid func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1394,6 +1406,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_updateToResour func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1459,6 +1472,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_emptyResourceT func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1516,6 +1530,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_emptyProviderO func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1584,6 +1599,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nullOverlappin func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1670,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_DefaultTags_nullNonOverlap func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1708,6 +1725,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnCreate(t *te func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1804,6 +1822,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnUpdate_Add(t func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1890,6 +1909,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_ComputedTag_OnUpdate_Repla func TestAccServiceCatalogAppRegistryApplication_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2051,6 +2071,7 @@ func TestAccServiceCatalogAppRegistryApplication_tags_IgnoreTags_Overlap_Default func TestAccServiceCatalogAppRegistryApplication_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_servicecatalogappregistry_application.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalogappregistry/attribute_group_data_source_tags_gen_test.go b/internal/service/servicecatalogappregistry/attribute_group_data_source_tags_gen_test.go index acea4aec14fd..ba13fbefea05 100644 --- a/internal/service/servicecatalogappregistry/attribute_group_data_source_tags_gen_test.go +++ b/internal/service/servicecatalogappregistry/attribute_group_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags(t *testing.T) func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_NullMap(t *te func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_EmptyMap(t *t func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_DefaultTags_n func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_IgnoreTags_Ov func TestAccServiceCatalogAppRegistryAttributeGroupDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalogappregistry/attribute_group_tags_gen_test.go b/internal/service/servicecatalogappregistry/attribute_group_tags_gen_test.go index a8a966f053c2..a6c5be1c3428 100644 --- a/internal/service/servicecatalogappregistry/attribute_group_tags_gen_test.go +++ b/internal/service/servicecatalogappregistry/attribute_group_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccServiceCatalogAppRegistryAttributeGroup_tags(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags(t *testing.T) { func TestAccServiceCatalogAppRegistryAttributeGroup_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_null(t *testing.T) { func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyMap(t *testing.T) func TestAccServiceCatalogAppRegistryAttributeGroup_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_AddOnUpdate(t *testing. func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnCreate(t *te func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnUpdate_Add(t func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_EmptyTag_OnUpdate_Repla func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_providerOnl func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nonOverlapp func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_overlapping func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_updateToPro func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_updateToRes func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_emptyResour func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_emptyProvid func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nullOverlap func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_DefaultTags_nullNonOver func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnCreate(t func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnUpdate_Ad func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_ComputedTag_OnUpdate_Re func TestAccServiceCatalogAppRegistryAttributeGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccServiceCatalogAppRegistryAttributeGroup_tags_IgnoreTags_Overlap_Defa func TestAccServiceCatalogAppRegistryAttributeGroup_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v servicecatalogappregistry.GetAttributeGroupOutput resourceName := "aws_servicecatalogappregistry_attribute_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/servicecatalogappregistry/service_endpoint_resolver_gen.go b/internal/service/servicecatalogappregistry/service_endpoint_resolver_gen.go index f83021f4124b..f5b5ee8b8eaa 100644 --- a/internal/service/servicecatalogappregistry/service_endpoint_resolver_gen.go +++ b/internal/service/servicecatalogappregistry/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params servicecatalogap }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up servicecatalogappregistry endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up servicecatalogappregistry endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index b6dd634bc4e6..19bd9d786181 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/servicediscovery/http_namespace.go b/internal/service/servicediscovery/http_namespace.go index 71c4dd1b7a14..7f608f4a9964 100644 --- a/internal/service/servicediscovery/http_namespace.go +++ b/internal/service/servicediscovery/http_namespace.go @@ -138,7 +138,7 @@ func resourceHTTPNamespaceDelete(ctx context.Context, d *schema.ResourceData, me const ( timeout = 2 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.ResourceInUse](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.ResourceInUse](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteNamespace(ctx, &servicediscovery.DeleteNamespaceInput{ Id: aws.String(d.Id()), }) diff --git a/internal/service/servicediscovery/service_endpoint_resolver_gen.go b/internal/service/servicediscovery/service_endpoint_resolver_gen.go index fd594064d493..082187efb41b 100644 --- a/internal/service/servicediscovery/service_endpoint_resolver_gen.go +++ b/internal/service/servicediscovery/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params servicediscovery }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up servicediscovery endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up servicediscovery endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index 871fc92f3cb1..533625ee1ec3 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/servicequotas/service_endpoint_resolver_gen.go b/internal/service/servicequotas/service_endpoint_resolver_gen.go index c8782ad4935f..0ffafbd04b51 100644 --- a/internal/service/servicequotas/service_endpoint_resolver_gen.go +++ b/internal/service/servicequotas/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params servicequotas.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up servicequotas endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up servicequotas endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index 4fbad913abd8..cdf98b309055 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/servicequotas/service_quota.go b/internal/service/servicequotas/service_quota.go index de788a177411..eb7656f0c4ec 100644 --- a/internal/service/servicequotas/service_quota.go +++ b/internal/service/servicequotas/service_quota.go @@ -146,7 +146,6 @@ func resourceServiceQuotaCreate(ctx context.Context, d *schema.ResourceData, met // A Service Quota will always have a default value, but will only have a current value if it has been set. defaultQuota, err := findDefaultServiceQuotaByServiceCodeAndQuotaCode(ctx, conn, serviceCode, quotaCode) - if err != nil { return sdkdiag.AppendErrorf(diags, "reading Service Quotas default Service Quota (%s/%s): %s", serviceCode, quotaCode, err) } @@ -164,7 +163,13 @@ func resourceServiceQuotaCreate(ctx context.Context, d *schema.ResourceData, met } id := serviceQuotaCreateResourceID(serviceCode, quotaCode) - if value := d.Get(names.AttrValue).(float64); value > quotaValue { + value := d.Get(names.AttrValue).(float64) + + if value < quotaValue { + return sdkdiag.AppendErrorf(diags, "requesting Service Quotas Service Quota (%s) with value less than current", id) + } + + if value > quotaValue { input := servicequotas.RequestServiceQuotaIncreaseInput{ DesiredValue: aws.Float64(value), QuotaCode: aws.String(quotaCode), @@ -172,7 +177,6 @@ func resourceServiceQuotaCreate(ctx context.Context, d *schema.ResourceData, met } output, err := conn.RequestServiceQuotaIncrease(ctx, &input) - if err != nil { return sdkdiag.AppendErrorf(diags, "requesting Service Quotas Service Quota (%s) increase: %s", id, err) } diff --git a/internal/service/servicequotas/service_quota_test.go b/internal/service/servicequotas/service_quota_test.go index 6b98f356d40e..11a8a715d5c1 100644 --- a/internal/service/servicequotas/service_quota_test.go +++ b/internal/service/servicequotas/service_quota_test.go @@ -253,6 +253,26 @@ func TestAccServiceQuotasServiceQuota_permissionError(t *testing.T) { }) } +func TestAccServiceQuotasServiceQuota_valueLessThanCurrent(t *testing.T) { + ctx := acctest.Context(t) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheck(ctx, t) + testAccPreCheckServiceQuotaSet(ctx, t, setQuotaServiceCode, setQuotaQuotaCode) + }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceQuotasServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: acctest.CheckDestroyNoop, + Steps: []resource.TestStep{ + { + Config: testAccServiceQuotaConfig_valueLessThanCurrent(setQuotaServiceCode, setQuotaQuotaCode), + ExpectError: regexache.MustCompile(`requesting Service Quotas Service Quota \([^)]+\) with value less than current`), + }, + }, + }) +} + // nosemgrep:ci.servicequotas-in-func-name func testAccServiceQuotaConfig_sameValue(serviceCode, quotaCode string) string { return fmt.Sprintf(` @@ -310,3 +330,18 @@ resource "aws_servicequotas_service_quota" "test" { } `, serviceCode, quotaCode)) } + +func testAccServiceQuotaConfig_valueLessThanCurrent(serviceCode, quotaCode string) string { + return fmt.Sprintf(` +data "aws_servicequotas_service_quota" "test" { + quota_code = %[1]q + service_code = %[2]q +} + +resource "aws_servicequotas_service_quota" "test" { + quota_code = data.aws_servicequotas_service_quota.test.quota_code + service_code = data.aws_servicequotas_service_quota.test.service_code + value = data.aws_servicequotas_service_quota.test.value - 1 +} +`, quotaCode, serviceCode) +} diff --git a/internal/service/ses/service_endpoint_resolver_gen.go b/internal/service/ses/service_endpoint_resolver_gen.go index 18d0abf603bb..4f87d10155a2 100644 --- a/internal/service/ses/service_endpoint_resolver_gen.go +++ b/internal/service/ses/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ses.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ses endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ses endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index 213f54471fda..c5667e17313d 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sesv2/configuration_set_data_source_tags_gen_test.go b/internal/service/sesv2/configuration_set_data_source_tags_gen_test.go index 462863cbc17a..ec9dadf55a47 100644 --- a/internal/service/sesv2/configuration_set_data_source_tags_gen_test.go +++ b/internal/service/sesv2/configuration_set_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSESV2ConfigurationSetDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSESV2ConfigurationSetDataSource_tags(t *testing.T) { func TestAccSESV2ConfigurationSetDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSESV2ConfigurationSetDataSource_tags_NullMap(t *testing.T) { func TestAccSESV2ConfigurationSetDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSESV2ConfigurationSetDataSource_tags_EmptyMap(t *testing.T) { func TestAccSESV2ConfigurationSetDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSESV2ConfigurationSetDataSource_tags_DefaultTags_nonOverlapping(t *t func TestAccSESV2ConfigurationSetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSESV2ConfigurationSetDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccSESV2ConfigurationSetDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/configuration_set_tags_gen_test.go b/internal/service/sesv2/configuration_set_tags_gen_test.go index af0296f27f18..3032e40f7904 100644 --- a/internal/service/sesv2/configuration_set_tags_gen_test.go +++ b/internal/service/sesv2/configuration_set_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSESV2ConfigurationSet_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccSESV2ConfigurationSet_tags(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccSESV2ConfigurationSet_tags_null(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccSESV2ConfigurationSet_tags_EmptyMap(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccSESV2ConfigurationSet_tags_AddOnUpdate(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccSESV2ConfigurationSet_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_nonOverlapping(t *testing.T) func TestAccSESV2ConfigurationSet_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_updateToProviderOnly(t *testi func TestAccSESV2ConfigurationSet_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_updateToResourceOnly(t *testi func TestAccSESV2ConfigurationSet_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_emptyResourceTag(t *testing.T func TestAccSESV2ConfigurationSet_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_emptyProviderOnlyTag(t *testi func TestAccSESV2ConfigurationSet_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_nullOverlappingResourceTag(t func TestAccSESV2ConfigurationSet_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccSESV2ConfigurationSet_tags_DefaultTags_nullNonOverlappingResourceTag func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccSESV2ConfigurationSet_tags_ComputedTag_OnUpdate_Replace(t *testing.T func TestAccSESV2ConfigurationSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccSESV2ConfigurationSet_tags_IgnoreTags_Overlap_DefaultTag(t *testing. func TestAccSESV2ConfigurationSet_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_configuration_set.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/contact_list_tags_gen_test.go b/internal/service/sesv2/contact_list_tags_gen_test.go index ed03d48c0f5c..ccd7ff2ad9c5 100644 --- a/internal/service/sesv2/contact_list_tags_gen_test.go +++ b/internal/service/sesv2/contact_list_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccSESV2ContactList_tagsSerial(t *testing.T) { func testAccSESV2ContactList_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -227,6 +228,7 @@ func testAccSESV2ContactList_tags(t *testing.T) { func testAccSESV2ContactList_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -293,6 +295,7 @@ func testAccSESV2ContactList_tags_null(t *testing.T) { func testAccSESV2ContactList_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -355,6 +358,7 @@ func testAccSESV2ContactList_tags_EmptyMap(t *testing.T) { func testAccSESV2ContactList_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -435,6 +439,7 @@ func testAccSESV2ContactList_tags_AddOnUpdate(t *testing.T) { func testAccSESV2ContactList_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -523,6 +528,7 @@ func testAccSESV2ContactList_tags_EmptyTag_OnCreate(t *testing.T) { func testAccSESV2ContactList_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -659,6 +665,7 @@ func testAccSESV2ContactList_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func testAccSESV2ContactList_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -747,6 +754,7 @@ func testAccSESV2ContactList_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccSESV2ContactList_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -927,6 +935,7 @@ func testAccSESV2ContactList_tags_DefaultTags_providerOnly(t *testing.T) { func testAccSESV2ContactList_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1086,6 +1095,7 @@ func testAccSESV2ContactList_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccSESV2ContactList_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1261,6 +1271,7 @@ func testAccSESV2ContactList_tags_DefaultTags_overlapping(t *testing.T) { func testAccSESV2ContactList_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1350,6 +1361,7 @@ func testAccSESV2ContactList_tags_DefaultTags_updateToProviderOnly(t *testing.T) func testAccSESV2ContactList_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1438,6 +1450,7 @@ func testAccSESV2ContactList_tags_DefaultTags_updateToResourceOnly(t *testing.T) func testAccSESV2ContactList_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1502,6 +1515,7 @@ func testAccSESV2ContactList_tags_DefaultTags_emptyResourceTag(t *testing.T) { func testAccSESV2ContactList_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1558,6 +1572,7 @@ func testAccSESV2ContactList_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func testAccSESV2ContactList_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1619,6 +1634,7 @@ func testAccSESV2ContactList_tags_DefaultTags_nullOverlappingResourceTag(t *test func testAccSESV2ContactList_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1680,6 +1696,7 @@ func testAccSESV2ContactList_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func testAccSESV2ContactList_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1734,6 +1751,7 @@ func testAccSESV2ContactList_tags_ComputedTag_OnCreate(t *testing.T) { func testAccSESV2ContactList_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1830,6 +1848,7 @@ func testAccSESV2ContactList_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccSESV2ContactList_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1916,6 +1935,7 @@ func testAccSESV2ContactList_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccSESV2ContactList_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2077,6 +2097,7 @@ func testAccSESV2ContactList_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func testAccSESV2ContactList_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_contact_list.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/dedicated_ip_pool_data_source_tags_gen_test.go b/internal/service/sesv2/dedicated_ip_pool_data_source_tags_gen_test.go index c304ec5cd8f7..7c068cb08f85 100644 --- a/internal/service/sesv2/dedicated_ip_pool_data_source_tags_gen_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSESV2DedicatedIPPoolDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_tags(t *testing.T) { func TestAccSESV2DedicatedIPPoolDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_tags_NullMap(t *testing.T) { func TestAccSESV2DedicatedIPPoolDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_tags_EmptyMap(t *testing.T) { func TestAccSESV2DedicatedIPPoolDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_tags_DefaultTags_nonOverlapping(t *te func TestAccSESV2DedicatedIPPoolDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccSESV2DedicatedIPPoolDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/dedicated_ip_pool_tags_gen_test.go b/internal/service/sesv2/dedicated_ip_pool_tags_gen_test.go index ea1431e0ace6..03fa4e6a3799 100644 --- a/internal/service/sesv2/dedicated_ip_pool_tags_gen_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSESV2DedicatedIPPool_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccSESV2DedicatedIPPool_tags(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccSESV2DedicatedIPPool_tags_null(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccSESV2DedicatedIPPool_tags_EmptyMap(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccSESV2DedicatedIPPool_tags_AddOnUpdate(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccSESV2DedicatedIPPool_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccSESV2DedicatedIPPool_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccSESV2DedicatedIPPool_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccSESV2DedicatedIPPool_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccSESV2DedicatedIPPool_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccSESV2DedicatedIPPool_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccSESV2DedicatedIPPool_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccSESV2DedicatedIPPool_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccSESV2DedicatedIPPool_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_dedicated_ip_pool.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/email_identity_data_source_tags_gen_test.go b/internal/service/sesv2/email_identity_data_source_tags_gen_test.go index 76a6a8eb845a..9f716b49899d 100644 --- a/internal/service/sesv2/email_identity_data_source_tags_gen_test.go +++ b/internal/service/sesv2/email_identity_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSESV2EmailIdentityDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSESV2EmailIdentityDataSource_tags(t *testing.T) { func TestAccSESV2EmailIdentityDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSESV2EmailIdentityDataSource_tags_NullMap(t *testing.T) { func TestAccSESV2EmailIdentityDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSESV2EmailIdentityDataSource_tags_EmptyMap(t *testing.T) { func TestAccSESV2EmailIdentityDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSESV2EmailIdentityDataSource_tags_DefaultTags_nonOverlapping(t *test func TestAccSESV2EmailIdentityDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSESV2EmailIdentityDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccSESV2EmailIdentityDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/email_identity_tags_gen_test.go b/internal/service/sesv2/email_identity_tags_gen_test.go index b3825a244377..f97f8c88eb56 100644 --- a/internal/service/sesv2/email_identity_tags_gen_test.go +++ b/internal/service/sesv2/email_identity_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSESV2EmailIdentity_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccSESV2EmailIdentity_tags(t *testing.T) { func TestAccSESV2EmailIdentity_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccSESV2EmailIdentity_tags_null(t *testing.T) { func TestAccSESV2EmailIdentity_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccSESV2EmailIdentity_tags_EmptyMap(t *testing.T) { func TestAccSESV2EmailIdentity_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccSESV2EmailIdentity_tags_AddOnUpdate(t *testing.T) { func TestAccSESV2EmailIdentity_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccSESV2EmailIdentity_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSESV2EmailIdentity_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccSESV2EmailIdentity_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2EmailIdentity_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccSESV2EmailIdentity_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSESV2EmailIdentity_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSESV2EmailIdentity_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSESV2EmailIdentity_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSESV2EmailIdentity_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_updateToProviderOnly(t *testing. func TestAccSESV2EmailIdentity_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_updateToResourceOnly(t *testing. func TestAccSESV2EmailIdentity_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSESV2EmailIdentity_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_emptyProviderOnlyTag(t *testing. func TestAccSESV2EmailIdentity_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_nullOverlappingResourceTag(t *te func TestAccSESV2EmailIdentity_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccSESV2EmailIdentity_tags_DefaultTags_nullNonOverlappingResourceTag(t func TestAccSESV2EmailIdentity_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccSESV2EmailIdentity_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSESV2EmailIdentity_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccSESV2EmailIdentity_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSESV2EmailIdentity_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccSESV2EmailIdentity_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSESV2EmailIdentity_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccSESV2EmailIdentity_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccSESV2EmailIdentity_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_sesv2_email_identity.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sesv2/service_endpoint_resolver_gen.go b/internal/service/sesv2/service_endpoint_resolver_gen.go index 7bb572de1434..4d55cfe2378e 100644 --- a/internal/service/sesv2/service_endpoint_resolver_gen.go +++ b/internal/service/sesv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sesv2.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sesv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sesv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index 96705e14b9e6..eef108538fc2 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sfn/service_endpoint_resolver_gen.go b/internal/service/sfn/service_endpoint_resolver_gen.go index 8a46a815fabf..81f5a58b9bb0 100644 --- a/internal/service/sfn/service_endpoint_resolver_gen.go +++ b/internal/service/sfn/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sfn.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sfn endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sfn endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index 573a1e97cd72..1db7d442bbda 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sfn/state_machine.go b/internal/service/sfn/state_machine.go index db3755d887c0..d017f4c5a839 100644 --- a/internal/service/sfn/state_machine.go +++ b/internal/service/sfn/state_machine.go @@ -230,7 +230,7 @@ func resourceStateMachineCreate(ctx context.Context, d *schema.ResourceData, met // Note: the instance may be in a deleting mode, hence the retry // when creating the step function. This can happen when we are // updating the resource (since there is no update API call). - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.CreateStateMachine(ctx, input) }, "StateMachineDeleting", "AccessDeniedException") diff --git a/internal/service/shield/application_layer_automatic_response.go b/internal/service/shield/application_layer_automatic_response.go index 52873bf7ac51..163e1c3cb9e0 100644 --- a/internal/service/shield/application_layer_automatic_response.go +++ b/internal/service/shield/application_layer_automatic_response.go @@ -47,6 +47,7 @@ func (applicationLayerAutomaticResponseAction) Values() []applicationLayerAutoma // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/shield/types;awstypes;awstypes.ApplicationLayerAutomaticResponseConfiguration") // @Testing(preCheck="github.com/hashicorp/terraform-provider-aws/internal/acctest;acctest.PreCheckWAFV2CloudFrontScope") // @Testing(preCheck="testAccPreCheck") +// @Testing(preIdentityVersion="v5.100.0") func newApplicationLayerAutomaticResponseResource(context.Context) (resource.ResourceWithConfigure, error) { r := &applicationLayerAutomaticResponseResource{} diff --git a/internal/service/shield/application_layer_automatic_response_identity_gen_test.go b/internal/service/shield/application_layer_automatic_response_identity_gen_test.go index 865083d8b24b..83276613c434 100644 --- a/internal/service/shield/application_layer_automatic_response_identity_gen_test.go +++ b/internal/service/shield/application_layer_automatic_response_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccShieldApplicationLayerAutomaticResponse_Identity_Basic(t *testing.T) resourceName := "aws_shield_application_layer_automatic_response.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -114,7 +114,7 @@ func TestAccShieldApplicationLayerAutomaticResponse_Identity_ExistingResource(t resourceName := "aws_shield_application_layer_automatic_response.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/shield/service_endpoint_resolver_gen.go b/internal/service/shield/service_endpoint_resolver_gen.go index 23d84b65d324..3f20d681605a 100644 --- a/internal/service/shield/service_endpoint_resolver_gen.go +++ b/internal/service/shield/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params shield.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up shield endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up shield endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 20997eed94f2..7169fcb666fb 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/signer/service_endpoint_resolver_gen.go b/internal/service/signer/service_endpoint_resolver_gen.go index 4456d20a21bb..00170e781b7d 100644 --- a/internal/service/signer/service_endpoint_resolver_gen.go +++ b/internal/service/signer/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params signer.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up signer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up signer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index 854434d689a6..04f9002298bc 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sns/exports_test.go b/internal/service/sns/exports_test.go index 4587d5702bb1..2f56ce2a2010 100644 --- a/internal/service/sns/exports_test.go +++ b/internal/service/sns/exports_test.go @@ -11,6 +11,7 @@ var ( ResourceTopicPolicy = resourceTopicPolicy ResourceTopicSubscription = resourceTopicSubscription + FindDataProtectionPolicyByARN = findDataProtectionPolicyByARN FindPlatformApplicationAttributesByARN = findPlatformApplicationAttributesByARN FindSubscriptionAttributesByARN = findSubscriptionAttributesByARN FindTopicAttributesByARN = findTopicAttributesByARN diff --git a/internal/service/sns/service_endpoint_resolver_gen.go b/internal/service/sns/service_endpoint_resolver_gen.go index 6fb32a73767c..f6104976a8a8 100644 --- a/internal/service/sns/service_endpoint_resolver_gen.go +++ b/internal/service/sns/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sns.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sns endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sns endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index 2deb34002e64..c1c5eb590bf2 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sns/service_package_gen.go b/internal/service/sns/service_package_gen.go index 1e8ddebbd64a..e8089f2d7697 100644 --- a/internal/service/sns/service_package_gen.go +++ b/internal/service/sns/service_package_gen.go @@ -74,18 +74,36 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa TypeName: "aws_sns_topic_data_protection_policy", Name: "Topic Data Protection Policy", Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceTopicPolicy, TypeName: "aws_sns_topic_policy", Name: "Topic Policy", Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, { Factory: resourceTopicSubscription, TypeName: "aws_sns_topic_subscription", Name: "Topic Subscription", Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalARNIdentity( + inttypes.WithIdentityDuplicateAttrs(names.AttrID), + ), + Import: inttypes.SDKv2Import{ + WrappedImport: true, + }, }, } } diff --git a/internal/service/sns/testdata/TopicDataProtectionPolicy/basic/main_gen.tf b/internal/service/sns/testdata/TopicDataProtectionPolicy/basic/main_gen.tf new file mode 100644 index 000000000000..31f3580b7193 --- /dev/null +++ b/internal/service/sns/testdata/TopicDataProtectionPolicy/basic/main_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +data "aws_partition" "current" {} + +resource "aws_sns_topic" "test" { + name = var.rName +} + +resource "aws_sns_topic_data_protection_policy" "test" { + arn = aws_sns_topic.test.arn + policy = jsonencode( + { + "Description" = "Default data protection policy" + "Name" = "__default_data_protection_policy" + "Statement" = [ + { + "DataDirection" = "Inbound" + "DataIdentifier" = [ + "arn:${data.aws_partition.current.partition}:dataprotection::aws:data-identifier/EmailAddress", + ] + "Operation" = { + "Deny" = {} + } + "Principal" = [ + "*", + ] + "Sid" = var.rName + }, + ] + "Version" = "2021-06-01" + } + ) +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/sns/testdata/TopicDataProtectionPolicy/basic_v6.8.0/main_gen.tf b/internal/service/sns/testdata/TopicDataProtectionPolicy/basic_v6.8.0/main_gen.tf new file mode 100644 index 000000000000..08425fc4a7ae --- /dev/null +++ b/internal/service/sns/testdata/TopicDataProtectionPolicy/basic_v6.8.0/main_gen.tf @@ -0,0 +1,50 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +data "aws_partition" "current" {} + +resource "aws_sns_topic" "test" { + name = var.rName +} + +resource "aws_sns_topic_data_protection_policy" "test" { + arn = aws_sns_topic.test.arn + policy = jsonencode( + { + "Description" = "Default data protection policy" + "Name" = "__default_data_protection_policy" + "Statement" = [ + { + "DataDirection" = "Inbound" + "DataIdentifier" = [ + "arn:${data.aws_partition.current.partition}:dataprotection::aws:data-identifier/EmailAddress", + ] + "Operation" = { + "Deny" = {} + } + "Principal" = [ + "*", + ] + "Sid" = var.rName + }, + ] + "Version" = "2021-06-01" + } + ) +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.8.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/sns/testdata/TopicDataProtectionPolicy/region_override/main_gen.tf b/internal/service/sns/testdata/TopicDataProtectionPolicy/region_override/main_gen.tf new file mode 100644 index 000000000000..fc36c2fa89ce --- /dev/null +++ b/internal/service/sns/testdata/TopicDataProtectionPolicy/region_override/main_gen.tf @@ -0,0 +1,50 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +data "aws_partition" "current" {} + +resource "aws_sns_topic" "test" { + region = var.region + + name = var.rName +} + +resource "aws_sns_topic_data_protection_policy" "test" { + region = var.region + + arn = aws_sns_topic.test.arn + policy = jsonencode( + { + "Description" = "Default data protection policy" + "Name" = "__default_data_protection_policy" + "Statement" = [ + { + "DataDirection" = "Inbound" + "DataIdentifier" = [ + "arn:${data.aws_partition.current.partition}:dataprotection::aws:data-identifier/EmailAddress", + ] + "Operation" = { + "Deny" = {} + } + "Principal" = [ + "*", + ] + "Sid" = var.rName + }, + ] + "Version" = "2021-06-01" + } + ) +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/sns/testdata/TopicPolicy/basic/main_gen.tf b/internal/service/sns/testdata/TopicPolicy/basic/main_gen.tf new file mode 100644 index 000000000000..b120913d4cc7 --- /dev/null +++ b/internal/service/sns/testdata/TopicPolicy/basic/main_gen.tf @@ -0,0 +1,38 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_sns_topic" "test" { + name = var.rName +} + +resource "aws_sns_topic_policy" "test" { + arn = aws_sns_topic.test.arn + policy = <" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSNSTopicDataProtectionPolicy_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_sns_topic_data_protection_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: testAccCheckTopicDataProtectionPolicyDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTopicDataProtectionPolicyExists(ctx, resourceName), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/TopicDataProtectionPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/sns/topic_data_protection_policy_test.go b/internal/service/sns/topic_data_protection_policy_test.go index a34ae9492cc2..b54038d9ad46 100644 --- a/internal/service/sns/topic_data_protection_policy_test.go +++ b/internal/service/sns/topic_data_protection_policy_test.go @@ -133,3 +133,17 @@ resource "aws_sns_topic_data_protection_policy" "test" { } `, rName) } + +func testAccCheckTopicDataProtectionPolicyExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).SNSClient(ctx) + _, err := tfsns.FindDataProtectionPolicyByARN(ctx, conn, rs.Primary.ID) + + return err + } +} diff --git a/internal/service/sns/topic_data_source_tags_gen_test.go b/internal/service/sns/topic_data_source_tags_gen_test.go index 34ca8b1e177a..3c7dcc1602cc 100644 --- a/internal/service/sns/topic_data_source_tags_gen_test.go +++ b/internal/service/sns/topic_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSNSTopicDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSNSTopicDataSource_tags(t *testing.T) { func TestAccSNSTopicDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSNSTopicDataSource_tags_NullMap(t *testing.T) { func TestAccSNSTopicDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSNSTopicDataSource_tags_EmptyMap(t *testing.T) { func TestAccSNSTopicDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSNSTopicDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSNSTopicDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSNSTopicDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccSNSTopicDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sns/topic_identity_gen_test.go b/internal/service/sns/topic_identity_gen_test.go index 353c69ddb6a3..a4761213442e 100644 --- a/internal/service/sns/topic_identity_gen_test.go +++ b/internal/service/sns/topic_identity_gen_test.go @@ -26,7 +26,7 @@ func TestAccSNSTopic_Identity_Basic(t *testing.T) { resourceName := "aws_sns_topic.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -111,7 +111,7 @@ func TestAccSNSTopic_Identity_RegionOverride(t *testing.T) { resourceName := "aws_sns_topic.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccSNSTopic_Identity_ExistingResource(t *testing.T) { resourceName := "aws_sns_topic.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/sns/topic_policy.go b/internal/service/sns/topic_policy.go index ff8a4823ec6f..70430b20f81c 100644 --- a/internal/service/sns/topic_policy.go +++ b/internal/service/sns/topic_policy.go @@ -23,6 +23,8 @@ import ( ) // @SDKResource("aws_sns_topic_policy", name="Topic Policy") +// @ArnIdentity +// @Testing(preIdentityVersion="v6.8.0") func resourceTopicPolicy() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceTopicPolicyUpsert, @@ -30,10 +32,6 @@ func resourceTopicPolicy() *schema.Resource { UpdateWithoutTimeout: resourceTopicPolicyUpsert, DeleteWithoutTimeout: resourceTopicPolicyDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ names.AttrARN: { Type: schema.TypeString, diff --git a/internal/service/sns/topic_policy_identity_gen_test.go b/internal/service/sns/topic_policy_identity_gen_test.go new file mode 100644 index 000000000000..7b9d559e764c --- /dev/null +++ b/internal/service/sns/topic_policy_identity_gen_test.go @@ -0,0 +1,280 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package sns_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSNSTopicPolicy_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_sns_topic_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTopicPolicyExists(ctx, resourceName), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccSNSTopicPolicy_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_sns_topic_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSNSTopicPolicy_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_sns_topic_policy.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTopicPolicyExists(ctx, resourceName), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/TopicPolicy/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/sns/topic_policy_test.go b/internal/service/sns/topic_policy_test.go index de3a743c18cd..b42edfdebdac 100644 --- a/internal/service/sns/topic_policy_test.go +++ b/internal/service/sns/topic_policy_test.go @@ -331,3 +331,28 @@ resource "aws_sns_topic_policy" "test" { } `, rName) } + +func testAccCheckTopicPolicyExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No SNS Topic ID is set") + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).SNSClient(ctx) + output, err := tfsns.FindTopicAttributesByARN(ctx, conn, rs.Primary.ID) + if err != nil { + return err + } + + if output[tfsns.TopicAttributeNamePolicy] == "" { + return fmt.Errorf("Topic policy not found") + } + + return nil + } +} diff --git a/internal/service/sns/topic_subscription.go b/internal/service/sns/topic_subscription.go index 6734506c5a0c..62f5f485388b 100644 --- a/internal/service/sns/topic_subscription.go +++ b/internal/service/sns/topic_subscription.go @@ -157,6 +157,10 @@ var ( ) // @SDKResource("aws_sns_topic_subscription", name="Topic Subscription") +// @ArnIdentity +// @Testing(existsType="map[string]string") +// @Testing(preIdentityVersion="v6.8.0") +// @Testing(importIgnore="confirmation_timeout_in_minutes;endpoint_auto_confirms") func resourceTopicSubscription() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceTopicSubscriptionCreate, @@ -164,10 +168,6 @@ func resourceTopicSubscription() *schema.Resource { UpdateWithoutTimeout: resourceTopicSubscriptionUpdate, DeleteWithoutTimeout: resourceTopicSubscriptionDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - CustomizeDiff: resourceTopicSubscriptionCustomizeDiff, Schema: subscriptionSchema, diff --git a/internal/service/sns/topic_subscription_identity_gen_test.go b/internal/service/sns/topic_subscription_identity_gen_test.go new file mode 100644 index 000000000000..bccc9a14b3f4 --- /dev/null +++ b/internal/service/sns/topic_subscription_identity_gen_test.go @@ -0,0 +1,301 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package sns_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSNSTopicSubscription_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v map[string]string + resourceName := "aws_sns_topic_subscription.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTopicSubscriptionExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "confirmation_timeout_in_minutes", "endpoint_auto_confirms", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccSNSTopicSubscription_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_sns_topic_subscription.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrARN), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + + // Step 2: Import command with appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "confirmation_timeout_in_minutes", "endpoint_auto_confirms", + }, + }, + + // Step 3: Import command without appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "confirmation_timeout_in_minutes", "endpoint_auto_confirms", + }, + }, + + // Step 4: Import block with Import ID and appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 5: Import block with Import ID and no appended "@" + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + + // Step 6: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrARN), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// Resource Identity was added after v6.8.0 +func TestAccSNSTopicSubscription_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v map[string]string + resourceName := "aws_sns_topic_subscription.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SNSServiceID), + CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic_v6.8.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTopicSubscriptionExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/TopicSubscription/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrARN: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrARN)), + }, + }, + }, + }) +} diff --git a/internal/service/sns/topic_subscription_test.go b/internal/service/sns/topic_subscription_test.go index b59c4ca76c59..1b97b90dbcd9 100644 --- a/internal/service/sns/topic_subscription_test.go +++ b/internal/service/sns/topic_subscription_test.go @@ -1165,7 +1165,7 @@ resource "aws_lambda_permission" "apigw_lambda" { action = "lambda:InvokeFunction" function_name = aws_lambda_function.lambda.arn principal = "apigateway.${data.aws_partition.current.dns_suffix}" - source_arn = "${aws_api_gateway_deployment.test.execution_arn}/*" + source_arn = "${aws_api_gateway_stage.test.execution_arn}/*" } resource "aws_lambda_function" "lambda" { @@ -1180,14 +1180,19 @@ resource "aws_lambda_function" "lambda" { resource "aws_api_gateway_deployment" "test" { depends_on = [aws_api_gateway_integration_response.test] rest_api_id = aws_api_gateway_rest_api.test.id - stage_name = "acctest" +} + +resource "aws_api_gateway_stage" "test" { + stage_name = "acctest" + rest_api_id = aws_api_gateway_rest_api.test.id + deployment_id = aws_api_gateway_deployment.test.id } resource "aws_sns_topic_subscription" "test" { depends_on = [aws_lambda_permission.apigw_lambda] topic_arn = aws_sns_topic.test.arn protocol = "https" - endpoint = aws_api_gateway_deployment.test.invoke_url + endpoint = aws_api_gateway_stage.test.invoke_url endpoint_auto_confirms = true } `, rName) @@ -1291,7 +1296,7 @@ resource "aws_lambda_permission" "apigw_lambda" { action = "lambda:InvokeFunction" function_name = aws_lambda_function.lambda.arn principal = "apigateway.${data.aws_partition.current.dns_suffix}" - source_arn = "${aws_api_gateway_deployment.test.execution_arn}/*" + source_arn = "${aws_api_gateway_stage.test.execution_arn}/*" } resource "aws_lambda_function" "lambda" { @@ -1306,7 +1311,12 @@ resource "aws_lambda_function" "lambda" { resource "aws_api_gateway_deployment" "test" { depends_on = [aws_api_gateway_integration_response.test] rest_api_id = aws_api_gateway_rest_api.test.id - stage_name = "acctest" +} + +resource "aws_api_gateway_stage" "test" { + stage_name = "acctest" + rest_api_id = aws_api_gateway_rest_api.test.id + deployment_id = aws_api_gateway_deployment.test.id } resource "aws_iam_role" "invocation_role" { @@ -1389,7 +1399,7 @@ resource "aws_sns_topic_subscription" "test" { depends_on = [aws_lambda_permission.apigw_lambda] topic_arn = aws_sns_topic.test.arn protocol = "https" - endpoint = replace(aws_api_gateway_deployment.test.invoke_url, "https://", "https://davematthews:granny@") + endpoint = replace(aws_api_gateway_stage.test.invoke_url, "https://", "https://davematthews:granny@") endpoint_auto_confirms = true confirmation_timeout_in_minutes = 3 diff --git a/internal/service/sns/topic_tags_gen_test.go b/internal/service/sns/topic_tags_gen_test.go index 0bc94ccf8dd1..721b2576a8e4 100644 --- a/internal/service/sns/topic_tags_gen_test.go +++ b/internal/service/sns/topic_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSNSTopic_tags(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -199,6 +200,7 @@ func TestAccSNSTopic_tags(t *testing.T) { func TestAccSNSTopic_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -266,6 +268,7 @@ func TestAccSNSTopic_tags_null(t *testing.T) { func TestAccSNSTopic_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -329,6 +332,7 @@ func TestAccSNSTopic_tags_EmptyMap(t *testing.T) { func TestAccSNSTopic_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -410,6 +414,7 @@ func TestAccSNSTopic_tags_AddOnUpdate(t *testing.T) { func TestAccSNSTopic_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -499,6 +504,7 @@ func TestAccSNSTopic_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSNSTopic_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -636,6 +642,7 @@ func TestAccSNSTopic_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSNSTopic_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -725,6 +732,7 @@ func TestAccSNSTopic_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -906,6 +914,7 @@ func TestAccSNSTopic_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1066,6 +1075,7 @@ func TestAccSNSTopic_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1242,6 +1252,7 @@ func TestAccSNSTopic_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1332,6 +1343,7 @@ func TestAccSNSTopic_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1421,6 +1433,7 @@ func TestAccSNSTopic_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1486,6 +1499,7 @@ func TestAccSNSTopic_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1543,6 +1557,7 @@ func TestAccSNSTopic_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1605,6 +1620,7 @@ func TestAccSNSTopic_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccSNSTopic_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1667,6 +1683,7 @@ func TestAccSNSTopic_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T func TestAccSNSTopic_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1722,6 +1739,7 @@ func TestAccSNSTopic_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSNSTopic_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1819,6 +1837,7 @@ func TestAccSNSTopic_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSNSTopic_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1906,6 +1925,7 @@ func TestAccSNSTopic_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSNSTopic_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2068,6 +2088,7 @@ func TestAccSNSTopic_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSNSTopic_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[string]string resourceName := "aws_sns_topic.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sqs/attribute_funcs.go b/internal/service/sqs/attribute_funcs.go index e33f3c3e2a97..db799f2fd136 100644 --- a/internal/service/sqs/attribute_funcs.go +++ b/internal/service/sqs/attribute_funcs.go @@ -49,7 +49,7 @@ func (h *queueAttributeHandler) Upsert(ctx context.Context, d *schema.ResourceDa deadline := inttypes.NewDeadline(d.Timeout(schema.TimeoutCreate)) - _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate)/2, func() (any, error) { + _, err = tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate)/2, func(ctx context.Context) (any, error) { return conn.SetQueueAttributes(ctx, input) }, errCodeInvalidAttributeValue, "Invalid value for the parameter Policy") diff --git a/internal/service/sqs/queue.go b/internal/service/sqs/queue.go index 1c0ec8162328..73945b160c83 100644 --- a/internal/service/sqs/queue.go +++ b/internal/service/sqs/queue.go @@ -93,7 +93,7 @@ var ( Type: schema.TypeInt, Optional: true, Default: defaultQueueMaximumMessageSize, - ValidateFunc: validation.IntBetween(1024, 262_144), + ValidateFunc: validation.IntBetween(1024, 1_048_576), }, "message_retention_seconds": { Type: schema.TypeInt, @@ -238,7 +238,7 @@ func resourceQueueCreate(ctx context.Context, d *schema.ResourceData, meta any) // create is 2 phase: 1. create, 2. wait for propagation deadline := inttypes.NewDeadline(d.Timeout(schema.TimeoutCreate)) - outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate)/2, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate)/2, func(ctx context.Context) (any, error) { return conn.CreateQueue(ctx, input) }, errCodeQueueDeletedRecently) @@ -246,7 +246,7 @@ func resourceQueueCreate(ctx context.Context, d *schema.ResourceData, meta any) if input.Tags != nil && errs.IsUnsupportedOperationInPartitionError(meta.(*conns.AWSClient).Partition(ctx), err) { input.Tags = nil - outputRaw, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate)/2, func() (any, error) { + outputRaw, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate)/2, func(ctx context.Context) (any, error) { return conn.CreateQueue(ctx, input) }, errCodeQueueDeletedRecently) } diff --git a/internal/service/sqs/queue_data_source_tags_gen_test.go b/internal/service/sqs/queue_data_source_tags_gen_test.go index abbe109b59a6..5c45c75ac5ff 100644 --- a/internal/service/sqs/queue_data_source_tags_gen_test.go +++ b/internal/service/sqs/queue_data_source_tags_gen_test.go @@ -16,6 +16,7 @@ import ( func TestAccSQSQueueDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -44,6 +45,7 @@ func TestAccSQSQueueDataSource_tags(t *testing.T) { func TestAccSQSQueueDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccSQSQueueDataSource_tags_NullMap(t *testing.T) { func TestAccSQSQueueDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -92,6 +95,7 @@ func TestAccSQSQueueDataSource_tags_EmptyMap(t *testing.T) { func TestAccSQSQueueDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -124,6 +128,7 @@ func TestAccSQSQueueDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSQSQueueDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -162,6 +167,7 @@ func TestAccSQSQueueDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func TestAccSQSQueueDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sqs/queue_tags_gen_test.go b/internal/service/sqs/queue_tags_gen_test.go index 4cb4b15513a3..0d83bafa6e04 100644 --- a/internal/service/sqs/queue_tags_gen_test.go +++ b/internal/service/sqs/queue_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccSQSQueue_tags(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccSQSQueue_tags(t *testing.T) { func TestAccSQSQueue_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccSQSQueue_tags_null(t *testing.T) { func TestAccSQSQueue_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccSQSQueue_tags_EmptyMap(t *testing.T) { func TestAccSQSQueue_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccSQSQueue_tags_AddOnUpdate(t *testing.T) { func TestAccSQSQueue_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccSQSQueue_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSQSQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccSQSQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSQSQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccSQSQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccSQSQueue_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccSQSQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccSQSQueue_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccSQSQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccSQSQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccSQSQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccSQSQueue_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccSQSQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { func TestAccSQSQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccSQSQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T func TestAccSQSQueue_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccSQSQueue_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSQSQueue_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccSQSQueue_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSQSQueue_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccSQSQueue_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSQSQueue_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccSQSQueue_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSQSQueue_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v map[awstypes.QueueAttributeName]string resourceName := "aws_sqs_queue.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/sqs/queue_test.go b/internal/service/sqs/queue_test.go index b815e48e186f..9e9c1ff44251 100644 --- a/internal/service/sqs/queue_test.go +++ b/internal/service/sqs/queue_test.go @@ -1317,7 +1317,7 @@ func testAccQueueConfig_managedEncryptionKMSDataKeyReusePeriodSeconds(rName stri return fmt.Sprintf(` resource "aws_sqs_queue" "test" { kms_data_key_reuse_period_seconds = "60" - max_message_size = "261244" + max_message_size = "1048576" message_retention_seconds = "60" name = %[1]q sqs_managed_sse_enabled = true @@ -1371,7 +1371,7 @@ func testAccQueueConfig_noManagedEncryptionKMSDataKeyReusePeriodSeconds(rName st resource "aws_sqs_queue" "test" { fifo_queue = true kms_data_key_reuse_period_seconds = "60" - max_message_size = "261244" + max_message_size = "1048576" message_retention_seconds = "60" name = "%[1]s.fifo" receive_wait_time_seconds = "10" diff --git a/internal/service/sqs/service_endpoint_resolver_gen.go b/internal/service/sqs/service_endpoint_resolver_gen.go index 7f2413f026c3..71bfc54d879f 100644 --- a/internal/service/sqs/service_endpoint_resolver_gen.go +++ b/internal/service/sqs/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sqs.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sqs endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sqs endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index 61aaae0baafe..076779b7829a 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssm/activation.go b/internal/service/ssm/activation.go index a74a921552a4..fa7492f576af 100644 --- a/internal/service/ssm/activation.go +++ b/internal/service/ssm/activation.go @@ -108,7 +108,7 @@ func resourceActivationCreate(ctx context.Context, d *schema.ResourceData, meta input.RegistrationLimit = aws.Int32(int32(v.(int))) } - outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func(ctx context.Context) (any, error) { return conn.CreateActivation(ctx, input) }, errCodeValidationException, "Nonexistent role") diff --git a/internal/service/ssm/activation_tags_gen_test.go b/internal/service/ssm/activation_tags_gen_test.go index e12ec9875ca3..aa1af128e957 100644 --- a/internal/service/ssm/activation_tags_gen_test.go +++ b/internal/service/ssm/activation_tags_gen_test.go @@ -23,6 +23,7 @@ import ( func TestAccSSMActivation_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -217,6 +218,7 @@ func TestAccSSMActivation_tags(t *testing.T) { func TestAccSSMActivation_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -287,6 +289,7 @@ func TestAccSSMActivation_tags_null(t *testing.T) { func TestAccSSMActivation_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -353,6 +356,7 @@ func TestAccSSMActivation_tags_EmptyMap(t *testing.T) { func TestAccSSMActivation_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -437,6 +441,7 @@ func TestAccSSMActivation_tags_AddOnUpdate(t *testing.T) { func TestAccSSMActivation_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -532,6 +537,7 @@ func TestAccSSMActivation_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMActivation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -675,6 +681,7 @@ func TestAccSSMActivation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMActivation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -767,6 +774,7 @@ func TestAccSSMActivation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -960,6 +968,7 @@ func TestAccSSMActivation_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1129,6 +1138,7 @@ func TestAccSSMActivation_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1314,6 +1324,7 @@ func TestAccSSMActivation_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1418,7 @@ func TestAccSSMActivation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1499,6 +1511,7 @@ func TestAccSSMActivation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1567,6 +1580,7 @@ func TestAccSSMActivation_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1627,6 +1641,7 @@ func TestAccSSMActivation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSSMActivation_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1692,6 +1707,7 @@ func TestAccSSMActivation_tags_DefaultTags_nullOverlappingResourceTag(t *testing func TestAccSSMActivation_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1757,6 +1773,7 @@ func TestAccSSMActivation_tags_DefaultTags_nullNonOverlappingResourceTag(t *test func TestAccSSMActivation_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1815,6 +1832,7 @@ func TestAccSSMActivation_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMActivation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1915,6 +1933,7 @@ func TestAccSSMActivation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMActivation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2005,6 +2024,7 @@ func TestAccSSMActivation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMActivation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2167,6 +2187,7 @@ func TestAccSSMActivation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSSMActivation_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Activation resourceName := "aws_ssm_activation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/association_tags_gen_test.go b/internal/service/ssm/association_tags_gen_test.go index 7106d05319c0..9c8fccb88db5 100644 --- a/internal/service/ssm/association_tags_gen_test.go +++ b/internal/service/ssm/association_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSSMAssociation_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccSSMAssociation_tags(t *testing.T) { func TestAccSSMAssociation_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccSSMAssociation_tags_null(t *testing.T) { func TestAccSSMAssociation_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccSSMAssociation_tags_EmptyMap(t *testing.T) { func TestAccSSMAssociation_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccSSMAssociation_tags_AddOnUpdate(t *testing.T) { func TestAccSSMAssociation_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccSSMAssociation_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMAssociation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccSSMAssociation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMAssociation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccSSMAssociation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccSSMAssociation_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccSSMAssociation_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccSSMAssociation_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccSSMAssociation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccSSMAssociation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccSSMAssociation_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccSSMAssociation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSSMAssociation_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccSSMAssociation_tags_DefaultTags_nullOverlappingResourceTag(t *testin func TestAccSSMAssociation_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccSSMAssociation_tags_DefaultTags_nullNonOverlappingResourceTag(t *tes func TestAccSSMAssociation_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccSSMAssociation_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMAssociation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccSSMAssociation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMAssociation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccSSMAssociation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMAssociation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccSSMAssociation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSSMAssociation_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/document_tags_gen_test.go b/internal/service/ssm/document_tags_gen_test.go index f12c31c84a57..6d4163707d0f 100644 --- a/internal/service/ssm/document_tags_gen_test.go +++ b/internal/service/ssm/document_tags_gen_test.go @@ -17,6 +17,7 @@ import ( func TestAccSSMDocument_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -198,6 +199,7 @@ func TestAccSSMDocument_tags(t *testing.T) { func TestAccSSMDocument_tags_null(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -264,6 +266,7 @@ func TestAccSSMDocument_tags_null(t *testing.T) { func TestAccSSMDocument_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccSSMDocument_tags_EmptyMap(t *testing.T) { func TestAccSSMDocument_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccSSMDocument_tags_AddOnUpdate(t *testing.T) { func TestAccSSMDocument_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -494,6 +499,7 @@ func TestAccSSMDocument_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMDocument_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -630,6 +636,7 @@ func TestAccSSMDocument_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMDocument_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -718,6 +725,7 @@ func TestAccSSMDocument_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -898,6 +906,7 @@ func TestAccSSMDocument_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1057,6 +1066,7 @@ func TestAccSSMDocument_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1232,6 +1242,7 @@ func TestAccSSMDocument_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1321,6 +1332,7 @@ func TestAccSSMDocument_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1409,6 +1421,7 @@ func TestAccSSMDocument_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccSSMDocument_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1529,6 +1543,7 @@ func TestAccSSMDocument_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSSMDocument_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1590,6 +1605,7 @@ func TestAccSSMDocument_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T func TestAccSSMDocument_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1651,6 +1667,7 @@ func TestAccSSMDocument_tags_DefaultTags_nullNonOverlappingResourceTag(t *testin func TestAccSSMDocument_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1705,6 +1722,7 @@ func TestAccSSMDocument_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMDocument_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1801,6 +1819,7 @@ func TestAccSSMDocument_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMDocument_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1887,6 +1906,7 @@ func TestAccSSMDocument_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMDocument_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2048,6 +2068,7 @@ func TestAccSSMDocument_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSSMDocument_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssm_document.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/generate.go b/internal/service/ssm/generate.go index c0bdb3f9a635..e387e92af742 100644 --- a/internal/service/ssm/generate.go +++ b/internal/service/ssm/generate.go @@ -4,6 +4,7 @@ //go:generate go run ../../generate/tags/main.go -ServiceTagsSlice -TagOp=AddTagsToResource -TagInIDElem=ResourceId -TagResTypeElem=ResourceType -TagResTypeElemType=ResourceTypeForTagging -UntagOp=RemoveTagsFromResource -UpdateTags -CreateTags //go:generate go run ../../generate/servicepackage/main.go //go:generate go run ../../generate/tagstests/main.go +//go:generate go run ../../generate/identitytests/main.go // ONLY generate directives and package declaration! Do not add anything else to this file. package ssm diff --git a/internal/service/ssm/maintenance_window_tags_gen_test.go b/internal/service/ssm/maintenance_window_tags_gen_test.go index 6bb60600e22e..17e2e5870988 100644 --- a/internal/service/ssm/maintenance_window_tags_gen_test.go +++ b/internal/service/ssm/maintenance_window_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccSSMMaintenanceWindow_tags(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccSSMMaintenanceWindow_tags(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccSSMMaintenanceWindow_tags_null(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccSSMMaintenanceWindow_tags_EmptyMap(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccSSMMaintenanceWindow_tags_AddOnUpdate(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccSSMMaintenanceWindow_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_updateToProviderOnly(t *testin func TestAccSSMMaintenanceWindow_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_updateToResourceOnly(t *testin func TestAccSSMMaintenanceWindow_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_emptyResourceTag(t *testing.T) func TestAccSSMMaintenanceWindow_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_emptyProviderOnlyTag(t *testin func TestAccSSMMaintenanceWindow_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_nullOverlappingResourceTag(t * func TestAccSSMMaintenanceWindow_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccSSMMaintenanceWindow_tags_DefaultTags_nullNonOverlappingResourceTag( func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccSSMMaintenanceWindow_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func TestAccSSMMaintenanceWindow_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccSSMMaintenanceWindow_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T func TestAccSSMMaintenanceWindow_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetMaintenanceWindowOutput resourceName := "aws_ssm_maintenance_window.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/parameter.go b/internal/service/ssm/parameter.go index 809580a47489..9dfb3a891729 100644 --- a/internal/service/ssm/parameter.go +++ b/internal/service/ssm/parameter.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -32,6 +33,11 @@ import ( // @Tags(identifierAttribute="id", resourceType="Parameter") // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ssm/types;awstypes;awstypes.Parameter") // @Testing(importIgnore="has_value_wo") +// @IdentityAttribute("name") +// @Testing(idAttrDuplicates="name") +// @Testing(preIdentityVersion="v6.7.0") +// @Testing(plannableImportAction="NoOp") +// @CustomImport func resourceParameter() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceParameterCreate, @@ -41,6 +47,12 @@ func resourceParameter() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) { + identitySpec := importer.IdentitySpec(ctx) + + if err := importer.RegionalSingleParameterized(ctx, d, identitySpec, meta.(importer.AWSClient)); err != nil { + return nil, err + } + d.Set("has_value_wo", false) return []*schema.ResourceData{d}, nil }, diff --git a/internal/service/ssm/parameter_identity_gen_test.go b/internal/service/ssm/parameter_identity_gen_test.go new file mode 100644 index 000000000000..be1118970ba2 --- /dev/null +++ b/internal/service/ssm/parameter_identity_gen_test.go @@ -0,0 +1,262 @@ +// Code generated by internal/generate/identitytests/main.go; DO NOT EDIT. + +package ssm_test + +import ( + "testing" + + awstypes "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/hashicorp/terraform-plugin-testing/compare" + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" + tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccSSMParameter_Identity_Basic(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Parameter + resourceName := "aws_ssm_parameter.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SSMServiceID), + CheckDestroy: testAccCheckParameterDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckParameterExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrName), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ImportStateKind: resource.ImportCommandWithID, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "has_value_wo", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrID), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())), + }, + }, + }, + }, + }) +} + +func TestAccSSMParameter_Identity_RegionOverride(t *testing.T) { + ctx := acctest.Context(t) + + resourceName := "aws_ssm_parameter.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SSMServiceID), + CheckDestroy: acctest.CheckDestroyNoop, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + // Step 1: Setup + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.CompareValuePairs(resourceName, tfjsonpath.New(names.AttrID), resourceName, tfjsonpath.New(names.AttrName), compare.ValuesSame()), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.AlternateRegion()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + + // Step 2: Import command + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ImportStateKind: resource.ImportCommandWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "has_value_wo", + }, + }, + + // Step 3: Import block with Import ID + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithID, + ImportStateIdFunc: acctest.CrossRegionImportStateIdFunc(resourceName), + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + + // Step 4: Import block with Resource Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/region_override/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + "region": config.StringVariable(acctest.AlternateRegion()), + }, + ResourceName: resourceName, + ImportState: true, + ImportStateKind: resource.ImportBlockWithResourceIdentity, + ImportPlanChecks: resource.ImportPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrName), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())), + }, + }, + }, + }, + }) +} + +// Resource Identity was added after v6.7.0 +func TestAccSSMParameter_Identity_ExistingResource(t *testing.T) { + ctx := acctest.Context(t) + + var v awstypes.Parameter + resourceName := "aws_ssm_parameter.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + acctest.ParallelTest(ctx, t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_12_0), + }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SSMServiceID), + CheckDestroy: testAccCheckParameterDestroy(ctx), + Steps: []resource.TestStep{ + // Step 1: Create pre-Identity + { + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic_v6.7.0/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckParameterExists(ctx, resourceName, &v), + ), + ConfigStateChecks: []statecheck.StateCheck{ + tfstatecheck.ExpectNoIdentity(resourceName), + }, + }, + + // Step 2: Current version + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Parameter/basic/"), + ConfigVariables: config.Variables{ + acctest.CtRName: config.StringVariable(rName), + }, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectIdentity(resourceName, map[string]knownvalue.Check{ + names.AttrAccountID: tfknownvalue.AccountID(), + names.AttrRegion: knownvalue.StringExact(acctest.Region()), + names.AttrName: knownvalue.NotNull(), + }), + statecheck.ExpectIdentityValueMatchesState(resourceName, tfjsonpath.New(names.AttrName)), + }, + }, + }, + }) +} diff --git a/internal/service/ssm/parameter_tags_gen_test.go b/internal/service/ssm/parameter_tags_gen_test.go index 8dce82183cc1..b87d7515181a 100644 --- a/internal/service/ssm/parameter_tags_gen_test.go +++ b/internal/service/ssm/parameter_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccSSMParameter_tags(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccSSMParameter_tags(t *testing.T) { func TestAccSSMParameter_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -282,6 +284,7 @@ func TestAccSSMParameter_tags_null(t *testing.T) { func TestAccSSMParameter_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -348,6 +351,7 @@ func TestAccSSMParameter_tags_EmptyMap(t *testing.T) { func TestAccSSMParameter_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -432,6 +436,7 @@ func TestAccSSMParameter_tags_AddOnUpdate(t *testing.T) { func TestAccSSMParameter_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -527,6 +532,7 @@ func TestAccSSMParameter_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMParameter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -670,6 +676,7 @@ func TestAccSSMParameter_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMParameter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -762,6 +769,7 @@ func TestAccSSMParameter_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -955,6 +963,7 @@ func TestAccSSMParameter_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1124,6 +1133,7 @@ func TestAccSSMParameter_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1309,6 +1319,7 @@ func TestAccSSMParameter_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1402,6 +1413,7 @@ func TestAccSSMParameter_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1494,6 +1506,7 @@ func TestAccSSMParameter_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1562,6 +1575,7 @@ func TestAccSSMParameter_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1622,6 +1636,7 @@ func TestAccSSMParameter_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccSSMParameter_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1687,6 +1702,7 @@ func TestAccSSMParameter_tags_DefaultTags_nullOverlappingResourceTag(t *testing. func TestAccSSMParameter_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1752,6 +1768,7 @@ func TestAccSSMParameter_tags_DefaultTags_nullNonOverlappingResourceTag(t *testi func TestAccSSMParameter_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1810,6 +1827,7 @@ func TestAccSSMParameter_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMParameter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1928,7 @@ func TestAccSSMParameter_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMParameter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2000,6 +2019,7 @@ func TestAccSSMParameter_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMParameter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2162,6 +2182,7 @@ func TestAccSSMParameter_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSSMParameter_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v awstypes.Parameter resourceName := "aws_ssm_parameter.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/patch_baseline_tags_gen_test.go b/internal/service/ssm/patch_baseline_tags_gen_test.go index 27693e716c1c..ed800765bcf9 100644 --- a/internal/service/ssm/patch_baseline_tags_gen_test.go +++ b/internal/service/ssm/patch_baseline_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccSSMPatchBaseline_tags(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccSSMPatchBaseline_tags(t *testing.T) { func TestAccSSMPatchBaseline_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccSSMPatchBaseline_tags_null(t *testing.T) { func TestAccSSMPatchBaseline_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccSSMPatchBaseline_tags_EmptyMap(t *testing.T) { func TestAccSSMPatchBaseline_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccSSMPatchBaseline_tags_AddOnUpdate(t *testing.T) { func TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccSSMPatchBaseline_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_overlapping(t *testing.T) { func TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v ssm.GetPatchBaselineOutput resourceName := "aws_ssm_patch_baseline.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssm/service_endpoint_resolver_gen.go b/internal/service/ssm/service_endpoint_resolver_gen.go index 3c998074a290..137dfb9b2542 100644 --- a/internal/service/ssm/service_endpoint_resolver_gen.go +++ b/internal/service/ssm/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssm.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssm endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssm endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index 81db15a0519c..65cdfb7411e7 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssm/service_package_gen.go b/internal/service/ssm/service_package_gen.go index 9e60e69c0d40..4c2b529f2d39 100644 --- a/internal/service/ssm/service_package_gen.go +++ b/internal/service/ssm/service_package_gen.go @@ -150,7 +150,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*inttypes.ServicePa IdentifierAttribute: names.AttrID, ResourceType: "Parameter", }), - Region: unique.Make(inttypes.ResourceRegionDefault()), + Region: unique.Make(inttypes.ResourceRegionDefault()), + Identity: inttypes.RegionalSingleParameterIdentity(names.AttrName), + Import: inttypes.SDKv2Import{ + CustomImport: true, + }, }, { Factory: resourcePatchBaseline, diff --git a/internal/service/ssm/testdata/Parameter/basic/main_gen.tf b/internal/service/ssm/testdata/Parameter/basic/main_gen.tf new file mode 100644 index 000000000000..c9df629a509e --- /dev/null +++ b/internal/service/ssm/testdata/Parameter/basic/main_gen.tf @@ -0,0 +1,14 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ssm_parameter" "test" { + name = var.rName + type = "String" + value = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} diff --git a/internal/service/ssm/testdata/Parameter/basic_v6.7.0/main_gen.tf b/internal/service/ssm/testdata/Parameter/basic_v6.7.0/main_gen.tf new file mode 100644 index 000000000000..ec0805e97983 --- /dev/null +++ b/internal/service/ssm/testdata/Parameter/basic_v6.7.0/main_gen.tf @@ -0,0 +1,24 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ssm_parameter" "test" { + name = var.rName + type = "String" + value = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.7.0" + } + } +} + +provider "aws" {} diff --git a/internal/service/ssm/testdata/Parameter/region_override/main_gen.tf b/internal/service/ssm/testdata/Parameter/region_override/main_gen.tf new file mode 100644 index 000000000000..10b22005ffcf --- /dev/null +++ b/internal/service/ssm/testdata/Parameter/region_override/main_gen.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_ssm_parameter" "test" { + region = var.region + + name = var.rName + type = "String" + value = var.rName +} + +variable "rName" { + description = "Name for resource" + type = string + nullable = false +} + +variable "region" { + description = "Region to deploy resource in" + type = string + nullable = false +} diff --git a/internal/service/ssm/testdata/tmpl/parameter_tags.gtpl b/internal/service/ssm/testdata/tmpl/parameter_tags.gtpl index 0b99ecdca4ec..9f31e6bfb6ea 100644 --- a/internal/service/ssm/testdata/tmpl/parameter_tags.gtpl +++ b/internal/service/ssm/testdata/tmpl/parameter_tags.gtpl @@ -1,4 +1,5 @@ resource "aws_ssm_parameter" "test" { +{{- template "region" }} name = var.rName type = "String" value = var.rName diff --git a/internal/service/ssmcontacts/contact_data_source_tags_gen_test.go b/internal/service/ssmcontacts/contact_data_source_tags_gen_test.go index f1070f50d493..30d040baf402 100644 --- a/internal/service/ssmcontacts/contact_data_source_tags_gen_test.go +++ b/internal/service/ssmcontacts/contact_data_source_tags_gen_test.go @@ -31,6 +31,7 @@ func testAccSSMContactsContactDataSource_tagsSerial(t *testing.T) { func testAccSSMContactsContactDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -59,6 +60,7 @@ func testAccSSMContactsContactDataSource_tags(t *testing.T) { func testAccSSMContactsContactDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -83,6 +85,7 @@ func testAccSSMContactsContactDataSource_tags_NullMap(t *testing.T) { func testAccSSMContactsContactDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -107,6 +110,7 @@ func testAccSSMContactsContactDataSource_tags_EmptyMap(t *testing.T) { func testAccSSMContactsContactDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -139,6 +143,7 @@ func testAccSSMContactsContactDataSource_tags_DefaultTags_nonOverlapping(t *test func testAccSSMContactsContactDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -177,6 +182,7 @@ func testAccSSMContactsContactDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *t func testAccSSMContactsContactDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssmcontacts/contact_tags_gen_test.go b/internal/service/ssmcontacts/contact_tags_gen_test.go index 16fdb0fa59fa..c4ddcb7a80f4 100644 --- a/internal/service/ssmcontacts/contact_tags_gen_test.go +++ b/internal/service/ssmcontacts/contact_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccSSMContactsContact_tagsSerial(t *testing.T) { func testAccSSMContactsContact_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccSSMContactsContact_tags_null(t *testing.T) { t.Skip("Resource Contact does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -295,6 +297,7 @@ func testAccSSMContactsContact_tags_null(t *testing.T) { func testAccSSMContactsContact_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -357,6 +360,7 @@ func testAccSSMContactsContact_tags_EmptyMap(t *testing.T) { func testAccSSMContactsContact_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -439,6 +443,7 @@ func testAccSSMContactsContact_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Contact does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -529,6 +534,7 @@ func testAccSSMContactsContact_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Contact does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -667,6 +673,7 @@ func testAccSSMContactsContact_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Contact does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -755,6 +762,7 @@ func testAccSSMContactsContact_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccSSMContactsContact_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -935,6 +943,7 @@ func testAccSSMContactsContact_tags_DefaultTags_providerOnly(t *testing.T) { func testAccSSMContactsContact_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1094,6 +1103,7 @@ func testAccSSMContactsContact_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccSSMContactsContact_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1269,6 +1279,7 @@ func testAccSSMContactsContact_tags_DefaultTags_overlapping(t *testing.T) { func testAccSSMContactsContact_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1358,6 +1369,7 @@ func testAccSSMContactsContact_tags_DefaultTags_updateToProviderOnly(t *testing. func testAccSSMContactsContact_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1448,6 +1460,7 @@ func testAccSSMContactsContact_tags_DefaultTags_emptyResourceTag(t *testing.T) { t.Skip("Resource Contact does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1514,6 +1527,7 @@ func testAccSSMContactsContact_tags_DefaultTags_emptyProviderOnlyTag(t *testing. t.Skip("Resource Contact does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1572,6 +1586,7 @@ func testAccSSMContactsContact_tags_DefaultTags_nullOverlappingResourceTag(t *te t.Skip("Resource Contact does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1635,6 +1650,7 @@ func testAccSSMContactsContact_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Contact does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1696,6 +1712,7 @@ func testAccSSMContactsContact_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccSSMContactsContact_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1750,6 +1767,7 @@ func testAccSSMContactsContact_tags_ComputedTag_OnCreate(t *testing.T) { func testAccSSMContactsContact_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1846,6 +1864,7 @@ func testAccSSMContactsContact_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccSSMContactsContact_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1932,6 +1951,7 @@ func testAccSSMContactsContact_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func testAccSSMContactsContact_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2093,6 +2113,7 @@ func testAccSSMContactsContact_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccSSMContactsContact_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_contact.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssmcontacts/rotation.go b/internal/service/ssmcontacts/rotation.go index d1b714e51552..e50959fc6bd2 100644 --- a/internal/service/ssmcontacts/rotation.go +++ b/internal/service/ssmcontacts/rotation.go @@ -42,6 +42,7 @@ const ( // @Testing(serialize=true) // Region override test requires `aws_ssmincidents_replication_set`, which doesn't support region override // @Testing(identityRegionOverrideTest=false) +// @Testing(preIdentityVersion="v5.100.0") func newRotationResource(context.Context) (resource.ResourceWithConfigure, error) { r := &rotationResource{} diff --git a/internal/service/ssmcontacts/rotation_data_source_tags_gen_test.go b/internal/service/ssmcontacts/rotation_data_source_tags_gen_test.go index 7a9091849e8c..a66acc942146 100644 --- a/internal/service/ssmcontacts/rotation_data_source_tags_gen_test.go +++ b/internal/service/ssmcontacts/rotation_data_source_tags_gen_test.go @@ -31,6 +31,7 @@ func testAccSSMContactsRotationDataSource_tagsSerial(t *testing.T) { func testAccSSMContactsRotationDataSource_tags(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -59,6 +60,7 @@ func testAccSSMContactsRotationDataSource_tags(t *testing.T) { func testAccSSMContactsRotationDataSource_tags_NullMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -83,6 +85,7 @@ func testAccSSMContactsRotationDataSource_tags_NullMap(t *testing.T) { func testAccSSMContactsRotationDataSource_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -107,6 +110,7 @@ func testAccSSMContactsRotationDataSource_tags_EmptyMap(t *testing.T) { func testAccSSMContactsRotationDataSource_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -139,6 +143,7 @@ func testAccSSMContactsRotationDataSource_tags_DefaultTags_nonOverlapping(t *tes func testAccSSMContactsRotationDataSource_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -177,6 +182,7 @@ func testAccSSMContactsRotationDataSource_tags_IgnoreTags_Overlap_DefaultTag(t * func testAccSSMContactsRotationDataSource_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + dataSourceName := "data.aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssmcontacts/rotation_identity_gen_test.go b/internal/service/ssmcontacts/rotation_identity_gen_test.go index fb222bed7652..d7e96d1020dd 100644 --- a/internal/service/ssmcontacts/rotation_identity_gen_test.go +++ b/internal/service/ssmcontacts/rotation_identity_gen_test.go @@ -32,10 +32,11 @@ func testAccSSMContactsRotation_IdentitySerial(t *testing.T) { func testAccSSMContactsRotation_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -116,10 +117,11 @@ func testAccSSMContactsRotation_Identity_Basic(t *testing.T) { func testAccSSMContactsRotation_Identity_ExistingResource(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ssmcontacts/rotation_tags_gen_test.go b/internal/service/ssmcontacts/rotation_tags_gen_test.go index 3729d7ca37ff..32ba394961e1 100644 --- a/internal/service/ssmcontacts/rotation_tags_gen_test.go +++ b/internal/service/ssmcontacts/rotation_tags_gen_test.go @@ -46,6 +46,7 @@ func testAccSSMContactsRotation_tagsSerial(t *testing.T) { func testAccSSMContactsRotation_tags(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -229,6 +230,7 @@ func testAccSSMContactsRotation_tags_null(t *testing.T) { t.Skip("Resource Rotation does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -290,6 +292,7 @@ func testAccSSMContactsRotation_tags_null(t *testing.T) { func testAccSSMContactsRotation_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -339,6 +342,7 @@ func testAccSSMContactsRotation_tags_EmptyMap(t *testing.T) { func testAccSSMContactsRotation_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -420,6 +424,7 @@ func testAccSSMContactsRotation_tags_EmptyTag_OnCreate(t *testing.T) { t.Skip("Resource Rotation does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -511,6 +516,7 @@ func testAccSSMContactsRotation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { t.Skip("Resource Rotation does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -651,6 +657,7 @@ func testAccSSMContactsRotation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { t.Skip("Resource Rotation does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -740,6 +747,7 @@ func testAccSSMContactsRotation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func testAccSSMContactsRotation_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -920,6 +928,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_providerOnly(t *testing.T) { func testAccSSMContactsRotation_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1079,6 +1088,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_nonOverlapping(t *testing.T) { func testAccSSMContactsRotation_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1254,6 +1264,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_overlapping(t *testing.T) { func testAccSSMContactsRotation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1343,6 +1354,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_updateToProviderOnly(t *testing func testAccSSMContactsRotation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1433,6 +1445,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_emptyResourceTag(t *testing.T) t.Skip("Resource Rotation does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1500,6 +1513,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_emptyProviderOnlyTag(t *testing t.Skip("Resource Rotation does not support empty tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1559,6 +1573,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_nullOverlappingResourceTag(t *t t.Skip("Resource Rotation does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1629,6 +1644,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_nullNonOverlappingResourceTag(t t.Skip("Resource Rotation does not support null tags") ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1699,6 +1715,7 @@ func testAccSSMContactsRotation_tags_DefaultTags_nullNonOverlappingResourceTag(t func testAccSSMContactsRotation_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1753,6 +1770,7 @@ func testAccSSMContactsRotation_tags_ComputedTag_OnCreate(t *testing.T) { func testAccSSMContactsRotation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1849,6 +1867,7 @@ func testAccSSMContactsRotation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func testAccSSMContactsRotation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1935,6 +1954,7 @@ func testAccSSMContactsRotation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) func testAccSSMContactsRotation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2096,6 +2116,7 @@ func testAccSSMContactsRotation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) func testAccSSMContactsRotation_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssmcontacts_rotation.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/ssmcontacts/service_endpoint_resolver_gen.go b/internal/service/ssmcontacts/service_endpoint_resolver_gen.go index 42d4dd095200..2da43637a287 100644 --- a/internal/service/ssmcontacts/service_endpoint_resolver_gen.go +++ b/internal/service/ssmcontacts/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssmcontacts.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssmcontacts endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssmcontacts endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 7ea4669a6901..2db5511b8b43 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssmincidents/service_endpoint_resolver_gen.go b/internal/service/ssmincidents/service_endpoint_resolver_gen.go index 7569f5b26b3b..a9ec0d6fc96c 100644 --- a/internal/service/ssmincidents/service_endpoint_resolver_gen.go +++ b/internal/service/ssmincidents/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssmincidents.End }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssmincidents endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssmincidents endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 1104077d20f6..837f0d21cf79 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssmquicksetup/service_endpoint_resolver_gen.go b/internal/service/ssmquicksetup/service_endpoint_resolver_gen.go index c2830fd2dff0..5f7987b53eac 100644 --- a/internal/service/ssmquicksetup/service_endpoint_resolver_gen.go +++ b/internal/service/ssmquicksetup/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssmquicksetup.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssmquicksetup endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssmquicksetup endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssmquicksetup/service_endpoints_gen_test.go b/internal/service/ssmquicksetup/service_endpoints_gen_test.go index 7db17efaa322..33cec17ed130 100644 --- a/internal/service/ssmquicksetup/service_endpoints_gen_test.go +++ b/internal/service/ssmquicksetup/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssmsap/service_endpoint_resolver_gen.go b/internal/service/ssmsap/service_endpoint_resolver_gen.go index bb2cb6c76f46..10e408a653c3 100644 --- a/internal/service/ssmsap/service_endpoint_resolver_gen.go +++ b/internal/service/ssmsap/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssmsap.EndpointP }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssmsap endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssmsap endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index d810d7b96549..6f7ace60fed2 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/sso/service_endpoint_resolver_gen.go b/internal/service/sso/service_endpoint_resolver_gen.go index 95ed5d597c30..554798a11407 100644 --- a/internal/service/sso/service_endpoint_resolver_gen.go +++ b/internal/service/sso/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sso.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sso endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sso endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 3384ce400090..5a8842f2eee8 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssoadmin/application_assignment_configuration_identity_gen_test.go b/internal/service/ssoadmin/application_assignment_configuration_identity_gen_test.go index 7ed7f1505303..da6149411244 100644 --- a/internal/service/ssoadmin/application_assignment_configuration_identity_gen_test.go +++ b/internal/service/ssoadmin/application_assignment_configuration_identity_gen_test.go @@ -21,10 +21,11 @@ import ( func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_Basic(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssoadmin_application_assignment_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -113,7 +114,7 @@ func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_RegionOverride(t resourceName := "aws_ssoadmin_application_assignment_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,10 +234,11 @@ func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_RegionOverride(t func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_ExistingResource_fromV5(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssoadmin_application_assignment_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -293,10 +295,11 @@ func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_ExistingResource func TestAccSSOAdminApplicationAssignmentConfiguration_Identity_ExistingResource_fromV6(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_ssoadmin_application_assignment_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ssoadmin/application_identity_gen_test.go b/internal/service/ssoadmin/application_identity_gen_test.go index 596a520a4675..d49f1db73966 100644 --- a/internal/service/ssoadmin/application_identity_gen_test.go +++ b/internal/service/ssoadmin/application_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccSSOAdminApplication_Identity_Basic(t *testing.T) { resourceName := "aws_ssoadmin_application.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -119,7 +119,7 @@ func TestAccSSOAdminApplication_Identity_RegionOverride(t *testing.T) { resourceName := "aws_ssoadmin_application.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -248,7 +248,7 @@ func TestAccSSOAdminApplication_Identity_ExistingResource(t *testing.T) { resourceName := "aws_ssoadmin_application.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/ssoadmin/service_endpoint_resolver_gen.go b/internal/service/ssoadmin/service_endpoint_resolver_gen.go index b05be0b05206..21af504a6558 100644 --- a/internal/service/ssoadmin/service_endpoint_resolver_gen.go +++ b/internal/service/ssoadmin/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params ssoadmin.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up ssoadmin endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up ssoadmin endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index 3bf09b559832..30aaea57a856 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/ssoadmin/trusted_token_issuer.go b/internal/service/ssoadmin/trusted_token_issuer.go index cd0a202b9e33..090c054948ca 100644 --- a/internal/service/ssoadmin/trusted_token_issuer.go +++ b/internal/service/ssoadmin/trusted_token_issuer.go @@ -39,6 +39,7 @@ import ( // @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/ssoadmin;ssoadmin.DescribeTrustedTokenIssuerOutput") // @Testing(preCheckWithRegion="github.com/hashicorp/terraform-provider-aws/internal/acctest;acctest.PreCheckSSOAdminInstancesWithRegion") // @Testing(serialize=true) +// @Testing(preIdentityVersion="v5.100.0") func newTrustedTokenIssuerResource(_ context.Context) (resource.ResourceWithConfigure, error) { return &trustedTokenIssuerResource{}, nil } diff --git a/internal/service/ssoadmin/trusted_token_issuer_identity_gen_test.go b/internal/service/ssoadmin/trusted_token_issuer_identity_gen_test.go index 984632b9691f..156a5a82a6f2 100644 --- a/internal/service/ssoadmin/trusted_token_issuer_identity_gen_test.go +++ b/internal/service/ssoadmin/trusted_token_issuer_identity_gen_test.go @@ -39,7 +39,7 @@ func testAccSSOAdminTrustedTokenIssuer_Identity_Basic(t *testing.T) { resourceName := "aws_ssoadmin_trusted_token_issuer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -128,7 +128,7 @@ func testAccSSOAdminTrustedTokenIssuer_Identity_RegionOverride(t *testing.T) { resourceName := "aws_ssoadmin_trusted_token_issuer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -253,7 +253,7 @@ func testAccSSOAdminTrustedTokenIssuer_Identity_ExistingResource(t *testing.T) { resourceName := "aws_ssoadmin_trusted_token_issuer.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/storagegateway/cache_test.go b/internal/service/storagegateway/cache_test.go index a53ceed120c4..0474a448e1cd 100644 --- a/internal/service/storagegateway/cache_test.go +++ b/internal/service/storagegateway/cache_test.go @@ -153,7 +153,7 @@ func testAccCheckCacheExists(ctx context.Context, n string) resource.TestCheckFu } func testAccCacheConfig_fileGateway(rName string) string { - return acctest.ConfigCompose(testAccGatewayConfig_typeFileS3(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_typeFileS3(rName, rName), fmt.Sprintf(` resource "aws_ebs_volume" "test" { availability_zone = aws_instance.test.availability_zone size = "10" diff --git a/internal/service/storagegateway/errors.go b/internal/service/storagegateway/errors.go index 99f064a8cf40..0a911feefdc7 100644 --- a/internal/service/storagegateway/errors.go +++ b/internal/service/storagegateway/errors.go @@ -14,7 +14,6 @@ import ( const ( operationErrCodeFileShareNotFound awstypes.ErrorCode = "FileShareNotFound" operationErrCodeFileSystemAssociationNotFound awstypes.ErrorCode = "FileSystemAssociationNotFound" - operationErrCodeGatewayNotFound awstypes.ErrorCode = "GatewayNotFound" ) // operationErrorCode returns the operation error code from the specified error: @@ -34,9 +33,26 @@ func operationErrorCode(err error) awstypes.ErrorCode { return "" } +// The API returns multiple responses for a disconnected gateway. +func isGatewayNotConnectedErr(err error) bool { + if operationErrorCode(err) == awstypes.ErrorCodeGatewayNotConnected { + return true + } + + if tfawserr.ErrCodeEquals(err, string(awstypes.ErrorCodeGatewayNotConnected)) { + return true + } + + if errs.IsAErrorMessageContains[*awstypes.InvalidGatewayRequestException](err, "The specified gateway is not connected") { + return true + } + + return false +} + // The API returns multiple responses for a missing gateway. func isGatewayNotFoundErr(err error) bool { - if operationErrorCode(err) == operationErrCodeGatewayNotFound { + if operationErrorCode(err) == awstypes.ErrorCodeGatewayNotFound { return true } diff --git a/internal/service/storagegateway/exports_test.go b/internal/service/storagegateway/exports_test.go index 83ae1d93f243..dea67e85b820 100644 --- a/internal/service/storagegateway/exports_test.go +++ b/internal/service/storagegateway/exports_test.go @@ -19,6 +19,7 @@ var ( FindCachediSCSIVolumeByARN = findCachediSCSIVolumeByARN FindFileSystemAssociationByARN = findFileSystemAssociationByARN FindGatewayByARN = findGatewayByARN + FindGatewayInfoByARN = findGatewayInfoByARN FindNFSFileShareByARN = findNFSFileShareByARN FindSMBFileShareByARN = findSMBFileShareByARN FindStorediSCSIVolumeByARN = findStorediSCSIVolumeByARN diff --git a/internal/service/storagegateway/gateway.go b/internal/service/storagegateway/gateway.go index d5de019b38a7..12d1aa2499d6 100644 --- a/internal/service/storagegateway/gateway.go +++ b/internal/service/storagegateway/gateway.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" + tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -351,7 +352,7 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any } name := d.Get("gateway_name").(string) - input := &storagegateway.ActivateGatewayInput{ + input := storagegateway.ActivateGatewayInput{ ActivationKey: aws.String(activationKey), GatewayRegion: aws.String(region), GatewayName: aws.String(name), @@ -368,7 +369,7 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any input.TapeDriveType = aws.String(v.(string)) } - output, err := conn.ActivateGateway(ctx, input) + output, err := conn.ActivateGateway(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "activating Storage Gateway Gateway (%s): %s", name, err) @@ -376,17 +377,17 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any d.SetId(aws.ToString(output.GatewayARN)) - if _, err = waitGatewayConnected(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + if _, err := waitGatewayConnected(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return sdkdiag.AppendErrorf(diags, "waiting for Storage Gateway Gateway (%s) connect: %s", d.Id(), err) } if v, ok := d.GetOk(names.AttrCloudWatchLogGroupARN); ok && v.(string) != "" { - input := &storagegateway.UpdateGatewayInformationInput{ + input := storagegateway.UpdateGatewayInformationInput{ CloudWatchLogGroupARN: aws.String(v.(string)), GatewayARN: aws.String(d.Id()), } - _, err := conn.UpdateGatewayInformation(ctx, input) + _, err := conn.UpdateGatewayInformation(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) CloudWatch log group: %s", d.Id(), err) @@ -419,12 +420,12 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any } if v, ok := d.GetOk("smb_guest_password"); ok && v.(string) != "" { - input := &storagegateway.SetSMBGuestPasswordInput{ + input := storagegateway.SetSMBGuestPasswordInput{ GatewayARN: aws.String(d.Id()), Password: aws.String(v.(string)), } - _, err := conn.SetSMBGuestPassword(ctx, input) + _, err := conn.SetSMBGuestPassword(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "setting Storage Gateway Gateway (%s) SMB guest password: %s", d.Id(), err) @@ -432,12 +433,12 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any } if v, ok := d.GetOk("smb_security_strategy"); ok { - input := &storagegateway.UpdateSMBSecurityStrategyInput{ + input := storagegateway.UpdateSMBSecurityStrategyInput{ GatewayARN: aws.String(d.Id()), SMBSecurityStrategy: awstypes.SMBSecurityStrategy(v.(string)), } - _, err := conn.UpdateSMBSecurityStrategy(ctx, input) + _, err := conn.UpdateSMBSecurityStrategy(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "setting Storage Gateway Gateway (%s) SMB security strategy: %s", d.Id(), err) @@ -445,12 +446,12 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any } if v, ok := d.GetOk("smb_file_share_visibility"); ok { - input := &storagegateway.UpdateSMBFileShareVisibilityInput{ + input := storagegateway.UpdateSMBFileShareVisibilityInput{ FileSharesVisible: aws.Bool(v.(bool)), GatewayARN: aws.String(d.Id()), } - _, err := conn.UpdateSMBFileShareVisibility(ctx, input) + _, err := conn.UpdateSMBFileShareVisibility(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) SMB file share visibility: %s", d.Id(), err) @@ -459,7 +460,7 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any switch d.Get("gateway_type").(string) { case gatewayTypeCached, gatewayTypeStored, gatewayTypeVTL, gatewayTypeVTLSnow: - input := &storagegateway.UpdateBandwidthRateLimitInput{ + input := storagegateway.UpdateBandwidthRateLimitInput{ GatewayARN: aws.String(d.Id()), } @@ -472,7 +473,7 @@ func resourceGatewayCreate(ctx context.Context, d *schema.ResourceData, meta any } if input.AverageDownloadRateLimitInBitsPerSec != nil || input.AverageUploadRateLimitInBitsPerSec != nil { - _, err := conn.UpdateBandwidthRateLimit(ctx, input) + _, err := conn.UpdateBandwidthRateLimit(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) bandwidth rate limits: %s", d.Id(), err) @@ -495,6 +496,18 @@ func resourceGatewayRead(ctx context.Context, d *schema.ResourceData, meta any) return diags } + if isGatewayNotConnectedErr(err) { + if gatewayInfo, err := findGatewayInfoByARN(ctx, conn, d.Id()); err == nil { + d.Set(names.AttrARN, gatewayInfo.GatewayARN) + d.Set("ec2_instance_id", gatewayInfo.Ec2InstanceId) + d.Set("gateway_name", gatewayInfo.GatewayName) + d.Set("gateway_type", gatewayInfo.GatewayType) + d.Set("host_environment", gatewayInfo.HostEnvironment) + + return diags + } + } + if err != nil { return sdkdiag.AppendErrorf(diags, "reading Storage Gateway Gateway (%s): %s", d.Id(), err) } @@ -570,11 +583,7 @@ func resourceGatewayRead(ctx context.Context, d *schema.ResourceData, meta any) switch aws.ToString(outputDGI.GatewayType) { case gatewayTypeCached, gatewayTypeStored, gatewayTypeVTL, gatewayTypeVTLSnow: - input := &storagegateway.DescribeBandwidthRateLimitInput{ - GatewayARN: aws.String(d.Id()), - } - - outputDBRL, err := conn.DescribeBandwidthRateLimit(ctx, input) + outputDBRL, err := findBandwidthRateLimitByARN(ctx, conn, d.Id()) switch { case errs.IsAErrorMessageContains[*awstypes.InvalidGatewayRequestException](err, "not supported"): @@ -587,11 +596,7 @@ func resourceGatewayRead(ctx context.Context, d *schema.ResourceData, meta any) } } - input := &storagegateway.DescribeMaintenanceStartTimeInput{ - GatewayARN: aws.String(d.Id()), - } - - outputDMST, err := conn.DescribeMaintenanceStartTime(ctx, input) + outputDMST, err := findMaintenanceStartTimeByARN(ctx, conn, d.Id()) switch { case errs.IsAErrorMessageContains[*awstypes.InvalidGatewayRequestException](err, "The specified operation is not supported"): @@ -614,14 +619,14 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).StorageGatewayClient(ctx) if d.HasChanges(names.AttrCloudWatchLogGroupARN, "gateway_name", "gateway_timezone") { - input := &storagegateway.UpdateGatewayInformationInput{ + input := storagegateway.UpdateGatewayInformationInput{ CloudWatchLogGroupARN: aws.String(d.Get(names.AttrCloudWatchLogGroupARN).(string)), GatewayARN: aws.String(d.Id()), GatewayName: aws.String(d.Get("gateway_name").(string)), GatewayTimezone: aws.String(d.Get("gateway_timezone").(string)), } - _, err := conn.UpdateGatewayInformation(ctx, input) + _, err := conn.UpdateGatewayInformation(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s): %s", d.Id(), err) @@ -656,12 +661,12 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChange("smb_guest_password") { - input := &storagegateway.SetSMBGuestPasswordInput{ + input := storagegateway.SetSMBGuestPasswordInput{ GatewayARN: aws.String(d.Id()), Password: aws.String(d.Get("smb_guest_password").(string)), } - _, err := conn.SetSMBGuestPassword(ctx, input) + _, err := conn.SetSMBGuestPassword(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "setting Storage Gateway Gateway (%s) SMB guest password: %s", d.Id(), err) @@ -669,12 +674,12 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChange("smb_security_strategy") { - input := &storagegateway.UpdateSMBSecurityStrategyInput{ + input := storagegateway.UpdateSMBSecurityStrategyInput{ GatewayARN: aws.String(d.Id()), SMBSecurityStrategy: awstypes.SMBSecurityStrategy(d.Get("smb_security_strategy").(string)), } - _, err := conn.UpdateSMBSecurityStrategy(ctx, input) + _, err := conn.UpdateSMBSecurityStrategy(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) SMB security strategy: %s", d.Id(), err) @@ -682,12 +687,12 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChange("smb_file_share_visibility") { - input := &storagegateway.UpdateSMBFileShareVisibilityInput{ + input := storagegateway.UpdateSMBFileShareVisibilityInput{ FileSharesVisible: aws.Bool(d.Get("smb_file_share_visibility").(bool)), GatewayARN: aws.String(d.Id()), } - _, err := conn.UpdateSMBFileShareVisibility(ctx, input) + _, err := conn.UpdateSMBFileShareVisibility(ctx, &input) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) SMB file share visibility: %s", d.Id(), err) @@ -695,11 +700,11 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if d.HasChanges("average_download_rate_limit_in_bits_per_sec", "average_upload_rate_limit_in_bits_per_sec") { - inputD := &storagegateway.DeleteBandwidthRateLimitInput{ + inputD := storagegateway.DeleteBandwidthRateLimitInput{ GatewayARN: aws.String(d.Id()), } needsDelete := false - inputU := &storagegateway.UpdateBandwidthRateLimitInput{ + inputU := storagegateway.UpdateBandwidthRateLimitInput{ GatewayARN: aws.String(d.Id()), } needsUpdate := false @@ -725,7 +730,7 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if needsUpdate { - _, err := conn.UpdateBandwidthRateLimit(ctx, inputU) + _, err := conn.UpdateBandwidthRateLimit(ctx, &inputU) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Storage Gateway Gateway (%s) bandwidth rate limits: %s", d.Id(), err) @@ -733,7 +738,7 @@ func resourceGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta any } if needsDelete { - _, err := conn.DeleteBandwidthRateLimit(ctx, inputD) + _, err := conn.DeleteBandwidthRateLimit(ctx, &inputD) if err != nil { return sdkdiag.AppendErrorf(diags, "deleting Storage Gateway Gateway (%s) bandwidth rate limits: %s", d.Id(), err) @@ -749,9 +754,10 @@ func resourceGatewayDelete(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).StorageGatewayClient(ctx) log.Printf("[DEBUG] Deleting Storage Gateway Gateway: %s", d.Id()) - _, err := conn.DeleteGateway(ctx, &storagegateway.DeleteGatewayInput{ + input := storagegateway.DeleteGatewayInput{ GatewayARN: aws.String(d.Id()), - }) + } + _, err := conn.DeleteGateway(ctx, &input) if isGatewayNotFoundErr(err) { return diags @@ -765,11 +771,11 @@ func resourceGatewayDelete(ctx context.Context, d *schema.ResourceData, meta any } func findGatewayByARN(ctx context.Context, conn *storagegateway.Client, arn string) (*storagegateway.DescribeGatewayInformationOutput, error) { - input := &storagegateway.DescribeGatewayInformationInput{ + input := storagegateway.DescribeGatewayInformationInput{ GatewayARN: aws.String(arn), } - return findGateway(ctx, conn, input) + return findGateway(ctx, conn, &input) } func findGateway(ctx context.Context, conn *storagegateway.Client, input *storagegateway.DescribeGatewayInformationInput) (*storagegateway.DescribeGatewayInformationOutput, error) { @@ -793,12 +799,51 @@ func findGateway(ctx context.Context, conn *storagegateway.Client, input *storag return output, nil } +func findGatewayInfoByARN(ctx context.Context, conn *storagegateway.Client, arn string) (*awstypes.GatewayInfo, error) { + var input storagegateway.ListGatewaysInput + + return findGatewayInfo(ctx, conn, &input, func(v *awstypes.GatewayInfo) bool { + return aws.ToString(v.GatewayARN) == arn + }) +} + +func findGatewayInfo(ctx context.Context, conn *storagegateway.Client, input *storagegateway.ListGatewaysInput, filter tfslices.Predicate[*awstypes.GatewayInfo]) (*awstypes.GatewayInfo, error) { + output, err := findGateways(ctx, conn, input, filter) + + if err != nil { + return nil, err + } + + return tfresource.AssertSingleValueResult(output) +} + +func findGateways(ctx context.Context, conn *storagegateway.Client, input *storagegateway.ListGatewaysInput, filter tfslices.Predicate[*awstypes.GatewayInfo]) ([]awstypes.GatewayInfo, error) { + var output []awstypes.GatewayInfo + + pages := storagegateway.NewListGatewaysPaginator(conn, input) + for pages.HasMorePages() { + page, err := pages.NextPage(ctx) + + if err != nil { + return nil, err + } + + for _, v := range page.Gateways { + if filter(&v) { + output = append(output, v) + } + } + } + + return output, nil +} + func findSMBSettingsByARN(ctx context.Context, conn *storagegateway.Client, arn string) (*storagegateway.DescribeSMBSettingsOutput, error) { - input := &storagegateway.DescribeSMBSettingsInput{ + input := storagegateway.DescribeSMBSettingsInput{ GatewayARN: aws.String(arn), } - return findSMBSettings(ctx, conn, input) + return findSMBSettings(ctx, conn, &input) } func findSMBSettings(ctx context.Context, conn *storagegateway.Client, input *storagegateway.DescribeSMBSettingsInput) (*storagegateway.DescribeSMBSettingsOutput, error) { @@ -822,6 +867,64 @@ func findSMBSettings(ctx context.Context, conn *storagegateway.Client, input *st return output, nil } +func findBandwidthRateLimitByARN(ctx context.Context, conn *storagegateway.Client, arn string) (*storagegateway.DescribeBandwidthRateLimitOutput, error) { + input := storagegateway.DescribeBandwidthRateLimitInput{ + GatewayARN: aws.String(arn), + } + + return findBandwidthRateLimit(ctx, conn, &input) +} + +func findBandwidthRateLimit(ctx context.Context, conn *storagegateway.Client, input *storagegateway.DescribeBandwidthRateLimitInput) (*storagegateway.DescribeBandwidthRateLimitOutput, error) { + output, err := conn.DescribeBandwidthRateLimit(ctx, input) + + if isGatewayNotFoundErr(err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + +func findMaintenanceStartTimeByARN(ctx context.Context, conn *storagegateway.Client, arn string) (*storagegateway.DescribeMaintenanceStartTimeOutput, error) { + input := storagegateway.DescribeMaintenanceStartTimeInput{ + GatewayARN: aws.String(arn), + } + + return findMaintenanceStartTime(ctx, conn, &input) +} + +func findMaintenanceStartTime(ctx context.Context, conn *storagegateway.Client, input *storagegateway.DescribeMaintenanceStartTimeInput) (*storagegateway.DescribeMaintenanceStartTimeOutput, error) { + output, err := conn.DescribeMaintenanceStartTime(ctx, input) + + if isGatewayNotFoundErr(err) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + const ( gatewayStatusConnected = "GatewayConnected" gatewayStatusNotConnected = "GatewayNotConnected" @@ -835,7 +938,7 @@ func statusGatewayConnected(ctx context.Context, conn *storagegateway.Client, ga return nil, "", nil } - if errs.IsAErrorMessageContains[*awstypes.InvalidGatewayRequestException](err, "The specified gateway is not connected") { + if isGatewayNotConnectedErr(err) { return output, gatewayStatusNotConnected, nil } diff --git a/internal/service/storagegateway/gateway_test.go b/internal/service/storagegateway/gateway_test.go index d099f8afc05a..8afdb7dcf284 100644 --- a/internal/service/storagegateway/gateway_test.go +++ b/internal/service/storagegateway/gateway_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/YakDriver/regexache" - "github.com/aws/aws-sdk-go-v2/service/storagegateway" + awstypes "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -23,7 +23,7 @@ import ( func TestAccStorageGatewayGateway_GatewayType_cached(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -66,7 +66,7 @@ func TestAccStorageGatewayGateway_GatewayType_cached(t *testing.T) { func TestAccStorageGatewayGateway_GatewayType_fileFSxSMB(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -109,7 +109,7 @@ func TestAccStorageGatewayGateway_GatewayType_fileFSxSMB(t *testing.T) { func TestAccStorageGatewayGateway_GatewayType_fileS3(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -120,7 +120,7 @@ func TestAccStorageGatewayGateway_GatewayType_fileS3(t *testing.T) { CheckDestroy: testAccCheckGatewayDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGatewayConfig_typeFileS3(rName), + Config: testAccGatewayConfig_typeFileS3(rName, rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGatewayExists(ctx, resourceName, &gateway), acctest.MatchResourceAttrRegionalARN(ctx, resourceName, names.AttrARN, "storagegateway", regexache.MustCompile(`gateway/sgw-.+`)), @@ -152,7 +152,7 @@ func TestAccStorageGatewayGateway_GatewayType_fileS3(t *testing.T) { func TestAccStorageGatewayGateway_GatewayType_stored(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -195,7 +195,7 @@ func TestAccStorageGatewayGateway_GatewayType_stored(t *testing.T) { func TestAccStorageGatewayGateway_GatewayType_vtl(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -236,7 +236,7 @@ func TestAccStorageGatewayGateway_GatewayType_vtl(t *testing.T) { func TestAccStorageGatewayGateway_tags(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -284,9 +284,10 @@ func TestAccStorageGatewayGateway_tags(t *testing.T) { func TestAccStorageGatewayGateway_gatewayName(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput - rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + var gateway awstypes.GatewayInfo + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rNameGateway1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rNameGateway2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ @@ -296,17 +297,17 @@ func TestAccStorageGatewayGateway_gatewayName(t *testing.T) { CheckDestroy: testAccCheckGatewayDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGatewayConfig_typeFileS3(rName1), + Config: testAccGatewayConfig_typeFileS3(rName, rNameGateway1), Check: resource.ComposeTestCheckFunc( testAccCheckGatewayExists(ctx, resourceName, &gateway), - resource.TestCheckResourceAttr(resourceName, "gateway_name", rName1), + resource.TestCheckResourceAttr(resourceName, "gateway_name", rNameGateway1), ), }, { - Config: testAccGatewayConfig_typeFileS3(rName2), + Config: testAccGatewayConfig_typeFileS3(rName, rNameGateway2), Check: resource.ComposeTestCheckFunc( testAccCheckGatewayExists(ctx, resourceName, &gateway), - resource.TestCheckResourceAttr(resourceName, "gateway_name", rName2), + resource.TestCheckResourceAttr(resourceName, "gateway_name", rNameGateway2), ), }, { @@ -321,7 +322,7 @@ func TestAccStorageGatewayGateway_gatewayName(t *testing.T) { func TestAccStorageGatewayGateway_cloudWatchLogs(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" resourceName2 := "aws_cloudwatch_log_group.test" @@ -351,7 +352,7 @@ func TestAccStorageGatewayGateway_cloudWatchLogs(t *testing.T) { func TestAccStorageGatewayGateway_gatewayTimezone(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -387,7 +388,7 @@ func TestAccStorageGatewayGateway_gatewayTimezone(t *testing.T) { func TestAccStorageGatewayGateway_gatewayVPCEndpoint(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" vpcEndpointResourceName := "aws_vpc_endpoint.test" @@ -417,7 +418,7 @@ func TestAccStorageGatewayGateway_gatewayVPCEndpoint(t *testing.T) { func TestAccStorageGatewayGateway_smbActiveDirectorySettings(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" domainName := acctest.RandomDomainName() @@ -450,7 +451,7 @@ func TestAccStorageGatewayGateway_smbActiveDirectorySettings(t *testing.T) { func TestAccStorageGatewayGateway_SMBActiveDirectorySettings_timeout(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" domainName := acctest.RandomDomainName() @@ -482,7 +483,7 @@ func TestAccStorageGatewayGateway_SMBActiveDirectorySettings_timeout(t *testing. func TestAccStorageGatewayGateway_smbMicrosoftActiveDirectorySettings(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" domainName := acctest.RandomDomainName() @@ -516,7 +517,7 @@ func TestAccStorageGatewayGateway_smbMicrosoftActiveDirectorySettings(t *testing func TestAccStorageGatewayGateway_SMBMicrosoftActiveDirectorySettings_timeout(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" domainName := acctest.RandomDomainName() @@ -548,7 +549,7 @@ func TestAccStorageGatewayGateway_SMBMicrosoftActiveDirectorySettings_timeout(t func TestAccStorageGatewayGateway_smbGuestPassword(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -584,7 +585,7 @@ func TestAccStorageGatewayGateway_smbGuestPassword(t *testing.T) { func TestAccStorageGatewayGateway_smbSecurityStrategy(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -621,7 +622,7 @@ func TestAccStorageGatewayGateway_smbSecurityStrategy(t *testing.T) { func TestAccStorageGatewayGateway_smbVisibility(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -664,7 +665,7 @@ func TestAccStorageGatewayGateway_smbVisibility(t *testing.T) { func TestAccStorageGatewayGateway_disappears(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -688,7 +689,7 @@ func TestAccStorageGatewayGateway_disappears(t *testing.T) { func TestAccStorageGatewayGateway_bandwidthUpload(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -731,7 +732,7 @@ func TestAccStorageGatewayGateway_bandwidthUpload(t *testing.T) { func TestAccStorageGatewayGateway_bandwidthDownload(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -774,7 +775,7 @@ func TestAccStorageGatewayGateway_bandwidthDownload(t *testing.T) { func TestAccStorageGatewayGateway_bandwidthAll(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -820,7 +821,7 @@ func TestAccStorageGatewayGateway_bandwidthAll(t *testing.T) { func TestAccStorageGatewayGateway_maintenanceStartTime(t *testing.T) { ctx := acctest.Context(t) - var gateway storagegateway.DescribeGatewayInformationOutput + var gateway awstypes.GatewayInfo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_storagegateway_gateway.test" @@ -871,6 +872,36 @@ func TestAccStorageGatewayGateway_maintenanceStartTime(t *testing.T) { }) } +// https://github.com/hashicorp/terraform-provider-aws/issues/27523. +func TestAccStorageGatewayGateway_offline(t *testing.T) { + ctx := acctest.Context(t) + var gateway awstypes.GatewayInfo + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_storagegateway_gateway.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.StorageGatewayServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGatewayDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGatewayConfig_typeCached(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckGatewayExists(ctx, resourceName, &gateway), + ), + }, + { + Config: testAccGatewayConfig_offline(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckGatewayExists(ctx, resourceName, &gateway), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckGatewayDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).StorageGatewayClient(ctx) @@ -897,7 +928,7 @@ func testAccCheckGatewayDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccCheckGatewayExists(ctx context.Context, n string, v *storagegateway.DescribeGatewayInformationOutput) resource.TestCheckFunc { +func testAccCheckGatewayExists(ctx context.Context, n string, v *awstypes.GatewayInfo) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -906,7 +937,7 @@ func testAccCheckGatewayExists(ctx context.Context, n string, v *storagegateway. conn := acctest.Provider.Meta().(*conns.AWSClient).StorageGatewayClient(ctx) - output, err := tfstoragegateway.FindGatewayByARN(ctx, conn, rs.Primary.ID) + output, err := tfstoragegateway.FindGatewayInfoByARN(ctx, conn, rs.Primary.ID) if err != nil { return err @@ -979,7 +1010,7 @@ resource "aws_security_group" "test" { `, rName)) } -func testAccGatewayConfig_baseFile(rName string) string { +func testAccGatewayConfig_baseFileS3(rName string) string { return acctest.ConfigCompose( testAccGatewayConfig_baseVPC(rName), // Reference: https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html @@ -1006,6 +1037,33 @@ resource "aws_instance" "test" { `, rName)) } +func testAccGatewayConfig_baseFileFSx(rName string) string { + return acctest.ConfigCompose( + testAccGatewayConfig_baseVPC(rName), + // Reference: https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html + acctest.AvailableEC2InstanceTypeForAvailabilityZone("aws_subnet.test.availability_zone", "m5.xlarge", "m4.xlarge"), + fmt.Sprintf(` +# Reference: https://docs.aws.amazon.com/storagegateway/latest/userguide/ec2-gateway-file.html +data "aws_ssm_parameter" "aws_service_storagegateway_ami_FILE_FSX_SMB_latest" { + name = "/aws/service/storagegateway/ami/FILE_FSX_SMB/latest" +} + +resource "aws_instance" "test" { + depends_on = [aws_route.test] + + ami = data.aws_ssm_parameter.aws_service_storagegateway_ami_FILE_FSX_SMB_latest.value + associate_public_ip_address = true + instance_type = data.aws_ec2_instance_type_offering.available.instance_type + vpc_security_group_ids = [aws_security_group.test.id] + subnet_id = aws_subnet.test.id + + tags = { + Name = %[1]q + } +} +`, rName)) +} + func testAccGatewayConfig_baseTapeAndVolume(rName string) string { return acctest.ConfigCompose( testAccGatewayConfig_baseVPC(rName), @@ -1046,7 +1104,7 @@ resource "aws_storagegateway_gateway" "test" { } func testAccGatewayConfig_typeFileFSxSMB(rName string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileFSx(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q @@ -1056,19 +1114,19 @@ resource "aws_storagegateway_gateway" "test" { `, rName)) } -func testAccGatewayConfig_typeFileS3(rName string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` +func testAccGatewayConfig_typeFileS3(rName, gatewayName string) string { + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q gateway_timezone = "GMT" gateway_type = "FILE_S3" } -`, rName)) +`, gatewayName)) } func testAccGatewayConfig_logGroup(rName string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_cloudwatch_log_group" "test" { name = %[1]q } @@ -1106,7 +1164,7 @@ resource "aws_storagegateway_gateway" "test" { } func testAccGatewayConfig_timezone(rName, gatewayTimezone string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q @@ -1367,7 +1425,7 @@ resource "aws_storagegateway_gateway" "test" { } func testAccGatewayConfig_smbGuestPassword(rName, smbGuestPassword string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q @@ -1379,7 +1437,7 @@ resource "aws_storagegateway_gateway" "test" { } func testAccGatewayConfig_smbSecurityStrategy(rName, strategy string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q @@ -1391,7 +1449,7 @@ resource "aws_storagegateway_gateway" "test" { } func testAccGatewayConfig_smbVisibility(rName string, visible bool) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { gateway_ip_address = aws_instance.test.public_ip gateway_name = %[1]q @@ -1494,3 +1552,13 @@ resource "aws_storagegateway_gateway" "test" { } `, rName, hourOfDay, minuteOfHour, dayOfWeek, dayOfMonth)) } + +func testAccGatewayConfig_offline(rName string) string { + return acctest.ConfigCompose(testAccGatewayConfig_typeCached(rName), ` +resource "aws_ec2_instance_state" "test" { + instance_id = aws_instance.test.id + state = "stopped" + force = true +} +`) +} diff --git a/internal/service/storagegateway/local_disk_data_source_test.go b/internal/service/storagegateway/local_disk_data_source_test.go index a97cd02e8bf3..ddf59915132a 100644 --- a/internal/service/storagegateway/local_disk_data_source_test.go +++ b/internal/service/storagegateway/local_disk_data_source_test.go @@ -68,7 +68,7 @@ func TestAccStorageGatewayLocalDiskDataSource_diskPath(t *testing.T) { func testAccLocalDiskDataSourceConfig_base(rName string) string { return acctest.ConfigCompose( - testAccGatewayConfig_typeFileS3(rName), + testAccGatewayConfig_typeFileS3(rName, rName), fmt.Sprintf(` resource "aws_ebs_volume" "test" { availability_zone = aws_instance.test.availability_zone diff --git a/internal/service/storagegateway/nfs_file_share_test.go b/internal/service/storagegateway/nfs_file_share_test.go index 8db2c66f0dbb..b40d91befb5a 100644 --- a/internal/service/storagegateway/nfs_file_share_test.go +++ b/internal/service/storagegateway/nfs_file_share_test.go @@ -731,7 +731,7 @@ func testAccCheckNFSFileShareExists(ctx context.Context, n string, v *awstypes.N } func testAccNFSFileShareConfig_baseS3(rName string) string { - return acctest.ConfigCompose(testAccGatewayConfig_baseFile(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccGatewayConfig_baseFileS3(rName), fmt.Sprintf(` resource "aws_iam_role" "test" { name = %[1]q diff --git a/internal/service/storagegateway/service_endpoint_resolver_gen.go b/internal/service/storagegateway/service_endpoint_resolver_gen.go index 53a0721391a2..46fb7e873ce3 100644 --- a/internal/service/storagegateway/service_endpoint_resolver_gen.go +++ b/internal/service/storagegateway/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params storagegateway.E }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up storagegateway endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up storagegateway endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index 03c531a5ecae..3c3b1783424d 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/storagegateway/smb_file_share.go b/internal/service/storagegateway/smb_file_share.go index 4fe718d9401d..b0ee77406062 100644 --- a/internal/service/storagegateway/smb_file_share.go +++ b/internal/service/storagegateway/smb_file_share.go @@ -319,7 +319,7 @@ func resourceSMBFileShareRead(ctx context.Context, d *schema.ResourceData, meta } d.Set("access_based_enumeration", fileshare.AccessBasedEnumeration) - d.Set("admin_user_list", aws.StringSlice(fileshare.AdminUserList)) + d.Set("admin_user_list", fileshare.AdminUserList) d.Set(names.AttrARN, fileshare.FileShareARN) d.Set("audit_destination_arn", fileshare.AuditDestinationARN) d.Set("authentication", fileshare.Authentication) @@ -337,7 +337,7 @@ func resourceSMBFileShareRead(ctx context.Context, d *schema.ResourceData, meta d.Set("file_share_name", fileshare.FileShareName) d.Set("gateway_arn", fileshare.GatewayARN) d.Set("guess_mime_type_enabled", fileshare.GuessMIMETypeEnabled) - d.Set("invalid_user_list", aws.StringSlice(fileshare.InvalidUserList)) + d.Set("invalid_user_list", fileshare.InvalidUserList) d.Set("kms_encrypted", fileshare.KMSEncrypted) //nolint:staticcheck // deprecated by AWS, but must remain for backward compatibility d.Set(names.AttrKMSKeyARN, fileshare.KMSKey) d.Set("location_arn", fileshare.LocationARN) @@ -349,7 +349,7 @@ func resourceSMBFileShareRead(ctx context.Context, d *schema.ResourceData, meta d.Set("requester_pays", fileshare.RequesterPays) d.Set(names.AttrRoleARN, fileshare.Role) d.Set("smb_acl_enabled", fileshare.SMBACLEnabled) - d.Set("valid_user_list", aws.StringSlice(fileshare.ValidUserList)) + d.Set("valid_user_list", fileshare.ValidUserList) d.Set("vpc_endpoint_dns_name", fileshare.VPCEndpointDNSName) setTagsOut(ctx, fileshare.Tags) diff --git a/internal/service/sts/service_endpoint_resolver_gen.go b/internal/service/sts/service_endpoint_resolver_gen.go index a004a0d5457b..6e2c9c3ea911 100644 --- a/internal/service/sts/service_endpoint_resolver_gen.go +++ b/internal/service/sts/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params sts.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up sts endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up sts endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index 93831e69cd49..c134e51647b2 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -659,7 +659,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/swf/service_endpoint_resolver_gen.go b/internal/service/swf/service_endpoint_resolver_gen.go index 42f649d27d2b..537b2bb7e386 100644 --- a/internal/service/swf/service_endpoint_resolver_gen.go +++ b/internal/service/swf/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params swf.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up swf endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up swf endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index 72b2922f62a1..f517e5999474 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -523,7 +523,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/synthetics/service_endpoint_resolver_gen.go b/internal/service/synthetics/service_endpoint_resolver_gen.go index c9f76544d5c2..c2c5bb5924ea 100644 --- a/internal/service/synthetics/service_endpoint_resolver_gen.go +++ b/internal/service/synthetics/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params synthetics.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up synthetics endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up synthetics endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index 646cf8a7fe16..a0e57a9d0e04 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/taxsettings/service_endpoint_resolver_gen.go b/internal/service/taxsettings/service_endpoint_resolver_gen.go index ec3e69fc5394..5fd9a8163ea4 100644 --- a/internal/service/taxsettings/service_endpoint_resolver_gen.go +++ b/internal/service/taxsettings/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params taxsettings.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up taxsettings endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up taxsettings endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/taxsettings/service_endpoints_gen_test.go b/internal/service/taxsettings/service_endpoints_gen_test.go index 08c2bb5380fa..6d858cc22aa7 100644 --- a/internal/service/taxsettings/service_endpoints_gen_test.go +++ b/internal/service/taxsettings/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/timestreaminfluxdb/db_instance.go b/internal/service/timestreaminfluxdb/db_instance.go index 185b45cace9a..aeb77f75fe40 100644 --- a/internal/service/timestreaminfluxdb/db_instance.go +++ b/internal/service/timestreaminfluxdb/db_instance.go @@ -183,7 +183,7 @@ func (r *dbInstanceResource) Schema(ctx context.Context, req resource.SchemaRequ Optional: true, Computed: true, PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), + stringplanmodifier.RequiresReplaceIfConfigured(), stringplanmodifier.UseStateForUnknown(), }, Description: `Specifies whether the networkType of the Timestream for InfluxDB instance is @@ -501,6 +501,8 @@ func (r *dbInstanceResource) Update(ctx context.Context, req resource.UpdateRequ plan.SecondaryAvailabilityZone = fwflex.StringToFrameworkLegacy(ctx, output.SecondaryAvailabilityZone) } else { + plan.NetworkType = state.NetworkType + plan.Port = state.Port plan.SecondaryAvailabilityZone = state.SecondaryAvailabilityZone } diff --git a/internal/service/timestreaminfluxdb/db_instance_tags_gen_test.go b/internal/service/timestreaminfluxdb/db_instance_tags_gen_test.go index 909bf918894f..2e5e78fbe989 100644 --- a/internal/service/timestreaminfluxdb/db_instance_tags_gen_test.go +++ b/internal/service/timestreaminfluxdb/db_instance_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccTimestreamInfluxDBDBInstance_tags(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -212,6 +213,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags(t *testing.T) { func TestAccTimestreamInfluxDBDBInstance_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -275,6 +277,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_null(t *testing.T) { func TestAccTimestreamInfluxDBDBInstance_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -326,6 +329,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_EmptyMap(t *testing.T) { func TestAccTimestreamInfluxDBDBInstance_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -409,6 +413,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_AddOnUpdate(t *testing.T) { func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -505,6 +510,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -650,6 +656,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnUpdate_Add(t *testing.T func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -743,6 +750,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_EmptyTag_OnUpdate_Replace(t *testi func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -936,6 +944,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_providerOnly(t *testin func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1105,6 +1114,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nonOverlapping(t *test func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1290,6 +1300,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_overlapping(t *testing func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1383,6 +1394,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_updateToProviderOnly(t func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1475,6 +1487,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_updateToResourceOnly(t func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1557,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_emptyResourceTag(t *te func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1605,6 +1619,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1675,6 +1690,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nullOverlappingResourc func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1747,6 +1763,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_DefaultTags_nullNonOverlappingReso func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1805,6 +1822,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnCreate(t *testing.T) func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1905,6 +1923,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnUpdate_Add(t *testin func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1995,6 +2014,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_ComputedTag_OnUpdate_Replace(t *te func TestAccTimestreamInfluxDBDBInstance_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2157,6 +2177,7 @@ func TestAccTimestreamInfluxDBDBInstance_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccTimestreamInfluxDBDBInstance_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v timestreaminfluxdb.GetDbInstanceOutput resourceName := "aws_timestreaminfluxdb_db_instance.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/timestreaminfluxdb/db_instance_test.go b/internal/service/timestreaminfluxdb/db_instance_test.go index 22c413b3a2db..3de52c71b7da 100644 --- a/internal/service/timestreaminfluxdb/db_instance_test.go +++ b/internal/service/timestreaminfluxdb/db_instance_test.go @@ -519,6 +519,11 @@ func TestAccTimestreamInfluxDBDBInstance_upgradeV5_90_0(t *testing.T) { }, ErrorCheck: acctest.ErrorCheck(t, names.TimestreamInfluxDBServiceID), CheckDestroy: testAccCheckDBInstanceDestroy(ctx), + AdditionalCLIOptions: &resource.AdditionalCLIOptions{ + Plan: resource.PlanOptions{ + NoRefresh: true, + }, + }, Steps: []resource.TestStep{ { ExternalProviders: map[string]resource.ExternalProvider{ @@ -543,30 +548,6 @@ func TestAccTimestreamInfluxDBDBInstance_upgradeV5_90_0(t *testing.T) { })), }, }, - { - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - Config: testAccDBInstanceConfig_basicV5_90_0(rName, rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckDBInstanceExists(ctx, resourceName, &dbInstance), - ), - ConfigPlanChecks: resource.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), - }, - PostApplyPreRefresh: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), - }, - PostApplyPostRefresh: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop), - }, - }, - ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("network_type"), knownvalue.StringExact(string(awstypes.NetworkTypeIpv4))), - statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ - "Name": knownvalue.StringExact(rName), - })), - }, - }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Config: testAccDBInstanceConfig_basicV5_90_0(rName, rName+"-updated"), @@ -585,7 +566,7 @@ func TestAccTimestreamInfluxDBDBInstance_upgradeV5_90_0(t *testing.T) { }, }, ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("network_type"), knownvalue.StringExact(string(awstypes.NetworkTypeIpv4))), + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("network_type"), knownvalue.Null()), statecheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTags), knownvalue.MapExact(map[string]knownvalue.Check{ "Name": knownvalue.StringExact(rName + "-updated"), })), diff --git a/internal/service/timestreaminfluxdb/service_endpoint_resolver_gen.go b/internal/service/timestreaminfluxdb/service_endpoint_resolver_gen.go index 6e6d8616c872..1327183e38bd 100644 --- a/internal/service/timestreaminfluxdb/service_endpoint_resolver_gen.go +++ b/internal/service/timestreaminfluxdb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params timestreaminflux }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up timestreaminfluxdb endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up timestreaminfluxdb endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index a0c0877814a0..c46716b1bb4a 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/timestreamquery/service_endpoint_resolver_gen.go b/internal/service/timestreamquery/service_endpoint_resolver_gen.go index d4a8f7fb7911..0f32b9ea726e 100644 --- a/internal/service/timestreamquery/service_endpoint_resolver_gen.go +++ b/internal/service/timestreamquery/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params timestreamquery. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up timestreamquery endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up timestreamquery endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/timestreamquery/service_endpoints_gen_test.go b/internal/service/timestreamquery/service_endpoints_gen_test.go index 738c9604a73c..576fffe499a0 100644 --- a/internal/service/timestreamquery/service_endpoints_gen_test.go +++ b/internal/service/timestreamquery/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/timestreamwrite/service_endpoint_resolver_gen.go b/internal/service/timestreamwrite/service_endpoint_resolver_gen.go index 60605316f15d..d84bc7dec4d9 100644 --- a/internal/service/timestreamwrite/service_endpoint_resolver_gen.go +++ b/internal/service/timestreamwrite/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params timestreamwrite. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up timestreamwrite endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up timestreamwrite endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/transcribe/service_endpoint_resolver_gen.go b/internal/service/transcribe/service_endpoint_resolver_gen.go index 408d39860981..85896a85b311 100644 --- a/internal/service/transcribe/service_endpoint_resolver_gen.go +++ b/internal/service/transcribe/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params transcribe.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up transcribe endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up transcribe endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index 0458e43a62da..7a267da5b392 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -601,7 +601,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/transfer/service_endpoint_resolver_gen.go b/internal/service/transfer/service_endpoint_resolver_gen.go index 751de739bf94..1c62d9e9b635 100644 --- a/internal/service/transfer/service_endpoint_resolver_gen.go +++ b/internal/service/transfer/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params transfer.Endpoin }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up transfer endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up transfer endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index e703b1c66e00..3e1e214a78e2 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/verifiedpermissions/policy.go b/internal/service/verifiedpermissions/policy.go index 342b936e26d6..fed28989ebd8 100644 --- a/internal/service/verifiedpermissions/policy.go +++ b/internal/service/verifiedpermissions/policy.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions" awstypes "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/types" - cedar "github.com/cedar-policy/cedar-go/x/exp/parser" + "github.com/cedar-policy/cedar-go" "github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/path" @@ -184,46 +184,31 @@ func statementReplaceIf(_ context.Context, req planmodifier.StringRequest, resp return } - cedarPlan, err := cedar.Tokenize([]byte(req.PlanValue.ValueString())) + // Parse the plan policy + planPolicies, err := cedar.NewPolicyListFromBytes("plan.cedar", []byte(req.PlanValue.ValueString())) if err != nil { - resp.Diagnostics.AddError(err.Error(), err.Error()) + resp.Diagnostics.AddError("Failed to parse plan policy", err.Error()) return } - cedarState, err := cedar.Tokenize([]byte(req.StateValue.ValueString())) + // Parse the state policy + statePolicies, err := cedar.NewPolicyListFromBytes("state.cedar", []byte(req.StateValue.ValueString())) if err != nil { - resp.Diagnostics.AddError(err.Error(), err.Error()) + resp.Diagnostics.AddError("Failed to parse state policy", err.Error()) return } - policyPlan, err := cedar.Parse(cedarPlan) - if err != nil { - resp.Diagnostics.AddError(err.Error(), err.Error()) - return - } - - policyState, err := cedar.Parse(cedarState) - if err != nil { - resp.Diagnostics.AddError(err.Error(), err.Error()) - return - } - - var policyPrincipal bool - if len(policyPlan) > 0 && len(policyState) > 0 && (len(policyPlan[0].Principal.Entity.Path) > 0 && (len(policyState[0].Principal.Entity.Path)) > 0) { - policyPrincipal = (policyPlan[0].Principal.Entity.String() != policyState[0].Principal.Entity.String()) || (policyPlan[0].Principal.Type != policyState[0].Principal.Type) - } - - var policyResource bool - if len(policyPlan) > 0 && len(policyState) > 0 && (len(policyPlan[0].Resource.Entity.Path) > 0 && (len(policyState[0].Resource.Entity.Path)) > 0) { - policyResource = (policyPlan[0].Resource.Entity.String() != policyState[0].Resource.Entity.String()) || (policyPlan[0].Resource.Type != policyState[0].Resource.Type) - } + var policyPrincipal, policyResource, policyEffect bool + if len(planPolicies) > 0 && len(statePolicies) > 0 { + planPolicyAST := planPolicies[0].AST() + statePolicyAST := statePolicies[0].AST() - var policyEffect bool - if len(policyPlan) > 0 && len(policyState) > 0 { - policyEffect = policyPlan[0].Effect != policyState[0].Effect + policyEffect = planPolicyAST.Effect != statePolicyAST.Effect + policyPrincipal = planPolicyAST.Principal != statePolicyAST.Principal + policyResource = planPolicyAST.Resource != statePolicyAST.Resource } - resp.RequiresReplace = policyEffect || policyResource || policyPrincipal + resp.RequiresReplace = policyEffect || policyPrincipal || policyResource } const ( diff --git a/internal/service/verifiedpermissions/policy_test.go b/internal/service/verifiedpermissions/policy_test.go index 975260ab2a13..297cbf25390b 100644 --- a/internal/service/verifiedpermissions/policy_test.go +++ b/internal/service/verifiedpermissions/policy_test.go @@ -13,6 +13,7 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/types" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" @@ -115,6 +116,7 @@ func TestAccVerifiedPermissionsPolicy_update(t *testing.T) { policyStatement := "permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");" policyStatementActionUpdated := "permit (principal, action == Action::\"write\", resource in Album:: \"test_album\");" policyStatementEffectUpdated := "forbid (principal, action == Action::\"view\", resource in Album:: \"test_album\");" + policyStatementResourceUpdated := "forbid (principal, action == Action::\"view\", resource in Album:: \"test_album_updated\");" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -136,6 +138,11 @@ func TestAccVerifiedPermissionsPolicy_update(t *testing.T) { }, { Config: testAccPolicyConfig_basic(rName, policyStatementActionUpdated), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &policy), resource.TestCheckResourceAttr(resourceName, "definition.0.static.0.description", rName), @@ -145,6 +152,11 @@ func TestAccVerifiedPermissionsPolicy_update(t *testing.T) { }, { Config: testAccPolicyConfig_basic(rName, policyStatementEffectUpdated), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + }, + }, Check: resource.ComposeTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &policy), resource.TestCheckResourceAttr(resourceName, "definition.0.static.0.description", rName), @@ -152,6 +164,20 @@ func TestAccVerifiedPermissionsPolicy_update(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "policy_id"), ), }, + { + Config: testAccPolicyConfig_basic(rName, policyStatementResourceUpdated), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckPolicyExists(ctx, resourceName, &policy), + resource.TestCheckResourceAttr(resourceName, "definition.0.static.0.description", rName), + resource.TestCheckResourceAttr(resourceName, "definition.0.static.0.statement", policyStatementResourceUpdated), + resource.TestCheckResourceAttrSet(resourceName, "policy_id"), + ), + }, }, }) } diff --git a/internal/service/verifiedpermissions/service_endpoint_resolver_gen.go b/internal/service/verifiedpermissions/service_endpoint_resolver_gen.go index db962ad42bf1..1c91ab63da98 100644 --- a/internal/service/verifiedpermissions/service_endpoint_resolver_gen.go +++ b/internal/service/verifiedpermissions/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params verifiedpermissi }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up verifiedpermissions endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up verifiedpermissions endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index 253d24ec3c71..a85465607c9f 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/vpclattice/resource_configuration_tags_gen_test.go b/internal/service/vpclattice/resource_configuration_tags_gen_test.go index 1bed65faf553..1e82568cd9bb 100644 --- a/internal/service/vpclattice/resource_configuration_tags_gen_test.go +++ b/internal/service/vpclattice/resource_configuration_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCLatticeResourceConfiguration_tags(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccVPCLatticeResourceConfiguration_tags(t *testing.T) { func TestAccVPCLatticeResourceConfiguration_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_null(t *testing.T) { func TestAccVPCLatticeResourceConfiguration_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_EmptyMap(t *testing.T) { func TestAccVPCLatticeResourceConfiguration_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_AddOnUpdate(t *testing.T) { func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnCreate(t *testing.T) func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnUpdate_Add(t *testin func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_EmptyTag_OnUpdate_Replace(t *te func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_providerOnly(t *tes func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nonOverlapping(t *t func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_overlapping(t *test func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_updateToProviderOnl func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_updateToResourceOnl func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_emptyResourceTag(t func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_emptyProviderOnlyTa func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nullOverlappingReso func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_DefaultTags_nullNonOverlappingR func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnCreate(t *testing func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnUpdate_Add(t *tes func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_ComputedTag_OnUpdate_Replace(t func TestAccVPCLatticeResourceConfiguration_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccVPCLatticeResourceConfiguration_tags_IgnoreTags_Overlap_DefaultTag(t func TestAccVPCLatticeResourceConfiguration_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceConfigurationOutput resourceName := "aws_vpclattice_resource_configuration.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/vpclattice/resource_gateway_tags_gen_test.go b/internal/service/vpclattice/resource_gateway_tags_gen_test.go index da2bd0e96dce..430b174cac3b 100644 --- a/internal/service/vpclattice/resource_gateway_tags_gen_test.go +++ b/internal/service/vpclattice/resource_gateway_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCLatticeResourceGateway_tags(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccVPCLatticeResourceGateway_tags(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccVPCLatticeResourceGateway_tags_null(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccVPCLatticeResourceGateway_tags_EmptyMap(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccVPCLatticeResourceGateway_tags_AddOnUpdate(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccVPCLatticeResourceGateway_tags_EmptyTag_OnUpdate_Replace(t *testing. func TestAccVPCLatticeResourceGateway_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_providerOnly(t *testing.T func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nonOverlapping(t *testing func TestAccVPCLatticeResourceGateway_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_overlapping(t *testing.T) func TestAccVPCLatticeResourceGateway_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_updateToProviderOnly(t *t func TestAccVPCLatticeResourceGateway_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_updateToResourceOnly(t *t func TestAccVPCLatticeResourceGateway_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_emptyResourceTag(t *testi func TestAccVPCLatticeResourceGateway_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_emptyProviderOnlyTag(t *t func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nullOverlappingResourceTa func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccVPCLatticeResourceGateway_tags_DefaultTags_nullNonOverlappingResourc func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnUpdate_Add(t *testing.T func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccVPCLatticeResourceGateway_tags_ComputedTag_OnUpdate_Replace(t *testi func TestAccVPCLatticeResourceGateway_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccVPCLatticeResourceGateway_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccVPCLatticeResourceGateway_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetResourceGatewayOutput resourceName := "aws_vpclattice_resource_gateway.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/vpclattice/service_endpoint_resolver_gen.go b/internal/service/vpclattice/service_endpoint_resolver_gen.go index 72d43fd38087..74ec0b088651 100644 --- a/internal/service/vpclattice/service_endpoint_resolver_gen.go +++ b/internal/service/vpclattice/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params vpclattice.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up vpclattice endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up vpclattice endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index 43657905d5ef..d0beb9adebbc 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/vpclattice/service_network_resource_association_tags_gen_test.go b/internal/service/vpclattice/service_network_resource_association_tags_gen_test.go index 4aa0d87274c8..a751da8167d4 100644 --- a/internal/service/vpclattice/service_network_resource_association_tags_gen_test.go +++ b/internal/service/vpclattice/service_network_resource_association_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccVPCLatticeServiceNetworkResourceAssociation_tags(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags(t *testing.T) { func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -262,6 +264,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_null(t *testing.T) func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -312,6 +315,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyMap(t *testing func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -392,6 +396,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_AddOnUpdate(t *test func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -482,6 +487,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnCreate(t func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -621,6 +627,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnUpdate_A func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -711,6 +718,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_EmptyTag_OnUpdate_R func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -892,6 +900,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_provide func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1052,6 +1061,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nonOver func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1228,6 +1238,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_overlap func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1318,6 +1329,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_updateT func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1407,6 +1419,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_updateT func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1473,6 +1486,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_emptyRe func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1531,6 +1545,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_emptyPr func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1600,6 +1615,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nullOve func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1671,6 +1687,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_DefaultTags_nullNon func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1726,6 +1743,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnCreat func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1823,6 +1841,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnUpdat func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1910,6 +1929,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_ComputedTag_OnUpdat func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2072,6 +2092,7 @@ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_IgnoreTags_Overlap_ func TestAccVPCLatticeServiceNetworkResourceAssociation_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v vpclattice.GetServiceNetworkResourceAssociationOutput resourceName := "aws_vpclattice_service_network_resource_association.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/vpclattice/target_group.go b/internal/service/vpclattice/target_group.go index 98e2a0ebf6e3..0e2fe4fcf3db 100644 --- a/internal/service/vpclattice/target_group.go +++ b/internal/service/vpclattice/target_group.go @@ -309,7 +309,7 @@ func resourceTargetGroupDelete(ctx context.Context, d *schema.ResourceData, meta } // Draining the targets can take a moment, so we need to retry on conflict. - _, err := tfresource.RetryWhenIsA[*types.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.ConflictException](ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) (any, error) { return conn.DeleteTargetGroup(ctx, &input) }) diff --git a/internal/service/waf/rule.go b/internal/service/waf/rule.go index 917a5a8bdce9..efb70f6d6058 100644 --- a/internal/service/waf/rule.go +++ b/internal/service/waf/rule.go @@ -182,7 +182,7 @@ func resourceRuleDelete(ctx context.Context, d *schema.ResourceData, meta any) d const ( timeout = 1 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.WAFReferencedItemException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFReferencedItemException](ctx, timeout, func(ctx context.Context) (any, error) { return newRetryer(conn).RetryWithToken(ctx, func(token *string) (any, error) { input := &waf.DeleteRuleInput{ ChangeToken: token, diff --git a/internal/service/waf/service_endpoint_resolver_gen.go b/internal/service/waf/service_endpoint_resolver_gen.go index 7250bd6d46eb..22327bd30ddf 100644 --- a/internal/service/waf/service_endpoint_resolver_gen.go +++ b/internal/service/waf/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params waf.EndpointPara }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up waf endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up waf endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index df3f447c06dc..c4e894895926 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/waf/token_handlers.go b/internal/service/waf/token_handlers.go index d3cc0174f397..392d30cfd12b 100644 --- a/internal/service/waf/token_handlers.go +++ b/internal/service/waf/token_handlers.go @@ -30,7 +30,7 @@ func (t *retryer) RetryWithToken(ctx context.Context, f withTokenFunc) (any, err const ( timeout = 15 * time.Minute ) - return tfresource.RetryWhenIsA[*awstypes.WAFStaleDataException](ctx, timeout, func() (any, error) { + return tfresource.RetryWhenIsA[any, *awstypes.WAFStaleDataException](ctx, timeout, func(ctx context.Context) (any, error) { input := &waf.GetChangeTokenInput{} output, err := t.connection.GetChangeToken(ctx, input) diff --git a/internal/service/wafregional/service_endpoint_resolver_gen.go b/internal/service/wafregional/service_endpoint_resolver_gen.go index 1baaa5ef61c1..e03de5759dc0 100644 --- a/internal/service/wafregional/service_endpoint_resolver_gen.go +++ b/internal/service/wafregional/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params wafregional.Endp }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up wafregional endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up wafregional endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index 4d64f5677ae5..c89fa4a35c11 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/wafregional/token_handlers.go b/internal/service/wafregional/token_handlers.go index 9160175e8372..ad1fcce5d652 100644 --- a/internal/service/wafregional/token_handlers.go +++ b/internal/service/wafregional/token_handlers.go @@ -29,7 +29,7 @@ func (t *retryer) RetryWithToken(ctx context.Context, f withTokenFunc) (any, err const ( timeout = 15 * time.Minute ) - return tfresource.RetryWhenIsA[*awstypes.WAFStaleDataException](ctx, timeout, func() (any, error) { + return tfresource.RetryWhenIsA[any, *awstypes.WAFStaleDataException](ctx, timeout, func(ctx context.Context) (any, error) { input := &wafregional.GetChangeTokenInput{} output, err := t.connection.GetChangeToken(ctx, input) diff --git a/internal/service/wafregional/web_acl_association.go b/internal/service/wafregional/web_acl_association.go index 4173ea2e069c..b7150fc0f2c0 100644 --- a/internal/service/wafregional/web_acl_association.go +++ b/internal/service/wafregional/web_acl_association.go @@ -67,7 +67,7 @@ func resourceWebACLAssociationCreate(ctx context.Context, d *schema.ResourceData WebACLId: aws.String(webACLID), } - _, err := tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.AssociateWebACL(ctx, input) }) diff --git a/internal/service/wafv2/exports_test.go b/internal/service/wafv2/exports_test.go index 660620dda906..54a2f993ba72 100644 --- a/internal/service/wafv2/exports_test.go +++ b/internal/service/wafv2/exports_test.go @@ -12,7 +12,9 @@ var ( ResourceWebACLAssociation = resourceWebACLAssociation ResourceWebACLLoggingConfiguration = resourceWebACLLoggingConfiguration ResourceAPIKey = newAPIKeyResource + ResourceWebACLRuleGroupAssociation = newResourceWebACLRuleGroupAssociation + CloudFrontDistributionIDFromARN = cloudFrontDistributionIDFromARN FindAPIKeyByTwoPartKey = findAPIKeyByTwoPartKey FindIPSetByThreePartKey = findIPSetByThreePartKey FindLoggingConfigurationByARN = findLoggingConfigurationByARN @@ -20,6 +22,8 @@ var ( FindRuleGroupByThreePartKey = findRuleGroupByThreePartKey FindWebACLByResourceARN = findWebACLByResourceARN FindWebACLByThreePartKey = findWebACLByThreePartKey + IsCloudFrontDistributionARN = isCloudFrontDistributionARN ListRuleGroupsPages = listRuleGroupsPages ListWebACLsPages = listWebACLsPages + ParseWebACLARN = parseWebACLARN ) diff --git a/internal/service/wafv2/flex.go b/internal/service/wafv2/flex.go index 518d1c7b8c8b..6f71b8715f56 100644 --- a/internal/service/wafv2/flex.go +++ b/internal/service/wafv2/flex.go @@ -2539,8 +2539,8 @@ func flattenCookiesMatchPattern(c *awstypes.CookieMatchPattern) any { } m := map[string]any{ - "included_cookies": aws.StringSlice(c.IncludedCookies), - "excluded_cookies": aws.StringSlice(c.ExcludedCookies), + "included_cookies": c.IncludedCookies, + "excluded_cookies": c.ExcludedCookies, } if c.All != nil { diff --git a/internal/service/wafv2/ip_set.go b/internal/service/wafv2/ip_set.go index 6bc74a860e86..3e01e46c9191 100644 --- a/internal/service/wafv2/ip_set.go +++ b/internal/service/wafv2/ip_set.go @@ -249,7 +249,7 @@ func resourceIPSetDelete(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.WAFAssociatedItemException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFAssociatedItemException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteIPSet(ctx, input) }) diff --git a/internal/service/wafv2/regex_pattern_set.go b/internal/service/wafv2/regex_pattern_set.go index 64d259211293..9119a0d8b538 100644 --- a/internal/service/wafv2/regex_pattern_set.go +++ b/internal/service/wafv2/regex_pattern_set.go @@ -94,7 +94,6 @@ func resourceRegexPatternSet() *schema.Resource { "regular_expression": { Type: schema.TypeSet, Optional: true, - MaxItems: 10, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "regex_string": { @@ -229,7 +228,7 @@ func resourceRegexPatternSetDelete(ctx context.Context, d *schema.ResourceData, const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.WAFAssociatedItemException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFAssociatedItemException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.DeleteRegexPatternSet(ctx, input) }) diff --git a/internal/service/wafv2/rule_group.go b/internal/service/wafv2/rule_group.go index 81d4314f28bf..89cc54d2c0e7 100644 --- a/internal/service/wafv2/rule_group.go +++ b/internal/service/wafv2/rule_group.go @@ -197,7 +197,7 @@ func resourceRuleGroupCreate(ctx context.Context, d *schema.ResourceData, meta a const ( timeout = 5 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateRuleGroup(ctx, input) }) @@ -288,7 +288,7 @@ func resourceRuleGroupUpdate(ctx context.Context, d *schema.ResourceData, meta a const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateRuleGroup(ctx, input) }) diff --git a/internal/service/wafv2/service_endpoint_resolver_gen.go b/internal/service/wafv2/service_endpoint_resolver_gen.go index bfaf551e2ca8..6228c2e10bf4 100644 --- a/internal/service/wafv2/service_endpoint_resolver_gen.go +++ b/internal/service/wafv2/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params wafv2.EndpointPa }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up wafv2 endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up wafv2 endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index ac0a4f95fc9c..7a91683f4fc5 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -524,7 +524,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/wafv2/service_package_gen.go b/internal/service/wafv2/service_package_gen.go index 8c27e48c5823..b0fe2ee13cb2 100644 --- a/internal/service/wafv2/service_package_gen.go +++ b/internal/service/wafv2/service_package_gen.go @@ -30,6 +30,12 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*inttypes.Ser Name: "API Key", Region: unique.Make(inttypes.ResourceRegionDefault()), }, + { + Factory: newResourceWebACLRuleGroupAssociation, + TypeName: "aws_wafv2_web_acl_rule_group_association", + Name: "Web ACL Rule Group Association", + Region: unique.Make(inttypes.ResourceRegionDefault()), + }, } } diff --git a/internal/service/wafv2/web_acl.go b/internal/service/wafv2/web_acl.go index 0c266f686cc6..a4a3a9222015 100644 --- a/internal/service/wafv2/web_acl.go +++ b/internal/service/wafv2/web_acl.go @@ -305,7 +305,7 @@ func resourceWebACLCreate(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 5 * time.Minute ) - outputRaw, err := tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, timeout, func() (any, error) { + outputRaw, err := tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.CreateWebACL(ctx, input) }) @@ -449,7 +449,7 @@ func resourceWebACLUpdate(ctx context.Context, d *schema.ResourceData, meta any) const ( timeout = 5 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, timeout, func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { return conn.UpdateWebACL(ctx, input) }) @@ -536,13 +536,7 @@ func resourceWebACLDelete(ctx context.Context, d *schema.ResourceData, meta any) return diags } -func findWebACLByThreePartKey(ctx context.Context, conn *wafv2.Client, id, name, scope string) (*wafv2.GetWebACLOutput, error) { - input := &wafv2.GetWebACLInput{ - Id: aws.String(id), - Name: aws.String(name), - Scope: awstypes.Scope(scope), - } - +func findWebACL(ctx context.Context, conn *wafv2.Client, input *wafv2.GetWebACLInput) (*wafv2.GetWebACLOutput, error) { output, err := conn.GetWebACL(ctx, input) if errs.IsA[*awstypes.WAFNonexistentItemException](err) { @@ -563,6 +557,16 @@ func findWebACLByThreePartKey(ctx context.Context, conn *wafv2.Client, id, name, return output, nil } +func findWebACLByThreePartKey(ctx context.Context, conn *wafv2.Client, id, name, scope string) (*wafv2.GetWebACLOutput, error) { + input := wafv2.GetWebACLInput{ + Id: aws.String(id), + Name: aws.String(name), + Scope: awstypes.Scope(scope), + } + + return findWebACL(ctx, conn, &input) +} + // filterWebACLRules removes the AWS-added Shield Advanced auto mitigation rule here // so that the provider will not report diff and/or attempt to remove the rule as it is // owned and managed by AWS. diff --git a/internal/service/wafv2/web_acl_association.go b/internal/service/wafv2/web_acl_association.go index 88aae4c21385..a677893798df 100644 --- a/internal/service/wafv2/web_acl_association.go +++ b/internal/service/wafv2/web_acl_association.go @@ -78,7 +78,7 @@ func resourceWebACLAssociationCreate(ctx context.Context, d *schema.ResourceData } log.Printf("[INFO] Creating WAFv2 WebACL Association: %s", d.Id()) - if _, err = tfresource.RetryWhenIsA[*awstypes.WAFUnavailableEntityException](ctx, d.Timeout(schema.TimeoutCreate), func() (any, error) { + if _, err = tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, d.Timeout(schema.TimeoutCreate), func(ctx context.Context) (any, error) { return conn.AssociateWebACL(ctx, input) }); err != nil { return sdkdiag.AppendErrorf(diags, "creating WAFv2 WebACL Association (%s): %s", id, err) diff --git a/internal/service/wafv2/web_acl_data_source.go b/internal/service/wafv2/web_acl_data_source.go index 6ef0d75eb906..3c8c97d22a74 100644 --- a/internal/service/wafv2/web_acl_data_source.go +++ b/internal/service/wafv2/web_acl_data_source.go @@ -5,15 +5,22 @@ package wafv2 import ( "context" + "fmt" + "strings" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/arn" "github.com/aws/aws-sdk-go-v2/service/wafv2" awstypes "github.com/aws/aws-sdk-go-v2/service/wafv2/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" + tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" + "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -33,8 +40,15 @@ func dataSourceWebACL() *schema.Resource { Computed: true, }, names.AttrName: { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{names.AttrName, names.AttrResourceARN}, + }, + names.AttrResourceARN: { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{names.AttrName, names.AttrResourceARN}, + ValidateFunc: verify.ValidARN, }, names.AttrScope: { Type: schema.TypeString, @@ -49,44 +63,144 @@ func dataSourceWebACL() *schema.Resource { func dataSourceWebACLRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).WAFV2Client(ctx) + name := d.Get(names.AttrName).(string) + resourceArn := d.Get(names.AttrResourceARN).(string) + scope := awstypes.Scope(d.Get(names.AttrScope).(string)) - var foundWebACL awstypes.WebACLSummary - input := &wafv2.ListWebACLsInput{ - Scope: awstypes.Scope(d.Get(names.AttrScope).(string)), - Limit: aws.Int32(100), - } + var webACL *awstypes.WebACL + var err error - for { - resp, err := conn.ListWebACLs(ctx, input) + if resourceArn != "" { + // Check if this is a CloudFront distribution ARN and scope is CLOUDFRONT + if scope == awstypes.ScopeCloudfront && isCloudFrontDistributionARN(resourceArn) { + webACL, err = findWebACLByCloudFrontDistributionARN(ctx, meta.(*conns.AWSClient), resourceArn) + } else { + // Use GetWebACLForResource API for regional resources + webACL, err = findWebACLByResourceARN(ctx, conn, resourceArn) + } if err != nil { - return sdkdiag.AppendErrorf(diags, "reading WAFv2 WebACLs: %s", err) + if retry.NotFound(err) { + return sdkdiag.AppendErrorf(diags, "WAFv2 WebACL not found for resource_arn: %s", resourceArn) + } + return sdkdiag.AppendErrorf(diags, "reading WAFv2 WebACL for resource_arn (%s): %s", resourceArn, err) } - - if resp == nil || resp.WebACLs == nil { - return sdkdiag.AppendErrorf(diags, "reading WAFv2 WebACLs") + } else { + // Use existing ListWebACLs + filter by name logic + var foundWebACL awstypes.WebACLSummary + input := wafv2.ListWebACLsInput{ + Scope: scope, + Limit: aws.Int32(100), } - for _, webACL := range resp.WebACLs { - if aws.ToString(webACL.Name) == name { - foundWebACL = webACL - break + err := listWebACLsPages(ctx, conn, &input, func(page *wafv2.ListWebACLsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, acl := range page.WebACLs { + if aws.ToString(acl.Name) == name { + foundWebACL = acl + return false + } } + + return !lastPage + }) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "list WAFv2 WebACLs: %s", err) + } + + if foundWebACL.Id == nil { + return sdkdiag.AppendErrorf(diags, "WAFv2 WebACL not found for name: %s", name) } - if resp.NextMarker == nil { - break + // Get full WebACL details using GetWebACL + getResp, err := findWebACLByThreePartKey(ctx, conn, aws.ToString(foundWebACL.Id), aws.ToString(foundWebACL.Name), string(scope)) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading WAFv2 WebACL (%s): %s", aws.ToString(foundWebACL.Id), err) } - input.NextMarker = resp.NextMarker + + webACL = getResp.WebACL } - if foundWebACL.Id == nil { - return sdkdiag.AppendErrorf(diags, "WAFv2 WebACL not found for name: %s", name) + if webACL == nil { + return sdkdiag.AppendErrorf(diags, "WAFv2 WebACL not found") } - d.SetId(aws.ToString(foundWebACL.Id)) - d.Set(names.AttrARN, foundWebACL.ARN) - d.Set(names.AttrDescription, foundWebACL.Description) + d.SetId(aws.ToString(webACL.Id)) + d.Set(names.AttrARN, webACL.ARN) + d.Set(names.AttrDescription, webACL.Description) + d.Set(names.AttrName, webACL.Name) return diags } + +// Helper function to detect CloudFront distribution ARNs +func isCloudFrontDistributionARN(s string) bool { + // CloudFront distribution ARNs: arn:partition:cloudfront::account:distribution/ID + return strings.Contains(s, ":cloudfront::") && strings.Contains(s, ":distribution/") && arn.IsARN(s) +} + +// Helper function to extract distribution ID from CloudFront ARN +func cloudFrontDistributionIDFromARN(arn string) (string, error) { + parts := strings.Split(arn, "/") + if len(parts) < 2 { + return "", fmt.Errorf("invalid CloudFront distribution ARN format: %s", arn) + } + return parts[len(parts)-1], nil +} + +// Helper function to find WebACL by CloudFront distribution ARN +func findWebACLByCloudFrontDistributionARN(ctx context.Context, client *conns.AWSClient, distributionARN string) (*awstypes.WebACL, error) { + // Extract distribution ID from ARN + distributionID, err := cloudFrontDistributionIDFromARN(distributionARN) + if err != nil { + return nil, err + } + + output, err := tfcloudfront.FindDistributionByID(ctx, client.CloudFrontClient(ctx), distributionID) + + if err != nil { + return nil, fmt.Errorf("getting CloudFront distribution (%s): %w", distributionID, err) + } + + webACLARN := aws.ToString(output.Distribution.DistributionConfig.WebACLId) + if webACLARN == "" { + return nil, &sdkretry.NotFoundError{ + Message: fmt.Sprintf("no WebACL associated with CloudFront distribution: %s", distributionID), + } + } + + // Now get the actual WebACL using WAFv2 API + wafConn := client.WAFV2Client(ctx) + + if !strings.Contains(webACLARN, ":wafv2:") || !arn.IsARN(webACLARN) { + // This would be a WAF Classic ID, not supported by this data source + return nil, fmt.Errorf("CloudFront distribution (%s) is associated with WAF Classic WebACL (%s), which is not supported by this data source. Use aws_waf_web_acl data source instead", distributionID, webACLARN) + } + + // Parse the ARN to extract name and ID + // WAFv2 ARN format: arn:partition:wafv2:region:account:global/webacl/name/id + parts := strings.Split(webACLARN, "/") + if len(parts) < 4 { + return nil, fmt.Errorf("invalid WAFv2 WebACL ARN format: %s", webACLARN) + } + + webACLName := parts[len(parts)-2] + webACLID := parts[len(parts)-1] + + var webACLOut *wafv2.GetWebACLOutput + if webACLOut, err = findWebACLByThreePartKey(ctx, wafConn, webACLID, webACLName, string(awstypes.ScopeCloudfront)); err != nil { + return nil, fmt.Errorf("finding WAFv2 WebACL (%s): %w", webACLARN, err) + } + if webACLOut == nil { + return nil, &sdkretry.NotFoundError{ + Message: fmt.Sprintf("no WAFv2 WebACL found: %s", webACLARN), + } + } + + return webACLOut.WebACL, nil +} diff --git a/internal/service/wafv2/web_acl_data_source_test.go b/internal/service/wafv2/web_acl_data_source_test.go index 4a957073b1ac..8945cc69e1ff 100644 --- a/internal/service/wafv2/web_acl_data_source_test.go +++ b/internal/service/wafv2/web_acl_data_source_test.go @@ -11,9 +11,135 @@ import ( sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" + tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" "github.com/hashicorp/terraform-provider-aws/names" ) +func TestIsCloudFrontDistributionARN(t *testing.T) { + t.Parallel() + tests := []struct { + name string + arn string + expected bool + }{ + { + name: "standard AWS partition", + arn: "arn:aws:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: true, + }, + { + name: "AWS GovCloud partition", + arn: "arn:aws-us-gov:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: true, + }, + { + name: "AWS China partition", + arn: "arn:aws-cn:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: true, + }, + { + name: "ISOB partition", + arn: "arn:isob:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: true, + }, + { + name: "unknown future partition", + arn: "arn:aws-new-region:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: true, + }, + { + name: "ALB ARN", + arn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", //lintignore:AWSAT003,AWSAT005 + expected: false, + }, + { + name: "CloudFront origin access identity", + arn: "arn:aws:cloudfront::123456789012:origin-access-identity/E12345678901234", //lintignore:AWSAT005 + expected: false, + }, + { + name: "not an ARN", + arn: "not-an-arn", + expected: false, + }, + { + name: "invalid ARN format", + arn: "arn:aws:cloudfront:123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expected: false, + }, + } + + for _, tt := range tests { + t.Run(tt.arn, func(t *testing.T) { + t.Parallel() + result := tfwafv2.IsCloudFrontDistributionARN(tt.arn) + if result != tt.expected { + t.Errorf("isCloudFrontDistributionARN(%q) = %v, want %v", tt.arn, result, tt.expected) + } + }) + } +} + +func TestCloudFrontDistributionIDFromARN(t *testing.T) { + t.Parallel() + tests := []struct { + name string + arn string + expectedID string + expectError bool + }{ + { + name: "standard AWS CloudFront ARN", + arn: "arn:aws:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expectedID: "E12345678901234", + }, + { + name: "GovCloud CloudFront ARN", + arn: "arn:aws-us-gov:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expectedID: "E12345678901234", + }, + { + name: "China CloudFront ARN", + arn: "arn:aws-cn:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expectedID: "E12345678901234", + }, + { + name: "ISOB CloudFront ARN", + arn: "arn:isob:cloudfront::123456789012:distribution/E12345678901234", //lintignore:AWSAT005 + expectedID: "E12345678901234", + }, + { + name: "invalid ARN - no slash", + arn: "invalid-arn", + expectError: true, + }, + { + name: "invalid ARN - missing distribution ID", + arn: "arn:aws:cloudfront::123456789012:distribution", //lintignore:AWSAT005 + expectError: true, + }, + } + + for _, tt := range tests { + t.Run(tt.arn, func(t *testing.T) { + t.Parallel() + id, err := tfwafv2.CloudFrontDistributionIDFromARN(tt.arn) + if tt.expectError { + if err == nil { + t.Errorf("cloudFrontDistributionIDFromARN(%q) expected error, got nil", tt.arn) + } + } else { + if err != nil { + t.Errorf("cloudFrontDistributionIDFromARN(%q) unexpected error: %v", tt.arn, err) + } + if id != tt.expectedID { + t.Errorf("cloudFrontDistributionIDFromARN(%q) = %q, want %q", tt.arn, id, tt.expectedID) + } + } + }) + } +} + func TestAccWAFV2WebACLDataSource_basic(t *testing.T) { ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -44,10 +170,81 @@ func TestAccWAFV2WebACLDataSource_basic(t *testing.T) { }) } +func TestAccWAFV2WebACLDataSource_resource(t *testing.T) { + ctx := acctest.Context(t) + name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl.test" + datasourceName := "data.aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccWebACLDataSourceConfig_resource(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(datasourceName, names.AttrARN, resourceName, names.AttrARN), + acctest.MatchResourceAttrRegionalARN(ctx, datasourceName, names.AttrARN, "wafv2", regexache.MustCompile(fmt.Sprintf("regional/webacl/%v/.+$", name))), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrDescription, resourceName, names.AttrDescription), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrID, resourceName, names.AttrID), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrName, resourceName, names.AttrName), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrScope, resourceName, names.AttrScope), + ), + }, + }, + }) +} + +func TestAccWAFV2WebACLDataSource_resourceNotFound(t *testing.T) { + ctx := acctest.Context(t) + name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccWebACLDataSourceConfig_resourceNotFound(name), + ExpectError: regexache.MustCompile(`WAFv2 WebACL not found for`), + }, + }, + }) +} + +func TestAccWAFV2WebACLDataSource_cloudfront(t *testing.T) { + ctx := acctest.Context(t) + name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl.test" + datasourceName := "data.aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckWAFV2CloudFrontScope(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccWebACLDataSourceConfig_cloudfront(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(datasourceName, names.AttrARN, resourceName, names.AttrARN), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrDescription, resourceName, names.AttrDescription), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrID, resourceName, names.AttrID), + resource.TestCheckResourceAttrPair(datasourceName, names.AttrName, resourceName, names.AttrName), + resource.TestCheckResourceAttr(datasourceName, names.AttrScope, "CLOUDFRONT"), + ), + }, + }, + }) +} + func testAccWebACLDataSourceConfig_name(name string) string { return fmt.Sprintf(` resource "aws_wafv2_web_acl" "test" { - name = "%s" + name = %[1]q scope = "REGIONAL" default_action { @@ -71,7 +268,7 @@ data "aws_wafv2_web_acl" "test" { func testAccWebACLDataSourceConfig_nonExistent(name string) string { return fmt.Sprintf(` resource "aws_wafv2_web_acl" "test" { - name = "%s" + name = %[1]q scope = "REGIONAL" default_action { @@ -91,3 +288,201 @@ data "aws_wafv2_web_acl" "test" { } `, name) } + +func testAccWebACLDataSourceConfig_resource(name string) string { + return fmt.Sprintf(` +resource "aws_lb" "test" { + name = %[1]q + internal = false + load_balancer_type = "application" + subnets = aws_subnet.test[*].id + + enable_deletion_protection = false +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + count = 2 + + vpc_id = aws_vpc.test.id + cidr_block = "10.0.${count.index}.0/24" + availability_zone = data.aws_availability_zones.available.names[count.index] + + tags = { + Name = "%[1]s-${count.index}" + } +} + +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + block {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "friendly-rule-metric-name" + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl_association" "test" { + resource_arn = aws_lb.test.arn + web_acl_arn = aws_wafv2_web_acl.test.arn +} + +data "aws_wafv2_web_acl" "test" { + resource_arn = aws_lb.test.arn + scope = "REGIONAL" + + depends_on = [aws_wafv2_web_acl_association.test] +} +`, name) +} + +func testAccWebACLDataSourceConfig_resourceNotFound(name string) string { + return fmt.Sprintf(` +resource "aws_lb" "test" { + name = %[1]q + internal = false + load_balancer_type = "application" + subnets = aws_subnet.test[*].id + + enable_deletion_protection = false +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + count = 2 + + vpc_id = aws_vpc.test.id + cidr_block = "10.0.${count.index}.0/24" + availability_zone = data.aws_availability_zones.available.names[count.index] + + tags = { + Name = "%[1]s-${count.index}" + } +} + +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +data "aws_wafv2_web_acl" "test" { + resource_arn = aws_lb.test.arn + scope = "REGIONAL" +} +`, name) +} + +func testAccWebACLDataSourceConfig_cloudfront(name string) string { + return fmt.Sprintf(` +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "CLOUDFRONT" + + default_action { + block {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "friendly-rule-metric-name" + sampled_requests_enabled = false + } +} + +resource "aws_cloudfront_distribution" "test" { + web_acl_id = aws_wafv2_web_acl.test.arn + + origin { + domain_name = "www.example.com" + origin_id = "test" + + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "https-only" + origin_ssl_protocols = ["TLSv1.2"] + } + } + + enabled = true + + default_cache_behavior { + allowed_methods = ["GET", "HEAD"] + cached_methods = ["GET", "HEAD"] + target_origin_id = "test" + viewer_protocol_policy = "allow-all" + + forwarded_values { + query_string = false + cookies { + forward = "all" + } + } + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } + + viewer_certificate { + cloudfront_default_certificate = true + } +} + +data "aws_wafv2_web_acl" "test" { + resource_arn = aws_cloudfront_distribution.test.arn + scope = "CLOUDFRONT" +} +`, name) +} diff --git a/internal/service/wafv2/web_acl_rule_group_association.go b/internal/service/wafv2/web_acl_rule_group_association.go new file mode 100644 index 000000000000..a21361204a9c --- /dev/null +++ b/internal/service/wafv2/web_acl_rule_group_association.go @@ -0,0 +1,1263 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package wafv2 + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/arn" + "github.com/aws/aws-sdk-go-v2/service/wafv2" + awstypes "github.com/aws/aws-sdk-go-v2/service/wafv2/types" + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework-validators/int32validator" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +const ( + webACLRuleGroupAssociationResourceIDPartCount = 4 + overrideActionNone = "none" + overrideActionCount = "count" +) + +// Function annotations are used for resource registration to the Provider. DO NOT EDIT. +// @FrameworkResource("aws_wafv2_web_acl_rule_group_association", name="Web ACL Rule Group Association") +func newResourceWebACLRuleGroupAssociation(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &resourceWebACLRuleGroupAssociation{} + + r.SetDefaultCreateTimeout(30 * time.Minute) + r.SetDefaultDeleteTimeout(30 * time.Minute) + + return r, nil +} + +const ( + ResNameWebACLRuleGroupAssociation = "Web ACL Rule Group Association" +) + +type resourceWebACLRuleGroupAssociation struct { + framework.ResourceWithModel[resourceWebACLRuleGroupAssociationModel] + framework.WithTimeouts +} + +func (r *resourceWebACLRuleGroupAssociation) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + ruleActionOverrideLNB := schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[ruleActionOverrideModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(100), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 128), + }, + Description: "Name of the rule to override.", + }, + }, + Blocks: map[string]schema.Block{ + "action_to_use": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[actionToUseModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "allow": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[allowActionModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "custom_request_handling": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[customRequestHandlingModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "insert_header": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[insertHeaderModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + }, + names.AttrValue: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 255), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "block": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[blockActionModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "custom_response": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[customResponseModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "custom_response_body_key": schema.StringAttribute{ + Optional: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 128), + }, + }, + "response_code": schema.Int32Attribute{ + Required: true, + Validators: []validator.Int32{ + int32validator.Between(200, 600), + }, + }, + }, + Blocks: map[string]schema.Block{ + "response_header": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[responseHeaderModel](ctx), + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + }, + names.AttrValue: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 255), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "captcha": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[captchaActionModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "custom_request_handling": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[customRequestHandlingModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "insert_header": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[insertHeaderModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + }, + names.AttrValue: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 255), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "challenge": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[challengeActionModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "custom_request_handling": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[customRequestHandlingModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "insert_header": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[insertHeaderModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + }, + names.AttrValue: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 255), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "count": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[countActionModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "custom_request_handling": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[customRequestHandlingModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Blocks: map[string]schema.Block{ + "insert_header": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[insertHeaderModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + }, + names.AttrValue: schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 255), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + Description: "Action to use in place of the rule action.", + }, + }, + }, + Description: "Action settings to use in place of rule actions configured inside the rule group. You can specify up to 100 overrides.", + } + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "rule_name": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 128), + }, + Description: "Name of the rule to create in the Web ACL that references the rule group.", + }, + names.AttrPriority: schema.Int32Attribute{ + Required: true, + Validators: []validator.Int32{ + int32validator.AtLeast(0), + }, + Description: "Priority of the rule within the Web ACL.", + }, + "web_acl_arn": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + fwvalidators.ARN(), + }, + Description: "ARN of the Web ACL to associate the Rule Group with.", + }, + "override_action": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf(overrideActionNone, overrideActionCount), + }, + Description: "Override action for the rule group. Valid values are 'none' and 'count'. Defaults to 'none'.", + }, + }, + Blocks: map[string]schema.Block{ + "rule_group_reference": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[ruleGroupReferenceModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + listvalidator.SizeAtLeast(0), + listvalidator.ExactlyOneOf(path.MatchRelative().AtParent().AtName("managed_rule_group")), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrARN: schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + fwvalidators.ARN(), + }, + Description: "ARN of the Rule Group to associate with the Web ACL.", + }, + }, + Blocks: map[string]schema.Block{ + "rule_action_override": ruleActionOverrideLNB, + }, + }, + Description: "Rule Group reference configuration.", + }, + "managed_rule_group": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[managedRuleGroupModel](ctx), + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + listvalidator.SizeAtLeast(0), + listvalidator.ExactlyOneOf(path.MatchRelative().AtParent().AtName("rule_group_reference")), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + names.AttrName: schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 128), + }, + Description: "Name of the managed rule group.", + }, + "vendor_name": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 128), + }, + Description: "Name of the managed rule group vendor.", + }, + names.AttrVersion: schema.StringAttribute{ + Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + }, + Description: "Version of the managed rule group. Omit this to use the default version.", + }, + }, + Blocks: map[string]schema.Block{ + "rule_action_override": ruleActionOverrideLNB, + }, + }, + Description: "Managed rule group configuration.", + }, + names.AttrTimeouts: timeouts.Block(ctx, timeouts.Opts{ + Create: true, + Update: true, + Delete: true, + }), + }, + Description: "Associates a WAFv2 Rule Group (custom or managed) with a Web ACL by adding a rule that references the Rule Group.", + } +} + +func (r *resourceWebACLRuleGroupAssociation) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + conn := r.Meta().WAFV2Client(ctx) + + var plan resourceWebACLRuleGroupAssociationModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + // Parse Web ACL ARN to get ID, name, and scope + webACLID, webACLName, webACLScope, err := parseWebACLARN(plan.WebACLARN.ValueString()) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + // Get current Web ACL configuration + webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + // Check if rule with same priority or name already exists + for _, rule := range webACL.WebACL.Rules { + if rule.Priority == plan.Priority.ValueInt32() { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), nil), + fmt.Sprintf("Rule with priority %d already exists in Web ACL", plan.Priority.ValueInt32()), + ) + return + } + if aws.ToString(rule.Name) == plan.RuleName.ValueString() { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), nil), + fmt.Sprintf("Rule with name %s already exists in Web ACL", plan.RuleName.ValueString()), + ) + return + } + } + + // Get rule configuration from either custom or managed rule group + var ruleGroupARN string + var ruleGroupName string + var ruleGroupVendorName string + var ruleGroupVersion string + var ruleActionOverrides []awstypes.RuleActionOverride + var ruleStatement *awstypes.Statement + + // Check for custom rule group reference + if !plan.RuleGroupReference.IsNull() && !plan.RuleGroupReference.IsUnknown() { + ruleGroupRefs := plan.RuleGroupReference.Elements() + if len(ruleGroupRefs) > 0 { + var ruleGroupRefModel ruleGroupReferenceModel + resp.Diagnostics.Append(ruleGroupRefs[0].(fwtypes.ObjectValueOf[ruleGroupReferenceModel]).As(ctx, &ruleGroupRefModel, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + ruleGroupARN = ruleGroupRefModel.ARN.ValueString() + + // Create rule group reference statement + ruleGroupRefStatement := &awstypes.RuleGroupReferenceStatement{ + ARN: aws.String(ruleGroupARN), + } + + // Add rule action overrides if specified + if !ruleGroupRefModel.RuleActionOverride.IsNull() && !ruleGroupRefModel.RuleActionOverride.IsUnknown() { + resp.Diagnostics.Append(fwflex.Expand(ctx, ruleGroupRefModel.RuleActionOverride, &ruleActionOverrides)...) + if resp.Diagnostics.HasError() { + return + } + ruleGroupRefStatement.RuleActionOverrides = ruleActionOverrides + } + + ruleStatement = &awstypes.Statement{ + RuleGroupReferenceStatement: ruleGroupRefStatement, + } + } + } + + // Check for managed rule group (mutually exclusive with custom) + if !plan.ManagedRuleGroup.IsNull() && !plan.ManagedRuleGroup.IsUnknown() { + managedRuleGroups := plan.ManagedRuleGroup.Elements() + if len(managedRuleGroups) > 0 { + var managedRuleGroupRef managedRuleGroupModel + resp.Diagnostics.Append(managedRuleGroups[0].(fwtypes.ObjectValueOf[managedRuleGroupModel]).As(ctx, &managedRuleGroupRef, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + ruleGroupName = managedRuleGroupRef.Name.ValueString() + ruleGroupVendorName = managedRuleGroupRef.VendorName.ValueString() + if !managedRuleGroupRef.Version.IsNull() && !managedRuleGroupRef.Version.IsUnknown() { + ruleGroupVersion = managedRuleGroupRef.Version.ValueString() + } + + // Create managed rule group statement + managedRuleGroupStatement := &awstypes.ManagedRuleGroupStatement{ + Name: aws.String(ruleGroupName), + VendorName: aws.String(ruleGroupVendorName), + } + if ruleGroupVersion != "" { + managedRuleGroupStatement.Version = aws.String(ruleGroupVersion) + } + + // Add rule action overrides if specified + if !managedRuleGroupRef.RuleActionOverride.IsNull() && !managedRuleGroupRef.RuleActionOverride.IsUnknown() { + resp.Diagnostics.Append(fwflex.Expand(ctx, managedRuleGroupRef.RuleActionOverride, &ruleActionOverrides)...) + if resp.Diagnostics.HasError() { + return + } + managedRuleGroupStatement.RuleActionOverrides = ruleActionOverrides + } + + ruleStatement = &awstypes.Statement{ + ManagedRuleGroupStatement: managedRuleGroupStatement, + } + } + } + + if ruleStatement == nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), nil), + "Either rule_group_reference or managed_rule_group block is required", + ) + return + } + + // Create new rule with the appropriate statement type + newRule := awstypes.Rule{ + Name: plan.RuleName.ValueStringPointer(), + Priority: plan.Priority.ValueInt32(), + Statement: ruleStatement, + VisibilityConfig: &awstypes.VisibilityConfig{ + SampledRequestsEnabled: true, + CloudWatchMetricsEnabled: true, + MetricName: plan.RuleName.ValueStringPointer(), + }, + } + + // Set override action + overrideAction := plan.OverrideAction.ValueString() + if overrideAction == "" { + overrideAction = overrideActionNone + plan.OverrideAction = types.StringValue(overrideActionNone) // Set the default in the plan + } + + switch overrideAction { + case overrideActionNone: + newRule.OverrideAction = &awstypes.OverrideAction{ + None: &awstypes.NoneAction{}, + } + case overrideActionCount: + newRule.OverrideAction = &awstypes.OverrideAction{ + Count: &awstypes.CountAction{}, + } + } + + // Add the new rule to existing rules + webACL.WebACL.Rules = append(webACL.WebACL.Rules, newRule) + + // Update the Web ACL + updateInput := &wafv2.UpdateWebACLInput{ + Id: aws.String(webACLID), + Name: aws.String(webACLName), + Scope: awstypes.Scope(webACLScope), + DefaultAction: webACL.WebACL.DefaultAction, + Rules: webACL.WebACL.Rules, + VisibilityConfig: webACL.WebACL.VisibilityConfig, + LockToken: webACL.LockToken, + AssociationConfig: webACL.WebACL.AssociationConfig, + CaptchaConfig: webACL.WebACL.CaptchaConfig, + ChallengeConfig: webACL.WebACL.ChallengeConfig, + CustomResponseBodies: webACL.WebACL.CustomResponseBodies, + TokenDomains: webACL.WebACL.TokenDomains, + } + + // Only set description if it's not empty + if webACL.WebACL.Description != nil && aws.ToString(webACL.WebACL.Description) != "" { + updateInput.Description = webACL.WebACL.Description + } + + const timeout = 5 * time.Minute + _, err = tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { + return conn.UpdateWebACL(ctx, updateInput) + }) + + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionCreating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) +} + +func (r *resourceWebACLRuleGroupAssociation) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state resourceWebACLRuleGroupAssociationModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + conn := r.Meta().WAFV2Client(ctx) + + // Use attributes directly instead of parsing ID + webACLARN := state.WebACLARN.ValueString() + ruleName := state.RuleName.ValueString() + + // Parse Web ACL ARN to get ID, name, and scope + webACLID, webACLName, webACLScope, err := parseWebACLARN(webACLARN) + if err != nil { + resp.Diagnostics.AddError( + "Reading WAFv2 Web ACL Rule Group Association", + fmt.Sprintf("Error parsing Web ACL ARN: %s", err), + ) + return + } + + // Get the Web ACL and check if the rule group is associated + webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if err != nil { + if retry.NotFound(err) { + resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.AddError( + "Reading WAFv2 Web ACL Rule Group Association", + fmt.Sprintf("Error reading Web ACL: %s", err), + ) + return + } + + // Find the rule group in the Web ACL rules + found := false + for _, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) != ruleName { + continue + } + + // Check if this rule matches our rule group configuration from state + if rule.Statement != nil { + var matchesRuleGroup bool + var ruleActionOverrides fwtypes.ListNestedObjectValueOf[ruleActionOverrideModel] + + // Check if we have a custom rule group in state + if !state.RuleGroupReference.IsNull() && !state.RuleGroupReference.IsUnknown() && rule.Statement.RuleGroupReferenceStatement != nil { + // Get the ARN from state for comparison + ruleGroupRefs := state.RuleGroupReference.Elements() + if len(ruleGroupRefs) > 0 { + var ruleGroupRefModel ruleGroupReferenceModel + resp.Diagnostics.Append(ruleGroupRefs[0].(fwtypes.ObjectValueOf[ruleGroupReferenceModel]).As(ctx, &ruleGroupRefModel, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + + if aws.ToString(rule.Statement.RuleGroupReferenceStatement.ARN) == ruleGroupRefModel.ARN.ValueString() { + matchesRuleGroup = true + // Handle rule action overrides with autoflex + if rule.Statement.RuleGroupReferenceStatement.RuleActionOverrides != nil { + resp.Diagnostics.Append(fwflex.Flatten(ctx, rule.Statement.RuleGroupReferenceStatement.RuleActionOverrides, &ruleActionOverrides)...) + if resp.Diagnostics.HasError() { + return + } + } else { + ruleActionOverrides = fwtypes.NewListNestedObjectValueOfNull[ruleActionOverrideModel](ctx) + } + + // Update the rule group reference nested structure + ruleGroupRefModel.RuleActionOverride = ruleActionOverrides + listValue, diags := fwtypes.NewListNestedObjectValueOfSlice(ctx, []*ruleGroupReferenceModel{&ruleGroupRefModel}, nil) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + state.RuleGroupReference = listValue + state.ManagedRuleGroup = fwtypes.NewListNestedObjectValueOfNull[managedRuleGroupModel](ctx) + } + } + } else if !state.ManagedRuleGroup.IsNull() && !state.ManagedRuleGroup.IsUnknown() && rule.Statement.ManagedRuleGroupStatement != nil { + // Check if we have a managed rule group in state + managedRuleGroups := state.ManagedRuleGroup.Elements() + if len(managedRuleGroups) > 0 { + var managedRuleGroupRef managedRuleGroupModel + resp.Diagnostics.Append(managedRuleGroups[0].(fwtypes.ObjectValueOf[managedRuleGroupModel]).As(ctx, &managedRuleGroupRef, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + + managedStmt := rule.Statement.ManagedRuleGroupStatement + // Check if this matches our managed rule group from state + if aws.ToString(managedStmt.Name) == managedRuleGroupRef.Name.ValueString() && + aws.ToString(managedStmt.VendorName) == managedRuleGroupRef.VendorName.ValueString() { + // Check version match (both can be empty/null) + stateVersion := managedRuleGroupRef.Version.ValueString() + ruleVersion := aws.ToString(managedStmt.Version) + if stateVersion == ruleVersion { + matchesRuleGroup = true + // Handle rule action overrides with autoflex + if managedStmt.RuleActionOverrides != nil { + resp.Diagnostics.Append(fwflex.Flatten(ctx, managedStmt.RuleActionOverrides, &ruleActionOverrides)...) + if resp.Diagnostics.HasError() { + return + } + } else { + ruleActionOverrides = fwtypes.NewListNestedObjectValueOfNull[ruleActionOverrideModel](ctx) + } + + // Update the managed rule group nested structure + managedRuleGroupRef.RuleActionOverride = ruleActionOverrides + listValue, diags := fwtypes.NewListNestedObjectValueOfSlice(ctx, []*managedRuleGroupModel{&managedRuleGroupRef}, nil) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + state.ManagedRuleGroup = listValue + state.RuleGroupReference = fwtypes.NewListNestedObjectValueOfNull[ruleGroupReferenceModel](ctx) + } + } + } + } + + if matchesRuleGroup { + found = true + state.Priority = types.Int32Value(rule.Priority) + + // Determine override action + overrideAction := overrideActionNone + if rule.OverrideAction != nil { + if rule.OverrideAction.Count != nil { + overrideAction = overrideActionCount + } else if rule.OverrideAction.None != nil { + overrideAction = overrideActionNone + } + } + state.OverrideAction = types.StringValue(overrideAction) + break + } + } + } + + if !found { + resp.Diagnostics.AddWarning( + "Rule Group Association Not Found", + "Rule group association was not found in Web ACL, removing from state", + ) + resp.State.RemoveResource(ctx) + return + } + + // Update state with current values (WebACLARN and RuleName should already be set from current state) + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +func (r *resourceWebACLRuleGroupAssociation) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state resourceWebACLRuleGroupAssociationModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + conn := r.Meta().WAFV2Client(ctx) + + // Parse Web ACL ARN to get ID, name, and scope + webACLARN := plan.WebACLARN.ValueString() + webACLID, webACLName, webACLScope, err := parseWebACLARN(webACLARN) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionUpdating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + // Get current Web ACL configuration + webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionUpdating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + // Find the rule to update + ruleName := plan.RuleName.ValueString() + ruleFound := false + for i, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) == ruleName { + ruleFound = true + + // Update the rule's priority + webACL.WebACL.Rules[i].Priority = plan.Priority.ValueInt32() + + // Update override action + overrideAction := plan.OverrideAction.ValueString() + if overrideAction == "" { + overrideAction = overrideActionNone // Default value + } + + switch overrideAction { + case overrideActionNone: + webACL.WebACL.Rules[i].OverrideAction = &awstypes.OverrideAction{ + None: &awstypes.NoneAction{}, + } + case overrideActionCount: + webACL.WebACL.Rules[i].OverrideAction = &awstypes.OverrideAction{ + Count: &awstypes.CountAction{}, + } + } + + // Update rule action overrides from nested structure (both custom and managed) + var overrides []awstypes.RuleActionOverride + if !plan.RuleGroupReference.IsNull() && !plan.RuleGroupReference.IsUnknown() { + ruleGroupRefs := plan.RuleGroupReference.Elements() + if len(ruleGroupRefs) > 0 { + var ruleGroupRefModel ruleGroupReferenceModel + resp.Diagnostics.Append(ruleGroupRefs[0].(fwtypes.ObjectValueOf[ruleGroupReferenceModel]).As(ctx, &ruleGroupRefModel, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + + if !ruleGroupRefModel.RuleActionOverride.IsNull() && !ruleGroupRefModel.RuleActionOverride.IsUnknown() { + resp.Diagnostics.Append(fwflex.Expand(ctx, ruleGroupRefModel.RuleActionOverride, &overrides)...) + if resp.Diagnostics.HasError() { + return + } + } + } + } else if !plan.ManagedRuleGroup.IsNull() && !plan.ManagedRuleGroup.IsUnknown() { + managedRuleGroups := plan.ManagedRuleGroup.Elements() + if len(managedRuleGroups) > 0 { + var managedRuleGroupRef managedRuleGroupModel + resp.Diagnostics.Append(managedRuleGroups[0].(fwtypes.ObjectValueOf[managedRuleGroupModel]).As(ctx, &managedRuleGroupRef, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + + if !managedRuleGroupRef.RuleActionOverride.IsNull() && !managedRuleGroupRef.RuleActionOverride.IsUnknown() { + resp.Diagnostics.Append(fwflex.Expand(ctx, managedRuleGroupRef.RuleActionOverride, &overrides)...) + if resp.Diagnostics.HasError() { + return + } + } + } + } + + // Update the appropriate statement type with new overrides + if webACL.WebACL.Rules[i].Statement != nil { + if webACL.WebACL.Rules[i].Statement.RuleGroupReferenceStatement != nil { + webACL.WebACL.Rules[i].Statement.RuleGroupReferenceStatement.RuleActionOverrides = overrides + } else if webACL.WebACL.Rules[i].Statement.ManagedRuleGroupStatement != nil { + webACL.WebACL.Rules[i].Statement.ManagedRuleGroupStatement.RuleActionOverrides = overrides + } + } + + break + } + } + + if !ruleFound { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionUpdating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), nil), + fmt.Sprintf("Rule %s not found in Web ACL", ruleName), + ) + return + } + + // Check for priority conflicts with other rules + for _, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) != ruleName && rule.Priority == plan.Priority.ValueInt32() { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionUpdating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), nil), + fmt.Sprintf("Rule with priority %d already exists in Web ACL", plan.Priority.ValueInt32()), + ) + return + } + } + + // Update the Web ACL with the modified rule + updateInput := &wafv2.UpdateWebACLInput{ + Id: aws.String(webACLID), + Name: aws.String(webACLName), + Scope: awstypes.Scope(webACLScope), + DefaultAction: webACL.WebACL.DefaultAction, + Rules: webACL.WebACL.Rules, + VisibilityConfig: webACL.WebACL.VisibilityConfig, + LockToken: webACL.LockToken, + AssociationConfig: webACL.WebACL.AssociationConfig, + CaptchaConfig: webACL.WebACL.CaptchaConfig, + ChallengeConfig: webACL.WebACL.ChallengeConfig, + CustomResponseBodies: webACL.WebACL.CustomResponseBodies, + TokenDomains: webACL.WebACL.TokenDomains, + } + + // Only set description if it's not empty + if webACL.WebACL.Description != nil && aws.ToString(webACL.WebACL.Description) != "" { + updateInput.Description = webACL.WebACL.Description + } + + updateTimeout := r.UpdateTimeout(ctx, plan.Timeouts) + _, err = tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, updateTimeout, func(ctx context.Context) (any, error) { + return conn.UpdateWebACL(ctx, updateInput) + }) + + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionUpdating, ResNameWebACLRuleGroupAssociation, plan.RuleName.String(), err), + err.Error(), + ) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +func (r *resourceWebACLRuleGroupAssociation) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state resourceWebACLRuleGroupAssociationModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + conn := r.Meta().WAFV2Client(ctx) + + // Use attributes directly instead of parsing ID + webACLARN := state.WebACLARN.ValueString() + ruleName := state.RuleName.ValueString() + + // Parse Web ACL ARN to get ID, name, and scope + webACLID, webACLName, webACLScope, err := parseWebACLARN(webACLARN) + if err != nil { + resp.Diagnostics.AddError( + "Deleting WAFv2 Web ACL Rule Group Association", + fmt.Sprintf("Error parsing Web ACL ARN: %s", err), + ) + return + } + + // Get the Web ACL + webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if err != nil { + if retry.NotFound(err) { + // Web ACL is already gone, nothing to do + return + } + + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionDeleting, ResNameWebACLRuleGroupAssociation, state.RuleName.String(), err), + err.Error(), + ) + return + } + + // Filter out the rule we want to remove + var updatedRules []awstypes.Rule + ruleFound := false + for _, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) != ruleName { + updatedRules = append(updatedRules, rule) + } else { + ruleFound = true + } + } + + if !ruleFound { + // Rule is already gone, nothing to do + return + } + + // Update the Web ACL without the rule + updateInput := &wafv2.UpdateWebACLInput{ + Id: aws.String(webACLID), + Name: aws.String(webACLName), + Scope: awstypes.Scope(webACLScope), + DefaultAction: webACL.WebACL.DefaultAction, + Rules: updatedRules, + VisibilityConfig: webACL.WebACL.VisibilityConfig, + LockToken: webACL.LockToken, + AssociationConfig: webACL.WebACL.AssociationConfig, + CaptchaConfig: webACL.WebACL.CaptchaConfig, + ChallengeConfig: webACL.WebACL.ChallengeConfig, + CustomResponseBodies: webACL.WebACL.CustomResponseBodies, + TokenDomains: webACL.WebACL.TokenDomains, + } + + // Only set description if it's not empty + if webACL.WebACL.Description != nil && aws.ToString(webACL.WebACL.Description) != "" { + updateInput.Description = webACL.WebACL.Description + } + + const timeout = 5 * time.Minute + _, err = tfresource.RetryWhenIsA[any, *awstypes.WAFUnavailableEntityException](ctx, timeout, func(ctx context.Context) (any, error) { + return conn.UpdateWebACL(ctx, updateInput) + }) + + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.WAFV2, create.ErrActionDeleting, ResNameWebACLRuleGroupAssociation, state.RuleName.String(), err), + err.Error(), + ) + return + } +} + +func (r *resourceWebACLRuleGroupAssociation) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + parts, err := intflex.ExpandResourceId(req.ID, webACLRuleGroupAssociationResourceIDPartCount, true) + if err != nil { + resp.Diagnostics.AddError( + "Unexpected Import Identifier", + fmt.Sprintf("Expected import identifier with format: web_acl_arn,rule_name,rule_group_type,rule_group_identifier. Got: %q", req.ID), + ) + return + } + + webACLARN := parts[0] + ruleName := parts[1] + ruleGroupType := parts[2] + ruleGroupIdentifier := parts[3] + + // Parse Web ACL ARN to get ID, name, and scope + _, _, _, err = parseWebACLARN(webACLARN) + if err != nil { + resp.Diagnostics.AddError( + "Invalid Web ACL ARN", + fmt.Sprintf("Error parsing Web ACL ARN: %s", err), + ) + return + } + + // Set basic attributes + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("web_acl_arn"), webACLARN)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("rule_name"), ruleName)...) + + // Set the appropriate rule group nested structure based on type + switch ruleGroupType { + case "custom": + // Custom rule group (ARN format) + if !arn.IsARN(ruleGroupIdentifier) { + resp.Diagnostics.AddError( + "Invalid Custom Rule Group Identifier", + "Custom rule group identifier should be an ARN", + ) + return + } + + ruleGroupRefModel := &ruleGroupReferenceModel{ + ARN: types.StringValue(ruleGroupIdentifier), + RuleActionOverride: fwtypes.NewListNestedObjectValueOfNull[ruleActionOverrideModel](ctx), + } + + listValue, diags := fwtypes.NewListNestedObjectValueOfSlice(ctx, []*ruleGroupReferenceModel{ruleGroupRefModel}, nil) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("rule_group_reference"), listValue)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("managed_rule_group"), fwtypes.NewListNestedObjectValueOfNull[managedRuleGroupModel](ctx))...) + case "managed": + // Managed rule group (vendorName:ruleName[:version] format) + identifierParts := strings.Split(ruleGroupIdentifier, ":") + if len(identifierParts) < 2 { + resp.Diagnostics.AddError( + "Invalid Managed Rule Group Identifier", + "Managed rule group identifier should be in format 'vendorName:ruleName[:version]'", + ) + return + } + + vendorName := identifierParts[0] + ruleGroupName := identifierParts[1] + var version string + if len(identifierParts) > 2 { + version = identifierParts[2] + } + + managedRuleGroupRef := &managedRuleGroupModel{ + Name: types.StringValue(ruleGroupName), + VendorName: types.StringValue(vendorName), + RuleActionOverride: fwtypes.NewListNestedObjectValueOfNull[ruleActionOverrideModel](ctx), + } + if version != "" { + managedRuleGroupRef.Version = types.StringValue(version) + } else { + managedRuleGroupRef.Version = types.StringNull() + } + + listValue, diags := fwtypes.NewListNestedObjectValueOfSlice(ctx, []*managedRuleGroupModel{managedRuleGroupRef}, nil) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("managed_rule_group"), listValue)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("rule_group_reference"), fwtypes.NewListNestedObjectValueOfNull[ruleGroupReferenceModel](ctx))...) + default: + resp.Diagnostics.AddError( + "Invalid Rule Group Type", + fmt.Sprintf("Rule group type must be 'custom' or 'managed', got: %s", ruleGroupType), + ) + return + } +} + +// parseWebACLARN extracts the Web ACL ID, name, and scope from the ARN +func parseWebACLARN(arn string) (id, name, scope string, err error) { + // ARN format: arn:aws:wafv2:region:account-id:scope/webacl/name/id + // or for CloudFront: arn:aws:wafv2:global:account-id:global/webacl/name/id + parts := strings.Split(arn, ":") + if len(parts) < 6 { + return "", "", "", fmt.Errorf("invalid Web ACL ARN format: %s", arn) + } + + resourceParts := strings.Split(parts[5], "/") + if len(resourceParts) < 4 { + return "", "", "", fmt.Errorf("invalid Web ACL ARN resource format: %s", parts[5]) + } + + // Validate that this is a webacl ARN + if resourceParts[1] != "webacl" { + return "", "", "", fmt.Errorf("invalid Web ACL ARN: expected webacl resource type, got %s", resourceParts[1]) + } + + // Determine scope + scopeValue := "REGIONAL" + if parts[3] == "global" || resourceParts[0] == "global" { + scopeValue = "CLOUDFRONT" + } + + // Extract name and ID + nameIndex := len(resourceParts) - 2 + idIndex := len(resourceParts) - 1 + + return resourceParts[idIndex], resourceParts[nameIndex], scopeValue, nil +} + +type resourceWebACLRuleGroupAssociationModel struct { + framework.WithRegionModel + RuleName types.String `tfsdk:"rule_name"` + Priority types.Int32 `tfsdk:"priority"` + RuleGroupReference fwtypes.ListNestedObjectValueOf[ruleGroupReferenceModel] `tfsdk:"rule_group_reference"` + ManagedRuleGroup fwtypes.ListNestedObjectValueOf[managedRuleGroupModel] `tfsdk:"managed_rule_group"` + WebACLARN types.String `tfsdk:"web_acl_arn"` + OverrideAction types.String `tfsdk:"override_action"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +type ruleGroupReferenceModel struct { + ARN types.String `tfsdk:"arn"` + RuleActionOverride fwtypes.ListNestedObjectValueOf[ruleActionOverrideModel] `tfsdk:"rule_action_override"` +} + +type managedRuleGroupModel struct { + Name types.String `tfsdk:"name"` + VendorName types.String `tfsdk:"vendor_name"` + Version types.String `tfsdk:"version"` + RuleActionOverride fwtypes.ListNestedObjectValueOf[ruleActionOverrideModel] `tfsdk:"rule_action_override"` +} + +type ruleActionOverrideModel struct { + Name types.String `tfsdk:"name"` + ActionToUse fwtypes.ListNestedObjectValueOf[actionToUseModel] `tfsdk:"action_to_use"` +} + +type actionToUseModel struct { + Allow fwtypes.ListNestedObjectValueOf[allowActionModel] `tfsdk:"allow"` + Block fwtypes.ListNestedObjectValueOf[blockActionModel] `tfsdk:"block"` + Captcha fwtypes.ListNestedObjectValueOf[captchaActionModel] `tfsdk:"captcha"` + Challenge fwtypes.ListNestedObjectValueOf[challengeActionModel] `tfsdk:"challenge"` + Count fwtypes.ListNestedObjectValueOf[countActionModel] `tfsdk:"count"` +} + +type allowActionModel struct { + CustomRequestHandling fwtypes.ListNestedObjectValueOf[customRequestHandlingModel] `tfsdk:"custom_request_handling"` +} + +type blockActionModel struct { + CustomResponse fwtypes.ListNestedObjectValueOf[customResponseModel] `tfsdk:"custom_response"` +} + +type captchaActionModel struct { + CustomRequestHandling fwtypes.ListNestedObjectValueOf[customRequestHandlingModel] `tfsdk:"custom_request_handling"` +} + +type challengeActionModel struct { + CustomRequestHandling fwtypes.ListNestedObjectValueOf[customRequestHandlingModel] `tfsdk:"custom_request_handling"` +} + +type countActionModel struct { + CustomRequestHandling fwtypes.ListNestedObjectValueOf[customRequestHandlingModel] `tfsdk:"custom_request_handling"` +} + +type customRequestHandlingModel struct { + InsertHeader fwtypes.ListNestedObjectValueOf[insertHeaderModel] `tfsdk:"insert_header"` +} + +type customResponseModel struct { + CustomResponseBodyKey types.String `tfsdk:"custom_response_body_key"` + ResponseCode types.Int32 `tfsdk:"response_code"` + ResponseHeader fwtypes.ListNestedObjectValueOf[responseHeaderModel] `tfsdk:"response_header"` +} + +type insertHeaderModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} + +type responseHeaderModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} diff --git a/internal/service/wafv2/web_acl_rule_group_association_test.go b/internal/service/wafv2/web_acl_rule_group_association_test.go new file mode 100644 index 000000000000..b87471a9da8e --- /dev/null +++ b/internal/service/wafv2/web_acl_rule_group_association_test.go @@ -0,0 +1,1504 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package wafv2_test + +import ( + "context" + "fmt" + "testing" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/wafv2" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestParseWebACLARN(t *testing.T) { + t.Parallel() + + testCases := map[string]struct { + arn string + expectedID string + expectedName string + expectedScope string + expectError bool + }{ + "valid regional ARN": { + arn: "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/test-web-acl/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "test-web-acl", + expectedScope: "REGIONAL", + expectError: false, + }, + "valid CloudFront ARN with global region": { + arn: "arn:aws:wafv2:global:123456789012:global/webacl/test-web-acl/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "test-web-acl", + expectedScope: "CLOUDFRONT", + expectError: false, + }, + "valid CloudFront ARN with specific region": { + arn: "arn:aws:wafv2:us-east-1:123456789012:global/webacl/test-web-acl/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "test-web-acl", + expectedScope: "CLOUDFRONT", + expectError: false, + }, + "web ACL name with hyphens": { + arn: "arn:aws:wafv2:us-west-2:123456789012:regional/webacl/my-test-web-acl-name/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "my-test-web-acl-name", + expectedScope: "REGIONAL", + expectError: false, + }, + "web ACL name with underscores": { + arn: "arn:aws:wafv2:eu-west-1:123456789012:regional/webacl/my_test_web_acl_name/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "my_test_web_acl_name", + expectedScope: "REGIONAL", + expectError: false, + }, + "invalid ARN - too few parts": { + arn: "arn:aws:wafv2:us-east-1:123456789012", //lintignore:AWSAT003,AWSAT005 + expectError: true, + }, + "invalid ARN - empty": { + arn: "", + expectError: true, + }, + "invalid ARN - not an ARN": { + arn: "not-an-arn", + expectError: true, + }, + "invalid resource format - too few parts": { + arn: "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/test-web-acl", //lintignore:AWSAT003,AWSAT005 + expectError: true, + }, + "invalid resource format - wrong resource type": { + arn: "arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/test-rule-group/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectError: true, + }, + "different AWS partition": { + arn: "arn:aws-us-gov:wafv2:us-gov-east-1:123456789012:regional/webacl/test-web-acl/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "test-web-acl", + expectedScope: "REGIONAL", + expectError: false, + }, + "different AWS partition with CloudFront": { + arn: "arn:aws-cn:wafv2:global:123456789012:global/webacl/test-web-acl/12345678-1234-1234-1234-123456789012", //lintignore:AWSAT003,AWSAT005 + expectedID: "12345678-1234-1234-1234-123456789012", + expectedName: "test-web-acl", + expectedScope: "CLOUDFRONT", + expectError: false, + }, + } + + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + t.Parallel() + + id, name, scope, err := tfwafv2.ParseWebACLARN(testCase.arn) + + if testCase.expectError { + if err == nil { + t.Errorf("expected error but got none") + } + return + } + + if err != nil { + t.Errorf("unexpected error: %v", err) + return + } + + if id != testCase.expectedID { + t.Errorf("expected ID %q, got %q", testCase.expectedID, id) + } + + if name != testCase.expectedName { + t.Errorf("expected name %q, got %q", testCase.expectedName, name) + } + + if scope != testCase.expectedScope { + t.Errorf("expected scope %q, got %q", testCase.expectedScope, scope) + } + }) + } +} + +func TestAccWAFV2WebACLRuleGroupAssociation_basic(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + webACLResourceName := "aws_wafv2_web_acl.test" + ruleGroupResourceName := "aws_wafv2_rule_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_name", fmt.Sprintf("%s-association", rName)), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "10"), + resource.TestCheckResourceAttr(resourceName, "override_action", "none"), + resource.TestCheckResourceAttrPair(resourceName, "web_acl_arn", webACLResourceName, names.AttrARN), + resource.TestCheckResourceAttrPair(resourceName, "rule_group_reference.0.arn", ruleGroupResourceName, names.AttrARN), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_disappears(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfwafv2.ResourceWebACLRuleGroupAssociation, resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_overrideAction(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_overrideAction(rName, "count"), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "override_action", "count"), + ), + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_ruleActionOverride(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverride(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.#", "2"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.name", "rule-1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.allow.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.allow.0.custom_request_handling.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.allow.0.custom_request_handling.0.insert_header.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.allow.0.custom_request_handling.0.insert_header.0.name", "X-Custom-Header"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.allow.0.custom_request_handling.0.insert_header.0.value", "custom-value"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.name", "rule-2"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.0.custom_response.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.0.custom_response.0.response_code", "403"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.0.custom_response.0.response_header.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.0.custom_response.0.response_header.0.name", "X-Block-Reason"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.1.action_to_use.0.block.0.custom_response.0.response_header.0.value", "rule-override"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_ruleActionOverrideUpdate(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverrideCount(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.name", "rule-1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.count.#", "1"), + ), + }, + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverrideCaptcha(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.name", "rule-1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.0.rule_action_override.0.action_to_use.0.captcha.#", "1"), + ), + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_priorityUpdate(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_priority(rName, 10), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "10"), + ), + }, + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_priority(rName, 20), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "20"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_overrideActionUpdate(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_overrideAction(rName, "none"), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "override_action", "none"), + ), + }, + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_overrideAction(rName, "count"), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "override_action", "count"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_ruleNameRequiresReplace(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleName(rName, "original-rule"), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_name", "original-rule"), + ), + }, + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleName(rName, "updated-rule"), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionDestroyBeforeCreate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "rule_name", "updated-rule"), + ), + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_RuleGroupReference_webACLARNRequiresReplace(t *testing.T) { + ctx := acctest.Context(t) + var v wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_webACL(rName, "first"), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + ), + }, + { + Config: testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_webACL(rName, "second"), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionDestroyBeforeCreate), + }, + }, + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &v), + ), + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_ManagedRuleGroup_basic(t *testing.T) { + ctx := acctest.Context(t) + var webACL wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "rule_name", "test-rule"), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "1"), + resource.TestCheckResourceAttr(resourceName, "override_action", "none"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.name", "AWSManagedRulesCommonRuleSet"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.vendor_name", "AWS"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationManagedRuleGroupImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_ManagedRuleGroup_withVersion(t *testing.T) { + ctx := acctest.Context(t) + var webACL wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_withVersion(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "rule_name", "test-rule"), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "1"), + resource.TestCheckResourceAttr(resourceName, "override_action", "none"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.name", "AWSManagedRulesCommonRuleSet"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.vendor_name", "AWS"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.version", "Version_1.0"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationManagedRuleGroupImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func TestAccWAFV2WebACLRuleGroupAssociation_ManagedRuleGroup_ruleActionOverride(t *testing.T) { + ctx := acctest.Context(t) + var webACL wafv2.GetWebACLOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_wafv2_web_acl_rule_group_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.WAFV2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWebACLRuleGroupAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_ruleActionOverride(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckWebACLRuleGroupAssociationExists(ctx, resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "rule_name", "test-rule"), + resource.TestCheckResourceAttr(resourceName, names.AttrPriority, "1"), + resource.TestCheckResourceAttr(resourceName, "override_action", "none"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.name", "AWSManagedRulesCommonRuleSet"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.vendor_name", "AWS"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.rule_action_override.#", "1"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.rule_action_override.0.name", "GenericRFI_BODY"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.rule_action_override.0.action_to_use.#", "1"), + resource.TestCheckResourceAttr(resourceName, "managed_rule_group.0.rule_action_override.0.action_to_use.0.count.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rule_group_reference.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccWebACLRuleGroupAssociationManagedRuleGroupImportStateIDFunc(resourceName), + ImportStateVerifyIdentifierAttribute: "web_acl_arn", + }, + }, + }) +} + +func testAccCheckWebACLRuleGroupAssociationDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).WAFV2Client(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_wafv2_web_acl_rule_group_association" { + continue + } + + // Use resource attributes directly instead of parsing ID + webACLARN := rs.Primary.Attributes["web_acl_arn"] + ruleName := rs.Primary.Attributes["rule_name"] + + // Determine rule group type and identifier from attributes + var ruleGroupType, ruleGroupIdentifier string + if rs.Primary.Attributes["rule_group_reference.0.arn"] != "" { + ruleGroupType = "custom" + ruleGroupIdentifier = rs.Primary.Attributes["rule_group_reference.0.arn"] + } else if rs.Primary.Attributes["managed_rule_group.0.name"] != "" { + ruleGroupType = "managed" + vendorName := rs.Primary.Attributes["managed_rule_group.0.vendor_name"] + ruleGroupName := rs.Primary.Attributes["managed_rule_group.0.name"] + version := rs.Primary.Attributes["managed_rule_group.0.version"] + ruleGroupIdentifier = fmt.Sprintf("%s:%s", vendorName, ruleGroupName) + if version != "" { + ruleGroupIdentifier += ":" + version + } + } else { + continue // Skip if no rule group configuration found + } + + // Parse Web ACL ARN to get ID, name, and scope + webACLID, webACLName, webACLScope, err := tfwafv2.ParseWebACLARN(webACLARN) + if err != nil { + continue + } + + // Get the Web ACL + webACL, err := tfwafv2.FindWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if tfresource.NotFound(err) { + // Web ACL is gone, so the association is definitely destroyed + continue + } + if err != nil { + return fmt.Errorf("error reading Web ACL (%s): %w", webACLARN, err) + } + + // Check if the rule still exists in the Web ACL + for _, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) != ruleName || rule.Statement == nil { + continue + } + + // Check if this rule matches our rule group type and identifier + var matchesRuleGroup bool + if ruleGroupType == "custom" && rule.Statement.RuleGroupReferenceStatement != nil { + // For custom rule groups, the identifier is the ARN + if aws.ToString(rule.Statement.RuleGroupReferenceStatement.ARN) == ruleGroupIdentifier { + matchesRuleGroup = true + } + } else if ruleGroupType == "managed" && rule.Statement.ManagedRuleGroupStatement != nil { + // For managed rule groups, construct identifier and compare + managedStmt := rule.Statement.ManagedRuleGroupStatement + managedIdentifier := fmt.Sprintf("%s:%s", aws.ToString(managedStmt.VendorName), aws.ToString(managedStmt.Name)) + if managedStmt.Version != nil && aws.ToString(managedStmt.Version) != "" { + managedIdentifier += ":" + aws.ToString(managedStmt.Version) + } + if managedIdentifier == ruleGroupIdentifier { + matchesRuleGroup = true + } + } + + if matchesRuleGroup { + return fmt.Errorf("WAFv2 Web ACL Rule Group Association still exists in Web ACL %s for rule %s", webACLARN, ruleName) + } + } + } + + return nil + } +} + +func testAccCheckWebACLRuleGroupAssociationExists(ctx context.Context, n string, v *wafv2.GetWebACLOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + // Use resource attributes directly instead of parsing ID + webACLARN := rs.Primary.Attributes["web_acl_arn"] + ruleName := rs.Primary.Attributes["rule_name"] + + if webACLARN == "" || ruleName == "" { + return fmt.Errorf("Missing required attributes: web_acl_arn=%s, rule_name=%s", webACLARN, ruleName) + } + + // Determine rule group type and identifier from attributes + var ruleGroupType, ruleGroupIdentifier string + if rs.Primary.Attributes["rule_group_reference.0.arn"] != "" { + ruleGroupType = "custom" + ruleGroupIdentifier = rs.Primary.Attributes["rule_group_reference.0.arn"] + } else if rs.Primary.Attributes["managed_rule_group.0.name"] != "" { + ruleGroupType = "managed" + vendorName := rs.Primary.Attributes["managed_rule_group.0.vendor_name"] + ruleGroupName := rs.Primary.Attributes["managed_rule_group.0.name"] + version := rs.Primary.Attributes["managed_rule_group.0.version"] + ruleGroupIdentifier = fmt.Sprintf("%s:%s", vendorName, ruleGroupName) + if version != "" { + ruleGroupIdentifier += ":" + version + } + } else { + return fmt.Errorf("No rule group configuration found in state") + } + + // Parse Web ACL ARN to get ID, name, and scope + webACLID, webACLName, webACLScope, err := tfwafv2.ParseWebACLARN(webACLARN) + if err != nil { + return fmt.Errorf("error parsing Web ACL ARN: %w", err) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).WAFV2Client(ctx) + + // Get the Web ACL + webACL, err := tfwafv2.FindWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if err != nil { + return fmt.Errorf("error reading Web ACL (%s): %w", webACLARN, err) + } + + // Check if the rule exists in the Web ACL with the correct configuration + found := false + for _, rule := range webACL.WebACL.Rules { + if aws.ToString(rule.Name) != ruleName || rule.Statement == nil { + continue + } + + // Check if this rule matches our rule group type and identifier + var matchesRuleGroup bool + if ruleGroupType == "custom" && rule.Statement.RuleGroupReferenceStatement != nil { + // For custom rule groups, the identifier is the ARN + if aws.ToString(rule.Statement.RuleGroupReferenceStatement.ARN) == ruleGroupIdentifier { + matchesRuleGroup = true + } + } else if ruleGroupType == "managed" && rule.Statement.ManagedRuleGroupStatement != nil { + // For managed rule groups, construct identifier and compare + managedStmt := rule.Statement.ManagedRuleGroupStatement + managedIdentifier := fmt.Sprintf("%s:%s", aws.ToString(managedStmt.VendorName), aws.ToString(managedStmt.Name)) + if managedStmt.Version != nil && aws.ToString(managedStmt.Version) != "" { + managedIdentifier += ":" + aws.ToString(managedStmt.Version) + } + if managedIdentifier == ruleGroupIdentifier { + matchesRuleGroup = true + } + } + + if matchesRuleGroup { + found = true + break + } + } + + if !found { + return fmt.Errorf("WAFv2 Web ACL Rule Group Association not found in Web ACL %s for rule %s", webACLARN, ruleName) + } + + *v = *webACL + + return nil + } +} + +func testAccWebACLRuleGroupAssociationImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + webACLARN := rs.Primary.Attributes["web_acl_arn"] + ruleGroupARN := rs.Primary.Attributes["rule_group_reference.0.arn"] + ruleName := rs.Primary.Attributes["rule_name"] + + // Format: webACLARN,ruleName,ruleGroupType,ruleGroupIdentifier + return fmt.Sprintf("%s,%s,%s,%s", webACLARN, ruleName, "custom", ruleGroupARN), nil + } +} + +func testAccWebACLRuleGroupAssociationManagedRuleGroupImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + webACLARN := rs.Primary.Attributes["web_acl_arn"] + vendorName := rs.Primary.Attributes["managed_rule_group.0.vendor_name"] + ruleGroupName := rs.Primary.Attributes["managed_rule_group.0.name"] + version := rs.Primary.Attributes["managed_rule_group.0.version"] + ruleName := rs.Primary.Attributes["rule_name"] + + // Build managed rule group identifier: vendorName:ruleGroupName[:version] + ruleGroupIdentifier := fmt.Sprintf("%s:%s", vendorName, ruleGroupName) + if version != "" { + ruleGroupIdentifier += ":" + version + } + + // Format: webACLARN,ruleName,ruleGroupType,ruleGroupIdentifier + return fmt.Sprintf("%s,%s,%s,%s", webACLARN, ruleName, "managed", ruleGroupIdentifier), nil + } +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_basic(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + count {} + } + + statement { + geo_match_statement { + country_codes = ["US", "CA"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + web_acl_arn = aws_wafv2_web_acl.test.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + } +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_overrideAction(rName, overrideAction string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US", "CA"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + web_acl_arn = aws_wafv2_web_acl.test.arn + override_action = %[2]q + + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + } +} +`, rName, overrideAction) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverride(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US", "CA"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + rule { + name = "rule-2" + priority = 2 + + action { + allow {} + } + + statement { + ip_set_reference_statement { + arn = aws_wafv2_ip_set.test.arn + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-2" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_ip_set" "test" { + name = %[1]q + scope = "REGIONAL" + + ip_address_version = "IPV4" + addresses = ["192.0.2.0/24"] +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + web_acl_arn = aws_wafv2_web_acl.test.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + + rule_action_override { + name = "rule-1" + action_to_use { + allow { + custom_request_handling { + insert_header { + name = "X-Custom-Header" + value = "custom-value" + } + } + } + } + } + + rule_action_override { + name = "rule-2" + action_to_use { + block { + custom_response { + response_code = 403 + response_header { + name = "X-Block-Reason" + value = "rule-override" + } + } + } + } + } + } +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverrideCount(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US", "CA"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + web_acl_arn = aws_wafv2_web_acl.test.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + + rule_action_override { + name = "rule-1" + action_to_use { + count { + custom_request_handling { + insert_header { + name = "X-Count-Header" + value = "counted" + } + } + } + } + } + } +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleActionOverrideCaptcha(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US", "CA"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + + rule_action_override { + name = "rule-1" + action_to_use { + captcha { + custom_request_handling { + insert_header { + name = "X-Captcha-Header" + value = "captcha-required" + } + } + } + } + } + } + web_acl_arn = aws_wafv2_web_acl.test.arn +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_priority(rName string, priority int) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = %[2]d + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + } + web_acl_arn = aws_wafv2_web_acl.test.arn + override_action = "none" +} +`, rName, priority) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_ruleName(rName, ruleName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = %[2]q + priority = 10 + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + } + web_acl_arn = aws_wafv2_web_acl.test.arn + override_action = "none" +} +`, rName, ruleName) +} + +func testAccWebACLRuleGroupAssociationConfig_RuleGroupReference_webACL(rName, webACLSuffix string) string { + return fmt.Sprintf(` +resource "aws_wafv2_rule_group" "test" { + name = %[1]q + scope = "REGIONAL" + capacity = 10 + + rule { + name = "rule-1" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["US"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "rule-1" + sampled_requests_enabled = false + } + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } +} + +resource "aws_wafv2_web_acl" "test" { + name = "%[1]s-%[2]s" + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = "%[1]s-%[2]s" + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "%[1]s-association" + priority = 10 + rule_group_reference { + arn = aws_wafv2_rule_group.test.arn + } + web_acl_arn = aws_wafv2_web_acl.test.arn + override_action = "none" +} +`, rName, webACLSuffix) +} + +func testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_basic(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "test-rule" + priority = 1 + web_acl_arn = aws_wafv2_web_acl.test.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + } + + override_action = "none" +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_withVersion(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "test-rule" + priority = 1 + web_acl_arn = aws_wafv2_web_acl.test.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + version = "Version_1.0" + } + + override_action = "none" +} +`, rName) +} + +func testAccWebACLRuleGroupAssociationConfig_ManagedRuleGroup_ruleActionOverride(rName string) string { + return fmt.Sprintf(` +resource "aws_wafv2_web_acl" "test" { + name = %[1]q + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = false + metric_name = %[1]q + sampled_requests_enabled = false + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "test" { + rule_name = "test-rule" + priority = 1 + web_acl_arn = aws_wafv2_web_acl.test.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + + rule_action_override { + name = "GenericRFI_BODY" + action_to_use { + count {} + } + } + } + + override_action = "none" +} +`, rName) +} diff --git a/internal/service/wellarchitected/service_endpoint_resolver_gen.go b/internal/service/wellarchitected/service_endpoint_resolver_gen.go index 37d1771b72af..ccce2685f172 100644 --- a/internal/service/wellarchitected/service_endpoint_resolver_gen.go +++ b/internal/service/wellarchitected/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params wellarchitected. }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up wellarchitected endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up wellarchitected endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index b6bd0d8a32a2..7043a627348a 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/workspaces/directory.go b/internal/service/workspaces/directory.go index 4323ba6a2ef0..7e481847bea2 100644 --- a/internal/service/workspaces/directory.go +++ b/internal/service/workspaces/directory.go @@ -384,8 +384,8 @@ func resourceDirectoryCreate(ctx context.Context, d *schema.ResourceData, meta a const ( timeout = 2 * time.Minute ) - output, err := tfresource.RetryWhenIsA[*types.InvalidResourceStateException](ctx, timeout, - func() (any, error) { + output, err := tfresource.RetryWhenIsA[any, *types.InvalidResourceStateException](ctx, timeout, + func(ctx context.Context) (any, error) { return conn.RegisterWorkspaceDirectory(ctx, &input) }) @@ -675,8 +675,8 @@ func resourceDirectoryDelete(ctx context.Context, d *schema.ResourceData, meta a const ( timeout = 2 * time.Minute ) - _, err := tfresource.RetryWhenIsA[*types.InvalidResourceStateException](ctx, timeout, - func() (any, error) { + _, err := tfresource.RetryWhenIsA[any, *types.InvalidResourceStateException](ctx, timeout, + func(ctx context.Context) (any, error) { return conn.DeregisterWorkspaceDirectory(ctx, &input) }) diff --git a/internal/service/workspaces/service_endpoint_resolver_gen.go b/internal/service/workspaces/service_endpoint_resolver_gen.go index f490c10c28e2..c15acea60cff 100644 --- a/internal/service/workspaces/service_endpoint_resolver_gen.go +++ b/internal/service/workspaces/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params workspaces.Endpo }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up workspaces endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up workspaces endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index 09554602d634..75ff50a05311 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/workspacesweb/browser_settings_tags_gen_test.go b/internal/service/workspacesweb/browser_settings_tags_gen_test.go index 8e83fae0e757..2e5d717491aa 100644 --- a/internal/service/workspacesweb/browser_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/browser_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebBrowserSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -199,6 +200,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags(t *testing.T) { func TestAccWorkSpacesWebBrowserSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -260,6 +262,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebBrowserSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -309,6 +312,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebBrowserSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -387,6 +391,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_AddOnUpdate(t *testing.T) { func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -476,6 +481,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -613,6 +619,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -701,6 +708,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_EmptyTag_OnUpdate_Replace(t *testi func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -881,6 +889,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_providerOnly(t *testin func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1040,6 +1049,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nonOverlapping(t *test func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1215,6 +1225,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_overlapping(t *testing func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1303,6 +1314,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_updateToProviderOnly(t func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1390,6 +1402,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_updateToResourceOnly(t func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1455,6 +1468,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_emptyResourceTag(t *te func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1512,6 +1526,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1580,6 +1595,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nullOverlappingResourc func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1650,6 +1666,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_DefaultTags_nullNonOverlappingReso func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1704,6 +1721,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnCreate(t *testing.T) func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1799,6 +1817,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnUpdate_Add(t *testin func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -1884,6 +1903,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_ComputedTag_OnUpdate_Replace(t *te func TestAccWorkSpacesWebBrowserSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" @@ -2042,6 +2062,7 @@ func TestAccWorkSpacesWebBrowserSettings_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccWorkSpacesWebBrowserSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.BrowserSettings resourceName := "aws_workspacesweb_browser_settings.test" diff --git a/internal/service/workspacesweb/data_protection_settings_tags_gen_test.go b/internal/service/workspacesweb/data_protection_settings_tags_gen_test.go index a89dfdb12aa3..595d702d121c 100644 --- a/internal/service/workspacesweb/data_protection_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/data_protection_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebDataProtectionSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -199,6 +200,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags(t *testing.T) { func TestAccWorkSpacesWebDataProtectionSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -260,6 +262,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -309,6 +312,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebDataProtectionSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -387,6 +391,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_AddOnUpdate(t *testing.T) { func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -476,6 +481,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnCreate(t *testin func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -613,6 +619,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnUpdate_Add(t *te func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -701,6 +708,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_EmptyTag_OnUpdate_Replace(t func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -881,6 +889,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_providerOnly(t func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1040,6 +1049,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nonOverlapping( func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1215,6 +1225,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_overlapping(t * func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1303,6 +1314,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_updateToProvide func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1390,6 +1402,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_updateToResourc func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1455,6 +1468,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_emptyResourceTa func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1512,6 +1526,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_emptyProviderOn func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1580,6 +1595,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nullOverlapping func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1650,6 +1666,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_DefaultTags_nullNonOverlapp func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1704,6 +1721,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnCreate(t *tes func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1799,6 +1817,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnUpdate_Add(t func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -1884,6 +1903,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_ComputedTag_OnUpdate_Replac func TestAccWorkSpacesWebDataProtectionSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" @@ -2042,6 +2062,7 @@ func TestAccWorkSpacesWebDataProtectionSettings_tags_IgnoreTags_Overlap_DefaultT func TestAccWorkSpacesWebDataProtectionSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.DataProtectionSettings resourceName := "aws_workspacesweb_data_protection_settings.test" diff --git a/internal/service/workspacesweb/ip_access_settings_tags_gen_test.go b/internal/service/workspacesweb/ip_access_settings_tags_gen_test.go index 367819e2a557..96833b1b0757 100644 --- a/internal/service/workspacesweb/ip_access_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/ip_access_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebIPAccessSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -199,6 +200,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags(t *testing.T) { func TestAccWorkSpacesWebIPAccessSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -260,6 +262,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -309,6 +312,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebIPAccessSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -387,6 +391,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_AddOnUpdate(t *testing.T) { func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -476,6 +481,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -613,6 +619,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnUpdate_Add(t *testing. func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -701,6 +708,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_EmptyTag_OnUpdate_Replace(t *test func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -881,6 +889,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_providerOnly(t *testi func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1040,6 +1049,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nonOverlapping(t *tes func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1215,6 +1225,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_overlapping(t *testin func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1303,6 +1314,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_updateToProviderOnly( func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1390,6 +1402,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_updateToResourceOnly( func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1455,6 +1468,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_emptyResourceTag(t *t func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1512,6 +1526,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_emptyProviderOnlyTag( func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1580,6 +1595,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nullOverlappingResour func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1650,6 +1666,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_DefaultTags_nullNonOverlappingRes func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1704,6 +1721,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnCreate(t *testing.T func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1799,6 +1817,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnUpdate_Add(t *testi func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -1884,6 +1903,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_ComputedTag_OnUpdate_Replace(t *t func TestAccWorkSpacesWebIPAccessSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" @@ -2042,6 +2062,7 @@ func TestAccWorkSpacesWebIPAccessSettings_tags_IgnoreTags_Overlap_DefaultTag(t * func TestAccWorkSpacesWebIPAccessSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.IpAccessSettings resourceName := "aws_workspacesweb_ip_access_settings.test" diff --git a/internal/service/workspacesweb/network_settings_tags_gen_test.go b/internal/service/workspacesweb/network_settings_tags_gen_test.go index ca2b12c7a899..dae18ed395e8 100644 --- a/internal/service/workspacesweb/network_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/network_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebNetworkSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -199,6 +200,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags(t *testing.T) { func TestAccWorkSpacesWebNetworkSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -260,6 +262,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebNetworkSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -309,6 +312,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebNetworkSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -387,6 +391,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_AddOnUpdate(t *testing.T) { func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -476,6 +481,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -613,6 +619,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -701,6 +708,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_EmptyTag_OnUpdate_Replace(t *testi func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -881,6 +889,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_providerOnly(t *testin func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1040,6 +1049,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nonOverlapping(t *test func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1215,6 +1225,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_overlapping(t *testing func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1303,6 +1314,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_updateToProviderOnly(t func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1390,6 +1402,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_updateToResourceOnly(t func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1455,6 +1468,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_emptyResourceTag(t *te func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1512,6 +1526,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_emptyProviderOnlyTag(t func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1580,6 +1595,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nullOverlappingResourc func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1650,6 +1666,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_DefaultTags_nullNonOverlappingReso func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1704,6 +1721,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnCreate(t *testing.T) func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1799,6 +1817,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnUpdate_Add(t *testin func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -1884,6 +1903,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_ComputedTag_OnUpdate_Replace(t *te func TestAccWorkSpacesWebNetworkSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" @@ -2042,6 +2062,7 @@ func TestAccWorkSpacesWebNetworkSettings_tags_IgnoreTags_Overlap_DefaultTag(t *t func TestAccWorkSpacesWebNetworkSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.NetworkSettings resourceName := "aws_workspacesweb_network_settings.test" diff --git a/internal/service/workspacesweb/service_endpoint_resolver_gen.go b/internal/service/workspacesweb/service_endpoint_resolver_gen.go index cdb424937fcc..814afc3d7e90 100644 --- a/internal/service/workspacesweb/service_endpoint_resolver_gen.go +++ b/internal/service/workspacesweb/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params workspacesweb.En }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up workspacesweb endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up workspacesweb endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index 389e3634c1b3..6ffb9506201d 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/service/workspacesweb/user_access_logging_settings_tags_gen_test.go b/internal/service/workspacesweb/user_access_logging_settings_tags_gen_test.go index 2c2f944bf03c..6da331c4d75c 100644 --- a/internal/service/workspacesweb/user_access_logging_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/user_access_logging_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebUserAccessLoggingSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -208,6 +209,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags(t *testing.T) { func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -272,6 +274,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -324,6 +327,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -406,6 +410,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_AddOnUpdate(t *testing.T func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnCreate(t *tes func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -643,6 +649,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnUpdate_Add(t func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -735,6 +742,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_EmptyTag_OnUpdate_Replac func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -924,6 +932,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_providerOnly func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1090,6 +1099,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nonOverlappi func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1272,6 +1282,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_overlapping( func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1364,6 +1375,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_updateToProv func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1455,6 +1467,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_updateToReso func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1523,6 +1536,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_emptyResourc func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1583,6 +1597,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_emptyProvide func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1654,6 +1669,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nullOverlapp func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1727,6 +1743,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_DefaultTags_nullNonOverl func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1784,6 +1801,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnCreate(t * func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1883,6 +1901,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnUpdate_Add func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1972,6 +1991,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_ComputedTag_OnUpdate_Rep func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2134,6 +2154,7 @@ func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_IgnoreTags_Overlap_Defau func TestAccWorkSpacesWebUserAccessLoggingSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserAccessLoggingSettings resourceName := "aws_workspacesweb_user_access_logging_settings.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/workspacesweb/user_settings_tags_gen_test.go b/internal/service/workspacesweb/user_settings_tags_gen_test.go index 20d0ba52b1e0..1510985e51a6 100644 --- a/internal/service/workspacesweb/user_settings_tags_gen_test.go +++ b/internal/service/workspacesweb/user_settings_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccWorkSpacesWebUserSettings_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -199,6 +200,7 @@ func TestAccWorkSpacesWebUserSettings_tags(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -260,6 +262,7 @@ func TestAccWorkSpacesWebUserSettings_tags_null(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -309,6 +312,7 @@ func TestAccWorkSpacesWebUserSettings_tags_EmptyMap(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -387,6 +391,7 @@ func TestAccWorkSpacesWebUserSettings_tags_AddOnUpdate(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -476,6 +481,7 @@ func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -613,6 +619,7 @@ func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -701,6 +708,7 @@ func TestAccWorkSpacesWebUserSettings_tags_EmptyTag_OnUpdate_Replace(t *testing. func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -881,6 +889,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_providerOnly(t *testing.T func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1040,6 +1049,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nonOverlapping(t *testing func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1215,6 +1225,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_overlapping(t *testing.T) func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1303,6 +1314,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_updateToProviderOnly(t *t func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1390,6 +1402,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_updateToResourceOnly(t *t func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1455,6 +1468,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_emptyResourceTag(t *testi func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1512,6 +1526,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_emptyProviderOnlyTag(t *t func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1580,6 +1595,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nullOverlappingResourceTa func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1650,6 +1666,7 @@ func TestAccWorkSpacesWebUserSettings_tags_DefaultTags_nullNonOverlappingResourc func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1704,6 +1721,7 @@ func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1799,6 +1817,7 @@ func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnUpdate_Add(t *testing.T func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -1884,6 +1903,7 @@ func TestAccWorkSpacesWebUserSettings_tags_ComputedTag_OnUpdate_Replace(t *testi func TestAccWorkSpacesWebUserSettings_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" @@ -2042,6 +2062,7 @@ func TestAccWorkSpacesWebUserSettings_tags_IgnoreTags_Overlap_DefaultTag(t *test func TestAccWorkSpacesWebUserSettings_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.UserSettings resourceName := "aws_workspacesweb_user_settings.test" diff --git a/internal/service/xray/encryption_config_identity_gen_test.go b/internal/service/xray/encryption_config_identity_gen_test.go index 79f909484866..2c0b2ad6fd4c 100644 --- a/internal/service/xray/encryption_config_identity_gen_test.go +++ b/internal/service/xray/encryption_config_identity_gen_test.go @@ -38,7 +38,7 @@ func testAccXRayEncryptionConfig_Identity_Basic(t *testing.T) { var v awstypes.EncryptionConfig resourceName := "aws_xray_encryption_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func testAccXRayEncryptionConfig_Identity_RegionOverride(t *testing.T) { resourceName := "aws_xray_encryption_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -223,7 +223,7 @@ func testAccXRayEncryptionConfig_Identity_ExistingResource(t *testing.T) { var v awstypes.EncryptionConfig resourceName := "aws_xray_encryption_config.test" - resource.Test(t, resource.TestCase{ + acctest.Test(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/xray/group_identity_gen_test.go b/internal/service/xray/group_identity_gen_test.go index 9d945654ab2e..78e717e930c3 100644 --- a/internal/service/xray/group_identity_gen_test.go +++ b/internal/service/xray/group_identity_gen_test.go @@ -27,7 +27,7 @@ func TestAccXRayGroup_Identity_Basic(t *testing.T) { resourceName := "aws_xray_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -112,7 +112,7 @@ func TestAccXRayGroup_Identity_RegionOverride(t *testing.T) { resourceName := "aws_xray_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, @@ -233,7 +233,7 @@ func TestAccXRayGroup_Identity_ExistingResource(t *testing.T) { resourceName := "aws_xray_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + acctest.ParallelTest(ctx, t, resource.TestCase{ TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.SkipBelow(tfversion.Version1_12_0), }, diff --git a/internal/service/xray/group_tags_gen_test.go b/internal/service/xray/group_tags_gen_test.go index ce6f0c86a289..0f83c3d5785a 100644 --- a/internal/service/xray/group_tags_gen_test.go +++ b/internal/service/xray/group_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccXRayGroup_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccXRayGroup_tags(t *testing.T) { func TestAccXRayGroup_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccXRayGroup_tags_null(t *testing.T) { func TestAccXRayGroup_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccXRayGroup_tags_EmptyMap(t *testing.T) { func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccXRayGroup_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. func TestAccXRayGroup_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccXRayGroup_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccXRayGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccXRayGroup_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccXRayGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccXRayGroup_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccXRayGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccXRayGroup_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccXRayGroup_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.Group resourceName := "aws_xray_group.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/xray/sampling_rule_tags_gen_test.go b/internal/service/xray/sampling_rule_tags_gen_test.go index 4774a07a7ece..beee9b442d84 100644 --- a/internal/service/xray/sampling_rule_tags_gen_test.go +++ b/internal/service/xray/sampling_rule_tags_gen_test.go @@ -18,6 +18,7 @@ import ( func TestAccXRaySamplingRule_tags(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -200,6 +201,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { func TestAccXRaySamplingRule_tags_null(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -267,6 +269,7 @@ func TestAccXRaySamplingRule_tags_null(t *testing.T) { func TestAccXRaySamplingRule_tags_EmptyMap(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -330,6 +333,7 @@ func TestAccXRaySamplingRule_tags_EmptyMap(t *testing.T) { func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -411,6 +415,7 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -500,6 +505,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -637,6 +643,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -726,6 +733,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -907,6 +915,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1067,6 +1076,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1243,6 +1253,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1333,6 +1344,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1422,6 +1434,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1487,6 +1500,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { func TestAccXRaySamplingRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1544,6 +1558,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyProviderOnlyTag(t *testing.T) func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1606,6 +1621,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1668,6 +1684,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t func TestAccXRaySamplingRule_tags_ComputedTag_OnCreate(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1723,6 +1740,7 @@ func TestAccXRaySamplingRule_tags_ComputedTag_OnCreate(t *testing.T) { func TestAccXRaySamplingRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1820,6 +1838,7 @@ func TestAccXRaySamplingRule_tags_ComputedTag_OnUpdate_Add(t *testing.T) { func TestAccXRaySamplingRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -1907,6 +1926,7 @@ func TestAccXRaySamplingRule_tags_ComputedTag_OnUpdate_Replace(t *testing.T) { func TestAccXRaySamplingRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) @@ -2069,6 +2089,7 @@ func TestAccXRaySamplingRule_tags_IgnoreTags_Overlap_DefaultTag(t *testing.T) { func TestAccXRaySamplingRule_tags_IgnoreTags_Overlap_ResourceTag(t *testing.T) { ctx := acctest.Context(t) + var v types.SamplingRule resourceName := "aws_xray_sampling_rule.test" rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) diff --git a/internal/service/xray/service_endpoint_resolver_gen.go b/internal/service/xray/service_endpoint_resolver_gen.go index 5af164b38b69..d4a8fa69db91 100644 --- a/internal/service/xray/service_endpoint_resolver_gen.go +++ b/internal/service/xray/service_endpoint_resolver_gen.go @@ -62,7 +62,7 @@ func (r resolverV2) ResolveEndpoint(ctx context.Context, params xray.EndpointPar }) params.UseFIPS = aws.Bool(false) } else { - err = fmt.Errorf("looking up xray endpoint %q: %s", hostname, err) + err = fmt.Errorf("looking up xray endpoint %q: %w", hostname, err) return } } else { diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index 59ba212a4d31..a2cb72fc6955 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -521,7 +521,7 @@ func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { ) } -var errCancelOperation = fmt.Errorf("Test: Canceling request") +var errCancelOperation = errors.New("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { return func(stack *middleware.Stack) error { diff --git a/internal/slices/iter.go b/internal/slices/iter.go new file mode 100644 index 000000000000..f0a987de277f --- /dev/null +++ b/internal/slices/iter.go @@ -0,0 +1,31 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package slices + +import ( + "iter" +) + +// AppliedToEach returns an iterator that yields the slice elements transformed by the function `f`. +func AppliedToEach[S ~[]E, E any, T any](s S, f func(E) T) iter.Seq[T] { + return func(yield func(T) bool) { + for _, v := range s { + if !yield(f(v)) { + return + } + } + } +} + +// BackwardValues returns an iterator that yields the slice elements in reverse order. +// It is a values-only equivalent of `slices.Backward`. +func BackwardValues[Slice ~[]E, E any](s Slice) iter.Seq[E] { + return func(yield func(E) bool) { + for i := len(s) - 1; i >= 0; i-- { + if !yield(s[i]) { + return + } + } + } +} diff --git a/internal/slices/iter_test.go b/internal/slices/iter_test.go new file mode 100644 index 000000000000..f8c5ea0263df --- /dev/null +++ b/internal/slices/iter_test.go @@ -0,0 +1,73 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package slices + +import ( + "slices" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestAppliedToEach(t *testing.T) { + t.Parallel() + + type testCase struct { + input []string + expected []string + } + tests := map[string]testCase{ + "three elements": { + input: []string{"one", "two", "3"}, + expected: []string{"ONE", "TWO", "3"}, + }, + "one element": { + input: []string{"abcdEFGH"}, + expected: []string{"ABCDEFGH"}, + }, + "zero elements": { + input: []string{}, + expected: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + iter := AppliedToEach(test.input, strings.ToUpper) + + got := slices.Collect(iter) + + if diff := cmp.Diff(got, test.expected); diff != "" { + t.Errorf("unexpected diff (+wanted, -got): %s", diff) + } + }) + } +} + +// Copied and adapted from stdlib slices package +func TestBackwardValues(t *testing.T) { + t.Parallel() + + for size := range 10 { + var s []int + for i := range size { + s = append(s, i) + } + ev := size - 1 + cnt := 0 + for v := range BackwardValues(s) { + if v != ev { + t.Errorf("at iteration %d got %d want %d", cnt, v, ev) + } + ev-- + cnt++ + } + if cnt != size { + t.Errorf("read %d values expected %d", cnt, size) + } + } +} diff --git a/internal/slices/slices.go b/internal/slices/slices.go index 17ee33458ee0..04e51a447128 100644 --- a/internal/slices/slices.go +++ b/internal/slices/slices.go @@ -4,7 +4,6 @@ package slices import ( - "iter" "slices" ) @@ -58,17 +57,6 @@ func ApplyToAllWithError[S ~[]E1, E1, E2 any](s S, f func(E1) (E2, error)) ([]E2 return v, nil } -// AppliedToEach returns an iterator that yields the slice elements transformed by the function `f`. -func AppliedToEach[S ~[]E, E any, T any](s S, f func(E) T) iter.Seq[T] { - return func(yield func(T) bool) { - for _, v := range s { - if !yield(f(v)) { - return - } - } - } -} - // Values returns a new slice containing values from the pointers in each element of the original slice `s`. func Values[S ~[]*E, E any](s S) []E { return ApplyToAll(s, func(e *E) E { @@ -81,6 +69,10 @@ type Predicate[T any] func(T) bool // Filter returns a new slice containing all values that return `true` for the filter function `f`. func Filter[S ~[]E, E any](s S, f Predicate[E]) S { + if len(s) == 0 { + return nil + } + v := S(make([]E, 0, len(s))) for _, e := range s { diff --git a/internal/slices/slices_test.go b/internal/slices/slices_test.go index 5983706b971f..c53a3fbc9d13 100644 --- a/internal/slices/slices_test.go +++ b/internal/slices/slices_test.go @@ -4,7 +4,6 @@ package slices import ( - "slices" "strings" "testing" @@ -154,43 +153,6 @@ func TestApplyToAll(t *testing.T) { } } -func TestAppliedToEach(t *testing.T) { - t.Parallel() - - type testCase struct { - input []string - expected []string - } - tests := map[string]testCase{ - "three elements": { - input: []string{"one", "two", "3"}, - expected: []string{"ONE", "TWO", "3"}, - }, - "one element": { - input: []string{"abcdEFGH"}, - expected: []string{"ABCDEFGH"}, - }, - "zero elements": { - input: []string{}, - expected: nil, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - t.Parallel() - - iter := AppliedToEach(test.input, strings.ToUpper) - - got := slices.Collect(iter) - - if diff := cmp.Diff(got, test.expected); diff != "" { - t.Errorf("unexpected diff (+wanted, -got): %s", diff) - } - }) - } -} - func TestFilter(t *testing.T) { t.Parallel() @@ -209,7 +171,7 @@ func TestFilter(t *testing.T) { }, "zero elements": { input: []string{}, - expected: []string{}, + expected: nil, }, } diff --git a/internal/sweep/awsv2/skip.go b/internal/sweep/awsv2/skip.go index 78024fb6fdad..c4fbcfa1a509 100644 --- a/internal/sweep/awsv2/skip.go +++ b/internal/sweep/awsv2/skip.go @@ -94,6 +94,10 @@ func SkipSweepError(err error) bool { if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "Access Denied to API Version") { return true } + // Example (GovCloud): InvalidParameterException: The DATA_PROTECTION_POLICY policy type is not supported in this region + if tfawserr.ErrMessageContains(err, "InvalidParameterException", "DATA_PROTECTION_POLICY policy type is not supported in this region") { + return true + } // Example (GovCloud): The AppStream 2.0 user pool feature is not supported in the us-gov-west-1 AWS Region if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "feature is not supported") { return true @@ -102,6 +106,10 @@ func SkipSweepError(err error) bool { if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "This API operation is currently unavailable") { return true } + // Example (GovCloud): InvalidSignatureException: Credential should be scoped to a valid region + if tfawserr.ErrMessageContains(err, "InvalidSignatureException", "Credential should be scoped to a valid region") { + return true + } // For example from us-west-2 Route53 zone if tfawserr.ErrMessageContains(err, "KeySigningKeyInParentDSRecord", "Due to DNS lookup failure") { return true @@ -114,6 +122,10 @@ func SkipSweepError(err error) bool { if tfawserr.ErrMessageContains(err, "ResourceNotFoundException", "The subscription does not exist") { return true } + // Example (GovCloud): SignatureDoesNotMatch: Credential should be scoped to a valid region + if tfawserr.ErrMessageContains(err, "SignatureDoesNotMatch", "Credential should be scoped to a valid region") { + return true + } // For example from us-gov-east-1 IoT domain configuration if tfawserr.ErrMessageContains(err, "UnauthorizedException", "API is not available in") { return true diff --git a/internal/sweep/service_packages_gen_test.go b/internal/sweep/service_packages_gen_test.go index a063d088e82d..95e985bfbe2a 100644 --- a/internal/sweep/service_packages_gen_test.go +++ b/internal/sweep/service_packages_gen_test.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/bcmdataexports" "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" + "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore" "github.com/hashicorp/terraform-provider-aws/internal/service/billing" "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" "github.com/hashicorp/terraform-provider-aws/internal/service/ce" @@ -175,6 +176,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" "github.com/hashicorp/terraform-provider-aws/internal/service/notificationscontacts" "github.com/hashicorp/terraform-provider-aws/internal/service/oam" + "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" @@ -214,6 +216,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" "github.com/hashicorp/terraform-provider-aws/internal/service/s3outposts" "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" + "github.com/hashicorp/terraform-provider-aws/internal/service/s3vectors" "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" "github.com/hashicorp/terraform-provider-aws/internal/service/scheduler" "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" @@ -290,6 +293,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { bcmdataexports.ServicePackage(ctx), bedrock.ServicePackage(ctx), bedrockagent.ServicePackage(ctx), + bedrockagentcore.ServicePackage(ctx), billing.ServicePackage(ctx), budgets.ServicePackage(ctx), ce.ServicePackage(ctx), @@ -430,6 +434,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { notifications.ServicePackage(ctx), notificationscontacts.ServicePackage(ctx), oam.ServicePackage(ctx), + odb.ServicePackage(ctx), opensearch.ServicePackage(ctx), opensearchserverless.ServicePackage(ctx), organizations.ServicePackage(ctx), @@ -469,6 +474,7 @@ func servicePackages(ctx context.Context) []conns.ServicePackage { s3control.ServicePackage(ctx), s3outposts.ServicePackage(ctx), s3tables.ServicePackage(ctx), + s3vectors.ServicePackage(ctx), sagemaker.ServicePackage(ctx), scheduler.ServicePackage(ctx), schemas.ServicePackage(ctx), diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 566b4ab6e82e..9c92be4db62d 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -15,8 +15,6 @@ import ( "github.com/hashicorp/go-cty/cty" fwdiag "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/path" - "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" @@ -887,13 +885,10 @@ func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *D } // ResolveDuplicatesFramework resolves differences between incoming tags, defaultTags, and ignoreConfig -func (tags KeyValueTags) ResolveDuplicatesFramework(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig *IgnoreConfig, resp *resource.ReadResponse, diags *fwdiag.Diagnostics) KeyValueTags { +func (tags KeyValueTags) ResolveDuplicatesFramework(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig *IgnoreConfig, tagsAll Map, diags *fwdiag.Diagnostics) KeyValueTags { // remove default config. t := tags.RemoveDefaultConfig(defaultConfig) - var tagsAll Map - diags.Append(resp.State.GetAttribute(ctx, path.Root("tags"), &tagsAll)...) - if diags.HasError() { return KeyValueTags{} } diff --git a/internal/tfresource/retry.go b/internal/tfresource/retry.go index f4e1fed806c8..fc564baad2b9 100644 --- a/internal/tfresource/retry.go +++ b/internal/tfresource/retry.go @@ -96,19 +96,8 @@ func RetryGWhen[T any](ctx context.Context, timeout time.Duration, f func() (T, } // RetryWhenAWSErrCodeEquals retries the specified function when it returns one of the specified AWS error codes. -func RetryWhenAWSErrCodeEquals(ctx context.Context, timeout time.Duration, f func() (any, error), codes ...string) (any, error) { // nosemgrep:ci.aws-in-func-name - return RetryWhen(ctx, timeout, f, func(err error) (bool, error) { - if tfawserr.ErrCodeEquals(err, codes...) { - return true, err - } - - return false, err - }) -} - -// RetryGWhenAWSErrCodeEquals retries the specified function when it returns one of the specified AWS error codes. -func RetryGWhenAWSErrCodeEquals[T any](ctx context.Context, timeout time.Duration, f func() (T, error), codes ...string) (T, error) { // nosemgrep:ci.aws-in-func-name - return RetryGWhen(ctx, timeout, f, func(err error) (bool, error) { +func RetryWhenAWSErrCodeEquals[T any](ctx context.Context, timeout time.Duration, f func(context.Context) (T, error), codes ...string) (T, error) { // nosemgrep:ci.aws-in-func-name + return retryWhen(ctx, timeout, f, func(err error) (bool, error) { if tfawserr.ErrCodeEquals(err, codes...) { return true, err } @@ -129,8 +118,8 @@ func RetryWhenAWSErrCodeContains[T any](ctx context.Context, timeout time.Durati } // RetryWhenAWSErrMessageContains retries the specified function when it returns an AWS error containing the specified message. -func RetryWhenAWSErrMessageContains(ctx context.Context, timeout time.Duration, f func() (any, error), code, message string) (any, error) { // nosemgrep:ci.aws-in-func-name - return RetryWhen(ctx, timeout, f, func(err error) (bool, error) { +func RetryWhenAWSErrMessageContains[T any](ctx context.Context, timeout time.Duration, f func(context.Context) (T, error), code, message string) (T, error) { // nosemgrep:ci.aws-in-func-name + return retryWhen(ctx, timeout, f, func(err error) (bool, error) { if tfawserr.ErrMessageContains(err, code, message) { return true, err } @@ -139,9 +128,9 @@ func RetryWhenAWSErrMessageContains(ctx context.Context, timeout time.Duration, }) } -func RetryWhenIsA[T error](ctx context.Context, timeout time.Duration, f func() (any, error)) (any, error) { - return RetryWhen(ctx, timeout, f, func(err error) (bool, error) { - if errs.IsA[T](err) { +func RetryWhenIsA[T any, E error](ctx context.Context, timeout time.Duration, f func(context.Context) (T, error)) (T, error) { + return retryWhen(ctx, timeout, f, func(err error) (bool, error) { + if errs.IsA[E](err) { return true, err } diff --git a/internal/tfresource/retry_test.go b/internal/tfresource/retry_test.go index 4c0dcbfc3714..ffb504050db6 100644 --- a/internal/tfresource/retry_test.go +++ b/internal/tfresource/retry_test.go @@ -22,18 +22,18 @@ func TestRetryWhenAWSErrCodeEquals(t *testing.T) { // nosemgrep:ci.aws-in-func-n ctx := t.Context() testCases := []struct { Name string - F func() (any, error) + F func(context.Context) (any, error) ExpectError bool }{ { Name: "no error", - F: func() (any, error) { + F: func(context.Context) (any, error) { return nil, nil }, }, { Name: "non-retryable other error", - F: func() (any, error) { + F: func(context.Context) (any, error) { return nil, errors.New("TestCode") }, ExpectError: true, @@ -60,18 +60,18 @@ func TestRetryWhenAWSErrMessageContains(t *testing.T) { // nosemgrep:ci.aws-in-f ctx := t.Context() testCases := []struct { Name string - F func() (any, error) + F func(context.Context) (any, error) ExpectError bool }{ { Name: "no error", - F: func() (any, error) { + F: func(context.Context) (any, error) { return nil, nil }, }, { Name: "non-retryable other error", - F: func() (any, error) { + F: func(context.Context) (any, error) { return nil, errors.New("TestCode") }, ExpectError: true, diff --git a/mkdocs.yml b/mkdocs.yml index c47b638bab0e..3cde35fc4e52 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,6 +32,11 @@ nav: - How We Prioritize: prioritization.md - Developer Reference: - Acceptance Test Environment Variables: acc-test-environment-variables.md + - AI Agents: ai-agents.md + - AI Agent Guides: + - ARN-Based Resource Identity: ai-agent-guides/arn-based-resource-identity.md + - Parameterized Resource Identity: ai-agent-guides/parameterized-resource-identity.md + - Smarterr: ai-agent-guides/smarterr.md - AWS SDK Go Base: aws-sdk-go-base.md - Core Services: core-services.md - Data Handling and Conversion: data-handling-and-conversion.md diff --git a/names/consts_gen.go b/names/consts_gen.go index aa6170eb2602..bdb4e6242568 100644 --- a/names/consts_gen.go +++ b/names/consts_gen.go @@ -30,6 +30,7 @@ const ( Batch = "batch" Bedrock = "bedrock" BedrockAgent = "bedrockagent" + BedrockAgentCore = "bedrockagentcore" Billing = "billing" Budgets = "budgets" CE = "ce" @@ -168,6 +169,7 @@ const ( NetworkMonitor = "networkmonitor" Notifications = "notifications" NotificationsContacts = "notificationscontacts" + ODB = "odb" ObservabilityAccessManager = "oam" OpenSearch = "opensearch" OpenSearchIngestion = "osis" @@ -208,6 +210,7 @@ const ( S3Control = "s3control" S3Outposts = "s3outposts" S3Tables = "s3tables" + S3Vectors = "s3vectors" SES = "ses" SESV2 = "sesv2" SFN = "sfn" @@ -285,6 +288,7 @@ const ( BatchServiceID = "Batch" BedrockServiceID = "Bedrock" BedrockAgentServiceID = "Bedrock Agent" + BedrockAgentCoreServiceID = "Bedrock AgentCore Control" BillingServiceID = "Billing" BudgetsServiceID = "Budgets" CEServiceID = "Cost Explorer" @@ -423,6 +427,7 @@ const ( NetworkMonitorServiceID = "NetworkMonitor" NotificationsServiceID = "notifications" NotificationsContactsServiceID = "notificationscontacts" + ODBServiceID = "ODB" ObservabilityAccessManagerServiceID = "OAM" OpenSearchServiceID = "OpenSearch" OpenSearchIngestionServiceID = "OSIS" @@ -463,6 +468,7 @@ const ( S3ControlServiceID = "S3 Control" S3OutpostsServiceID = "S3Outposts" S3TablesServiceID = "S3Tables" + S3VectorsServiceID = "S3Vectors" SESServiceID = "SES" SESV2ServiceID = "SESv2" SFNServiceID = "SFN" diff --git a/names/data/names_data.hcl b/names/data/names_data.hcl index 6a83a3386cfa..da2600fbf852 100644 --- a/names/data/names_data.hcl +++ b/names/data/names_data.hcl @@ -875,6 +875,39 @@ service "bedrockagent" { brand = "Amazon" } +service "bedrockagentcore" { + cli_v2_command { + aws_cli_v2_command = "bedrock-agentcore-control" + aws_cli_v2_command_no_dashes = "bedrockagentcorecontrol" + } + + go_packages { + v2_package = "bedrockagentcorecontrol" + } + + sdk { + id = "Bedrock AgentCore Control" + arn_namespace = "bedrock-agentcore" + } + + names { + provider_name_upper = "BedrockAgentCore" + human_friendly = "Bedrock AgentCore" + } + + endpoint_info { + endpoint_api_call = "ListAgentRuntimes" + } + + resource_prefix { + correct = "aws_bedrockagentcore_" + } + + provider_package_correct = "bedrockagentcore" + doc_prefix = ["bedrockagentcore_"] + brand = "Amazon" +} + service "bcmdataexports" { sdk { id = "BCM Data Exports" @@ -5997,6 +6030,29 @@ service "oam" { brand = "AWS" } +service "odb" { + sdk { + id = "ODB" + arn_namespace = "odb" + } + + names { + provider_name_upper = "ODB" + human_friendly = "Oracle Database@AWS" + } + + endpoint_info { + endpoint_api_call = "ListCloudExadataInfrastructures" + } + + resource_prefix { + correct = "aws_odb_" + } + + doc_prefix = ["odb_"] + brand = "AWS" +} + service "opensearch" { go_packages { v1_package = "opensearchservice" @@ -7341,6 +7397,29 @@ service "s3tables" { brand = "Amazon" } +service "s3vectors" { + sdk { + id = "S3Vectors" + arn_namespace = "s3vectors" + } + + names { + provider_name_upper = "S3Vectors" + human_friendly = "S3 Vectors" + } + + endpoint_info { + endpoint_api_call = "ListVectorBuckets" + } + + resource_prefix { + correct = "aws_s3vectors_" + } + + doc_prefix = ["s3vectors_"] + brand = "Amazon" +} + service "glacier" { sdk { id = "Glacier" diff --git a/skaff/datasource/datasource.gtpl b/skaff/datasource/datasource.gtpl index 18f53ea79505..f8521721d68e 100644 --- a/skaff/datasource/datasource.gtpl +++ b/skaff/datasource/datasource.gtpl @@ -112,7 +112,7 @@ func DataSource{{ .DataSource }}() *schema.Resource { // https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema#Schema {{- end }} Schema: map[string]*schema.Schema{ - "arn": { {{- if .IncludeComments }} // TIP: Many, but not all, data sources have an `arn` attribute.{{- end }} + names.AttrARN: { {{- if .IncludeComments }} // TIP: Many, but not all, data sources have an `arn` attribute.{{- end }} Type: schema.TypeString, Computed: true, }, @@ -139,7 +139,7 @@ func DataSource{{ .DataSource }}() *schema.Resource { }, }, {{- if .IncludeTags }} - "tags": tftags.TagsSchemaComputed(), {{- if .IncludeComments }} // TIP: Many, but not all, data sources have `tags` attributes.{{- end }} + names.AttrTags: tftags.TagsSchemaComputed(), {{- if .IncludeComments }} // TIP: Many, but not all, data sources have `tags` attributes.{{- end }} {{- end }} }, } @@ -175,7 +175,7 @@ func dataSource{{ .DataSource }}Read(ctx context.Context, d *schema.ResourceData // elements. However, a data source will have perhaps one or a few arguments // that are key to finding the relevant information, such as 'name' below. {{- end }} - name := d.Get("name").(string) + name := d.Get(names.AttrName).(string) out, err := find{{ .DataSource }}ByName(ctx, conn, name) if err != nil { @@ -198,7 +198,7 @@ func dataSource{{ .DataSource }}Read(ctx context.Context, d *schema.ResourceData // // For simple data types (i.e., schema.TypeString, schema.TypeBool, // schema.TypeInt, and schema.TypeFloat), a simple Set call (e.g., - // d.Set("arn", out.Arn) is sufficient. No error or nil checking is + // d.Set(names.AttrARN, out.Arn) is sufficient. No error or nil checking is // necessary. // // However, there are some situations where more handling is needed. @@ -208,8 +208,8 @@ func dataSource{{ .DataSource }}Read(ctx context.Context, d *schema.ResourceData // is equivalent to what is already set. In that case, you may check if // it is equivalent before setting the different JSON. {{- end }} - d.Set("arn", out.ARN) - d.Set("name", out.Name) + d.Set(names.AttrARN, out.ARN) + d.Set(names.AttrName, out.Name) {{ if .IncludeComments }} // TIP: Setting a complex type. // For more information, see: @@ -246,7 +246,7 @@ func dataSource{{ .DataSource }}Read(ctx context.Context, d *schema.ResourceData {{- if .IncludeTags }} ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig(ctx) - if err := d.Set("tags", KeyValueTags(out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + if err := d.Set(names.AttrTags, KeyValueTags(out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { smerr.Append(ctx, diags, err, smerr.ID, d.Id()) return diags } diff --git a/skaff/go.mod b/skaff/go.mod index f236a57f2a3a..d23e7f351766 100644 --- a/skaff/go.mod +++ b/skaff/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-provider-aws/skaff -go 1.24.5 +go 1.24.6 require ( github.com/YakDriver/regexache v0.24.0 @@ -19,10 +19,10 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/zclconf/go-cty v1.16.3 // indirect - golang.org/x/mod v0.26.0 // indirect + golang.org/x/mod v0.27.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/text v0.27.0 // indirect - golang.org/x/tools v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect + golang.org/x/tools v0.36.0 // indirect ) replace github.com/hashicorp/terraform-provider-aws => ../ diff --git a/skaff/go.sum b/skaff/go.sum index 655851720f38..60e3c5c8266f 100644 --- a/skaff/go.sum +++ b/skaff/go.sum @@ -30,13 +30,13 @@ github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/skaff/resource/resource.gtpl b/skaff/resource/resource.gtpl index 29c939b6a0a0..607ec583428b 100644 --- a/skaff/resource/resource.gtpl +++ b/skaff/resource/resource.gtpl @@ -165,7 +165,7 @@ func Resource{{ .Resource }}() *schema.Resource { // https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema#Schema {{- end }} Schema: map[string]*schema.Schema{ - "arn": { {{- if .IncludeComments }} // TIP: Many, but not all, resources have an `arn` attribute.{{- end }} + names.AttrARN: { {{- if .IncludeComments }} // TIP: Many, but not all, resources have an `arn` attribute.{{- end }} Type: schema.TypeString, Computed: true, }, @@ -232,8 +232,8 @@ func resource{{ .Resource }}Create(ctx context.Context, d *schema.ResourceData, // TIP: Mandatory or fields that will always be present can be set when // you create the Input structure. (Replace these with real fields.) {{- end }} - {{ .Resource }}Name: aws.String(d.Get("name").(string)), - {{ .Resource }}Type: aws.String(d.Get("type").(string)), + {{ .Resource }}Name: aws.String(d.Get(names.AttrName).(string)), + {{ .Resource }}Type: aws.String(d.Get(names.AttrType).(string)), {{ if .IncludeComments }} // TIP: Not all resources support tags and tags don't always make sense. If // your resource doesn't need tags, you can remove the tags lines here and @@ -269,11 +269,11 @@ func resource{{ .Resource }}Create(ctx context.Context, d *schema.ResourceData, // TIP: Since d.SetId() has not been called yet, you cannot use d.Id() // in error messages at this point. {{- end }} - return smerr.Append(ctx, diags, err, smerr.ID, d.Get("name").(string)) + return smerr.Append(ctx, diags, err, smerr.ID, d.Get(names.AttrName).(string)) } if out == nil || out.{{ .Resource }} == nil { - return smerr.Append(ctx, diags, errors.New("empty output"), smerr.ID, d.Get("name").(string)) + return smerr.Append(ctx, diags, errors.New("empty output"), smerr.ID, d.Get(names.AttrName).(string)) } {{ if .IncludeComments }} // TIP: -- 4. Set the minimum arguments and/or attributes for the Read function to @@ -333,7 +333,7 @@ func resource{{ .Resource }}Read(ctx context.Context, d *schema.ResourceData, me // // For simple data types (i.e., schema.TypeString, schema.TypeBool, // schema.TypeInt, and schema.TypeFloat), a simple Set call (e.g., - // d.Set("arn", out.Arn) is sufficient. No error or nil checking is + // d.Set(names.AttrARN, out.Arn) is sufficient. No error or nil checking is // necessary. // // However, there are some situations where more handling is needed. @@ -343,8 +343,8 @@ func resource{{ .Resource }}Read(ctx context.Context, d *schema.ResourceData, me // is equivalent to what is already set. In that case, you may check if // it is equivalent before setting the different JSON. {{- end }} - d.Set("arn", out.Arn) - d.Set("name", out.Name) + d.Set(names.AttrARN, out.Arn) + d.Set(names.AttrName, out.Name) {{ if .IncludeComments }} // TIP: Setting a complex type. // For more information, see: diff --git a/skaff/resource/resourcefw.gtpl b/skaff/resource/resourcefw.gtpl index 84acda2daa4f..a2f534395ac3 100644 --- a/skaff/resource/resourcefw.gtpl +++ b/skaff/resource/resourcefw.gtpl @@ -359,7 +359,7 @@ func (r *resource{{ .Resource }}) Read(ctx context.Context, req resource.ReadReq // TIP: -- 4. Remove resource from state if it is not found {{- end }} if tfresource.NotFound(err) { - smerr.append(ctx, &resp.Diagnostics, fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return } diff --git a/tools/literally/go.mod b/tools/literally/go.mod index 162cb77bfc69..579cff1f29e1 100644 --- a/tools/literally/go.mod +++ b/tools/literally/go.mod @@ -1,3 +1,3 @@ module github.com/hashicorp/terraform-provider-aws/tools/literally -go 1.24.5 +go 1.24.6 diff --git a/tools/tfsdk2fw/go.mod b/tools/tfsdk2fw/go.mod index 8f04ce38f793..7ac0c0862dc7 100644 --- a/tools/tfsdk2fw/go.mod +++ b/tools/tfsdk2fw/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-provider-aws/tools/tfsdk2fw -go 1.24.5 +go 1.24.6 require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 @@ -18,276 +18,279 @@ require ( github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.37.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.38.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.30.2 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.18.2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1 // indirect + github.com/aws/aws-sdk-go-v2/config v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.18.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.3 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.3 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1 // indirect - github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.41.1 // indirect - github.com/aws/aws-sdk-go-v2/service/account v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/acm v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/acmpca v1.41.1 // indirect - github.com/aws/aws-sdk-go-v2/service/amp v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/amplify v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/apigateway v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appconfig v1.39.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appfabric v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appflow v1.47.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appintegrations v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appmesh v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/apprunner v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appstream v1.46.1 // indirect - github.com/aws/aws-sdk-go-v2/service/appsync v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/athena v1.52.1 // indirect - github.com/aws/aws-sdk-go-v2/service/auditmanager v1.41.1 // indirect - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.55.1 // indirect - github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.26.1 // indirect - github.com/aws/aws-sdk-go-v2/service/backup v1.44.1 // indirect - github.com/aws/aws-sdk-go-v2/service/batch v1.55.1 // indirect - github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.9.1 // indirect - github.com/aws/aws-sdk-go-v2/service/bedrock v1.40.1 // indirect - github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.46.1 // indirect - github.com/aws/aws-sdk-go-v2/service/billing v1.3.1 // indirect - github.com/aws/aws-sdk-go-v2/service/budgets v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/chatbot v1.11.1 // indirect - github.com/aws/aws-sdk-go-v2/service/chime v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloud9 v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudformation v1.62.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.49.0 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.50.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.46.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.54.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codeartifact v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codebuild v1.62.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codecommit v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codeconnections v1.7.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codedeploy v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.26.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codepipeline v1.43.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.54.1 // indirect - github.com/aws/aws-sdk-go-v2/service/comprehend v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.44.1 // indirect - github.com/aws/aws-sdk-go-v2/service/configservice v1.54.1 // indirect - github.com/aws/aws-sdk-go-v2/service/connect v1.132.1 // indirect - github.com/aws/aws-sdk-go-v2/service/connectcases v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/controltower v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/costexplorer v1.52.1 // indirect - github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.17.1 // indirect - github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.54.1 // indirect - github.com/aws/aws-sdk-go-v2/service/databrew v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dataexchange v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/datapipeline v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/datasync v1.51.1 // indirect - github.com/aws/aws-sdk-go-v2/service/datazone v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dax v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/detective v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/devicefarm v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/devopsguru v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/directconnect v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/directoryservice v1.33.0 // indirect - github.com/aws/aws-sdk-go-v2/service/dlm v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/docdb v1.43.0 // indirect - github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.16.1 // indirect - github.com/aws/aws-sdk-go-v2/service/drs v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dsql v1.6.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.45.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ec2 v1.238.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ecr v1.47.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ecs v1.61.1 // indirect - github.com/aws/aws-sdk-go-v2/service/efs v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/eks v1.67.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elasticache v1.47.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.47.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/emr v1.51.1 // indirect - github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/emrserverless v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/eventbridge v1.42.1 // indirect - github.com/aws/aws-sdk-go-v2/service/evidently v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/evs v1.1.1 // indirect - github.com/aws/aws-sdk-go-v2/service/finspace v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/firehose v1.38.1 // indirect - github.com/aws/aws-sdk-go-v2/service/fis v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/fms v1.41.1 // indirect - github.com/aws/aws-sdk-go-v2/service/fsx v1.56.1 // indirect - github.com/aws/aws-sdk-go-v2/service/gamelift v1.43.1 // indirect - github.com/aws/aws-sdk-go-v2/service/glacier v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/glue v1.120.1 // indirect - github.com/aws/aws-sdk-go-v2/service/grafana v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/greengrass v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/groundstation v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/guardduty v1.58.1 // indirect - github.com/aws/aws-sdk-go-v2/service/healthlake v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/iam v1.44.1 // indirect - github.com/aws/aws-sdk-go-v2/service/identitystore v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.43.1 // indirect - github.com/aws/aws-sdk-go-v2/service/inspector v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/inspector2 v1.39.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.3 // indirect + github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/account v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/acm v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/acmpca v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/amp v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/amplify v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/apigateway v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appconfig v1.41.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appfabric v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appflow v1.49.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appintegrations v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appmesh v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/apprunner v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appstream v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/appsync v1.50.0 // indirect + github.com/aws/aws-sdk-go-v2/service/athena v1.54.0 // indirect + github.com/aws/aws-sdk-go-v2/service/auditmanager v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.57.0 // indirect + github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.28.0 // indirect + github.com/aws/aws-sdk-go-v2/service/backup v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2/service/batch v1.57.0 // indirect + github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/bedrock v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol v1.3.0 // indirect + github.com/aws/aws-sdk-go-v2/service/billing v1.6.0 // indirect + github.com/aws/aws-sdk-go-v2/service/budgets v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/chatbot v1.13.0 // indirect + github.com/aws/aws-sdk-go-v2/service/chime v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloud9 v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudformation v1.64.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.52.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.52.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.56.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codeartifact v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codebuild v1.66.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codecommit v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codeconnections v1.9.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codedeploy v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.28.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codepipeline v1.45.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.56.0 // indirect + github.com/aws/aws-sdk-go-v2/service/comprehend v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2/service/configservice v1.56.0 // indirect + github.com/aws/aws-sdk-go-v2/service/connect v1.135.0 // indirect + github.com/aws/aws-sdk-go-v2/service/connectcases v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/controltower v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/costexplorer v1.54.0 // indirect + github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.51.0 // indirect + github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.56.0 // indirect + github.com/aws/aws-sdk-go-v2/service/databrew v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dataexchange v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/datapipeline v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/datasync v1.53.0 // indirect + github.com/aws/aws-sdk-go-v2/service/datazone v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dax v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/detective v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/devicefarm v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/devopsguru v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/directconnect v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/directoryservice v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dlm v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/docdb v1.45.0 // indirect + github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.18.0 // indirect + github.com/aws/aws-sdk-go-v2/service/drs v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dsql v1.9.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.244.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ecr v1.49.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ecs v1.63.0 // indirect + github.com/aws/aws-sdk-go-v2/service/efs v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/eks v1.70.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticache v1.49.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.49.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/emr v1.53.0 // indirect + github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/emrserverless v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/eventbridge v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/evidently v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/evs v1.3.0 // indirect + github.com/aws/aws-sdk-go-v2/service/finspace v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/firehose v1.40.0 // indirect + github.com/aws/aws-sdk-go-v2/service/fis v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/fms v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/fsx v1.60.0 // indirect + github.com/aws/aws-sdk-go-v2/service/gamelift v1.45.0 // indirect + github.com/aws/aws-sdk-go-v2/service/glacier v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/glue v1.125.0 // indirect + github.com/aws/aws-sdk-go-v2/service/grafana v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/greengrass v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/groundstation v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/guardduty v1.62.0 // indirect + github.com/aws/aws-sdk-go-v2/service/healthlake v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/iam v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2/service/identitystore v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.45.0 // indirect + github.com/aws/aws-sdk-go-v2/service/inspector v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/inspector2 v1.43.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.22.1 // indirect - github.com/aws/aws-sdk-go-v2/service/invoicing v1.3.1 // indirect - github.com/aws/aws-sdk-go-v2/service/iot v1.65.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ivs v1.44.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ivschat v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kafka v1.40.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.24.2 // indirect - github.com/aws/aws-sdk-go-v2/service/kendra v1.57.1 // indirect - github.com/aws/aws-sdk-go-v2/service/keyspaces v1.20.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesis v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/kms v1.42.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lakeformation v1.42.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lambda v1.74.1 // indirect - github.com/aws/aws-sdk-go-v2/service/launchwizard v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.53.1 // indirect - github.com/aws/aws-sdk-go-v2/service/licensemanager v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lightsail v1.44.1 // indirect - github.com/aws/aws-sdk-go-v2/service/location v1.46.1 // indirect - github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.33.1 // indirect - github.com/aws/aws-sdk-go-v2/service/m2 v1.22.1 // indirect - github.com/aws/aws-sdk-go-v2/service/macie2 v1.46.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.41.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.78.1 // indirect - github.com/aws/aws-sdk-go-v2/service/medialive v1.77.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediapackage v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mediastore v1.26.1 // indirect - github.com/aws/aws-sdk-go-v2/service/memorydb v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mgn v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mq v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/mwaa v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/neptune v1.38.1 // indirect - github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.52.1 // indirect - github.com/aws/aws-sdk-go-v2/service/networkmanager v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.9.1 // indirect - github.com/aws/aws-sdk-go-v2/service/notifications v1.3.1 // indirect - github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2/service/oam v1.19.1 // indirect - github.com/aws/aws-sdk-go-v2/service/opensearch v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.21.1 // indirect - github.com/aws/aws-sdk-go-v2/service/organizations v1.40.1 // indirect - github.com/aws/aws-sdk-go-v2/service/osis v1.16.1 // indirect - github.com/aws/aws-sdk-go-v2/service/outposts v1.53.1 // indirect - github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.20.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pcs v1.7.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pinpoint v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.21.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pipes v1.20.1 // indirect - github.com/aws/aws-sdk-go-v2/service/polly v1.49.1 // indirect - github.com/aws/aws-sdk-go-v2/service/pricing v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/qbusiness v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/qldb v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/quicksight v1.89.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ram v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/rbin v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/rds v1.100.1 // indirect - github.com/aws/aws-sdk-go-v2/service/redshift v1.55.1 // indirect - github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.34.1 // indirect - github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/rekognition v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.18.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53 v1.54.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53domains v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53profiles v1.6.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/route53resolver v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/rum v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1 // indirect - github.com/aws/aws-sdk-go-v2/service/s3control v1.61.1 // indirect - github.com/aws/aws-sdk-go-v2/service/s3outposts v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/s3tables v1.7.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sagemaker v1.203.1 // indirect - github.com/aws/aws-sdk-go-v2/service/scheduler v1.14.1 // indirect - github.com/aws/aws-sdk-go-v2/service/schemas v1.30.1 // indirect - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/securityhub v1.59.1 // indirect - github.com/aws/aws-sdk-go-v2/service/securitylake v1.21.1 // indirect - github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.26.1 // indirect - github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/servicequotas v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ses v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sesv2 v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sfn v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/shield v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/signer v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sns v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sqs v1.39.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssm v1.61.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.5.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmsap v1.21.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.26.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.31.1 // indirect - github.com/aws/aws-sdk-go-v2/service/storagegateway v1.39.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/swf v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/synthetics v1.37.1 // indirect - github.com/aws/aws-sdk-go-v2/service/taxsettings v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/transcribe v1.48.1 // indirect - github.com/aws/aws-sdk-go-v2/service/transfer v1.62.1 // indirect - github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.25.1 // indirect - github.com/aws/aws-sdk-go-v2/service/vpclattice v1.15.1 // indirect - github.com/aws/aws-sdk-go-v2/service/waf v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/wafregional v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/wafv2 v1.64.1 // indirect - github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.36.1 // indirect - github.com/aws/aws-sdk-go-v2/service/workspaces v1.59.1 // indirect - github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.28.1 // indirect - github.com/aws/aws-sdk-go-v2/service/xray v1.32.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.24.0 // indirect + github.com/aws/aws-sdk-go-v2/service/invoicing v1.6.0 // indirect + github.com/aws/aws-sdk-go-v2/service/iot v1.68.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ivs v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ivschat v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kafka v1.42.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.26.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kendra v1.59.0 // indirect + github.com/aws/aws-sdk-go-v2/service/keyspaces v1.22.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesis v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lakeformation v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lambda v1.76.0 // indirect + github.com/aws/aws-sdk-go-v2/service/launchwizard v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.55.0 // indirect + github.com/aws/aws-sdk-go-v2/service/licensemanager v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lightsail v1.47.0 // indirect + github.com/aws/aws-sdk-go-v2/service/location v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.35.0 // indirect + github.com/aws/aws-sdk-go-v2/service/m2 v1.24.0 // indirect + github.com/aws/aws-sdk-go-v2/service/macie2 v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.80.0 // indirect + github.com/aws/aws-sdk-go-v2/service/medialive v1.80.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediapackage v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mediastore v1.28.0 // indirect + github.com/aws/aws-sdk-go-v2/service/memorydb v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mgn v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mq v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/mwaa v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/neptune v1.40.0 // indirect + github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.54.0 // indirect + github.com/aws/aws-sdk-go-v2/service/networkmanager v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/notifications v1.6.0 // indirect + github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/service/oam v1.21.0 // indirect + github.com/aws/aws-sdk-go-v2/service/odb v1.3.0 // indirect + github.com/aws/aws-sdk-go-v2/service/opensearch v1.51.0 // indirect + github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.24.0 // indirect + github.com/aws/aws-sdk-go-v2/service/organizations v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/osis v1.18.0 // indirect + github.com/aws/aws-sdk-go-v2/service/outposts v1.55.0 // indirect + github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.22.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.14.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pcs v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pinpoint v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.23.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pipes v1.22.0 // indirect + github.com/aws/aws-sdk-go-v2/service/polly v1.51.0 // indirect + github.com/aws/aws-sdk-go-v2/service/pricing v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/qbusiness v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/qldb v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/quicksight v1.92.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ram v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/rbin v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/rds v1.103.0 // indirect + github.com/aws/aws-sdk-go-v2/service/redshift v1.57.0 // indirect + github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.36.0 // indirect + github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/rekognition v1.50.0 // indirect + github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53 v1.56.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53domains v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53profiles v1.8.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/route53resolver v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/rum v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.87.0 // indirect + github.com/aws/aws-sdk-go-v2/service/s3control v1.64.0 // indirect + github.com/aws/aws-sdk-go-v2/service/s3outposts v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/s3tables v1.9.0 // indirect + github.com/aws/aws-sdk-go-v2/service/s3vectors v1.4.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sagemaker v1.209.0 // indirect + github.com/aws/aws-sdk-go-v2/service/scheduler v1.16.0 // indirect + github.com/aws/aws-sdk-go-v2/service/schemas v1.32.0 // indirect + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/securityhub v1.62.0 // indirect + github.com/aws/aws-sdk-go-v2/service/securitylake v1.23.0 // indirect + github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.28.0 // indirect + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/servicequotas v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ses v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sesv2 v1.51.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sfn v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/shield v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/signer v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sns v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sqs v1.41.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssm v1.63.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.7.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmsap v1.23.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.28.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/storagegateway v1.41.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/swf v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/synthetics v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/taxsettings v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.14.0 // indirect + github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/transcribe v1.51.0 // indirect + github.com/aws/aws-sdk-go-v2/service/transfer v1.64.0 // indirect + github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/vpclattice v1.17.0 // indirect + github.com/aws/aws-sdk-go-v2/service/waf v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/wafregional v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/service/wafv2 v1.66.0 // indirect + github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/workspaces v1.62.0 // indirect + github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/xray v1.34.0 // indirect github.com/aws/smithy-go v1.22.5 // indirect github.com/beevik/etree v1.5.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/cedar-policy/cedar-go v0.1.0 // indirect + github.com/cedar-policy/cedar-go v1.2.6 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.18.0 // indirect @@ -315,8 +318,8 @@ require ( github.com/hashicorp/hcl/v2 v2.23.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.23.0 // indirect - github.com/hashicorp/terraform-json v0.25.0 // indirect - github.com/hashicorp/terraform-plugin-framework v1.15.0 // indirect + github.com/hashicorp/terraform-json v0.26.0 // indirect + github.com/hashicorp/terraform-plugin-framework v1.15.1 // indirect github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0 // indirect github.com/hashicorp/terraform-plugin-framework-timeouts v0.5.0 // indirect github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0 // indirect @@ -356,13 +359,14 @@ require ( go.opentelemetry.io/otel v1.36.0 // indirect go.opentelemetry.io/otel/metric v1.36.0 // indirect go.opentelemetry.io/otel/trace v1.36.0 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/mod v0.26.0 // indirect - golang.org/x/net v0.42.0 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/net v0.43.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect - golang.org/x/tools v0.35.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect + golang.org/x/tools v0.36.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect google.golang.org/grpc v1.72.1 // indirect diff --git a/tools/tfsdk2fw/go.sum b/tools/tfsdk2fw/go.sum index 8f91e7da0a08..7841f0f595a3 100644 --- a/tools/tfsdk2fw/go.sum +++ b/tools/tfsdk2fw/go.sum @@ -23,538 +23,544 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go-v2 v1.37.1 h1:SMUxeNz3Z6nqGsXv0JuJXc8w5YMtrQMuIBmDx//bBDY= -github.com/aws/aws-sdk-go-v2 v1.37.1/go.mod h1:9Q0OoGQoboYIAJyslFyF1f5K1Ryddop8gqMhWx/n4Wg= +github.com/aws/aws-sdk-go-v2 v1.38.0 h1:UCRQ5mlqcFk9HJDIqENSLR3wiG1VTWlyUfLDEvY7RxU= +github.com/aws/aws-sdk-go-v2 v1.38.0/go.mod h1:9Q0OoGQoboYIAJyslFyF1f5K1Ryddop8gqMhWx/n4Wg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 h1:6GMWV6CNpA/6fbFHnoAjrv4+LGfyTqZz2LtCHnspgDg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0/go.mod h1:/mXlTIVG9jbxkqDnr5UQNQxW1HRYxeGklkM9vAFeabg= -github.com/aws/aws-sdk-go-v2/config v1.30.2 h1:YE1BmSc4fFYqFgN1mN8uzrtc7R9x+7oSWeX8ckoltAw= -github.com/aws/aws-sdk-go-v2/config v1.30.2/go.mod h1:UNrLGZ6jfAVjgVJpkIxjLufRJqTXCVYOpkeVf83kwBo= -github.com/aws/aws-sdk-go-v2/credentials v1.18.2 h1:mfm0GKY/PHLhs7KO0sUaOtFnIQ15Qqxt+wXbO/5fIfs= -github.com/aws/aws-sdk-go-v2/credentials v1.18.2/go.mod h1:v0SdJX6ayPeZFQxgXUKw5RhLpAoZUuynxWDfh8+Eknc= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1 h1:owmNBboeA0kHKDcdF8KiSXmrIuXZustfMGGytv6OMkM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1/go.mod h1:Bg1miN59SGxrZqlP8vJZSmXW+1N8Y1MjQDq1OfuNod8= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.2 h1:YFX4DvH1CPQXgQR8935b46Om+L7+6jus4aTdKqyDR84= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.2/go.mod h1:DgMPy7GqxcV0RSyaITnI3rw8HC3lIHB87U3KPQKDxHg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1 h1:ksZXBYv80EFTcgc8OJO48aQ8XDWXIQL7gGasPeCoTzI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1/go.mod h1:HSksQyyJETVZS7uM54cir0IgxttTD+8aEoJMPGepHBI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1 h1:+dn/xF/05utS7tUhjIcndbuaPjfll2LhbH1cCDGLYUQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1/go.mod h1:hyAGz30LHdm5KBZDI58MXx5lDVZ5CUfvfTZvMu4HCZo= +github.com/aws/aws-sdk-go-v2/config v1.31.0 h1:9yH0xiY5fUnVNLRWO0AtayqwU1ndriZdN78LlhruJR4= +github.com/aws/aws-sdk-go-v2/config v1.31.0/go.mod h1:VeV3K72nXnhbe4EuxxhzsDc/ByrCSlZwUnWH52Nde/I= +github.com/aws/aws-sdk-go-v2/credentials v1.18.4 h1:IPd0Algf1b+Qy9BcDp0sCUcIWdCQPSzDoMK3a8pcbUM= +github.com/aws/aws-sdk-go-v2/credentials v1.18.4/go.mod h1:nwg78FjH2qvsRM1EVZlX9WuGUJOL5od+0qvm0adEzHk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.3 h1:GicIdnekoJsjq9wqnvyi2elW6CGMSYKhdozE7/Svh78= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.3/go.mod h1:R7BIi6WNC5mc1kfRM7XM/VHC3uRWkjc396sfabq4iOo= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.4 h1:0SzCLoPRSK3qSydsaFQWugP+lOBCTPwfcBOm6222+UA= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.4/go.mod h1:JAet9FsBHjfdI+TnMBX4ModNNaQHAd3dc/Bk+cNsxeM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.3 h1:o9RnO+YZ4X+kt5Z7Nvcishlz0nksIt2PIzDglLMP0vA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.3/go.mod h1:+6aLJzOG1fvMOyzIySYjOFjcguGvVRL68R+uoRencN4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.3 h1:joyyUFhiTQQmVK6ImzNU9TQSNRNeD9kOklqTzyk5v6s= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.3/go.mod h1:+vNIyZQP3b3B1tSLI0lxvrU9cfM7gpdRXMFfm67ZcPc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1 h1:4HbnOGE9491a9zYJ9VpPh1ApgEq6ZlD4Kuv1PJenFpc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1/go.mod h1:Z6QnHC6TmpJWUxAy8FI4JzA7rTwl6EIANkyK9OR5z5w= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.41.1 h1:sHIsHhoZZSZkInpvgMzfvUVkf/yeiRam8DNu9090gEE= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.41.1/go.mod h1:8P/8gmNo2309Bc0hyBS2EX0M3MRzhzbiRSXGp1MfcIE= -github.com/aws/aws-sdk-go-v2/service/account v1.25.1 h1:FmkAacg5OYFEMLXpCa5NWLvQHNumYVRtwcG5sc4UUNk= -github.com/aws/aws-sdk-go-v2/service/account v1.25.1/go.mod h1:QSb7ynpJNa+VKXHxmWN+rs3ByfBGs+p0SAoPFxX67aE= -github.com/aws/aws-sdk-go-v2/service/acm v1.34.1 h1:bbwYpBRLNjE55qY4Mb0fnkPKeAmyaCk+ycGuOeI4r9Y= -github.com/aws/aws-sdk-go-v2/service/acm v1.34.1/go.mod h1:mZqY4hx40BypyT3Qm4FWpIoSdkauoV1EUDk/3ByQSuk= -github.com/aws/aws-sdk-go-v2/service/acmpca v1.41.1 h1:YQRAmjHJd08P0/1ADX386WVr2SgOlHX5epQ1LGOzG54= -github.com/aws/aws-sdk-go-v2/service/acmpca v1.41.1/go.mod h1:kZGFX2gboWjbnAuuKVLXB+S/TQ8AcY9Q9hWzcJrhink= -github.com/aws/aws-sdk-go-v2/service/amp v1.35.1 h1:5p9HHs0vsAaDn5sWSu6eH76iw6xnPRw7h+M3J5u8wp8= -github.com/aws/aws-sdk-go-v2/service/amp v1.35.1/go.mod h1:bKEb2NoSPx/F+m6gzuyuQwYrP1jVWxoEsp8dJaroviY= -github.com/aws/aws-sdk-go-v2/service/amplify v1.34.1 h1:Av8JqcN88qS1bsfxT7Sdc3V/teB3/RjtTOo3MBU5N6M= -github.com/aws/aws-sdk-go-v2/service/amplify v1.34.1/go.mod h1:UlevIZWf/Y2UXiBXJQ0RZGxSXPtryaYZx8AunJPpR2U= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.32.1 h1:XfYB8mz3dzqnYzK0N4iR6FqADNg/eJIrJ3rbOEuYWKo= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.32.1/go.mod h1:xAQ3iEH3mZpJE9/Us5Zw/kdjqEDMllQU7zVSrykSqq0= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.29.1 h1:zIO8otLy+xqjrPDSaWyML1hcmQuwnvS8HsCdU+ljuN8= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.29.1/go.mod h1:RgLyUe4baqp9nU779yVNqknHpDg/KqV5laDsCfqIfSA= -github.com/aws/aws-sdk-go-v2/service/appconfig v1.39.1 h1:3bGMrqprI9jnWqa/40jnp6RwEV6w5pGLTXTZZbBXZkk= -github.com/aws/aws-sdk-go-v2/service/appconfig v1.39.1/go.mod h1:dtjuU/bnTddHETE8FbgcROmOnD/zkW7EX9JNusF3iLs= -github.com/aws/aws-sdk-go-v2/service/appfabric v1.13.1 h1:kpb5/Bux2n8fQpAcQ3bP4Sei0TMRpeDHTvBFFR6GuFQ= -github.com/aws/aws-sdk-go-v2/service/appfabric v1.13.1/go.mod h1:9wFbrLrpuBUxnAsL2m7tU9pIY3L+dDZCMbNW4Hpr7dk= -github.com/aws/aws-sdk-go-v2/service/appflow v1.47.1 h1:6LIRPPKQWchfkDZbC9iW0FCkvv+V2uQk6PUn+zw1QaQ= -github.com/aws/aws-sdk-go-v2/service/appflow v1.47.1/go.mod h1:bOvWsq5G25xdPP8KN1rfXq+cF5Uh3apZJQ9/xhhqzVU= -github.com/aws/aws-sdk-go-v2/service/appintegrations v1.33.1 h1:sBqUFcefH0sf+d0uS75pYpPiwFg8AzrINC0PartTgqk= -github.com/aws/aws-sdk-go-v2/service/appintegrations v1.33.1/go.mod h1:unDUxaKaATQsiTmjeLwD1dz9zFR6DUSfdaUuczhqZ60= -github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.37.1 h1:jJscyHRsZoSRMINE7JTaezT1o4hoNrmnq+3LZzsA2KA= -github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.37.1/go.mod h1:U6e5PYaKSZZB5h5MHp5M5HZsqa0Fnhh8ts2nU2HUYz8= -github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.31.1 h1:hL38Wrg+M1ppQsh/7KU3zF4LJ37EYJgP6lxsJzk8JAY= -github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.31.1/go.mod h1:Sb1hExvSSaroiqVyAZvSNSnde+ljebREjCK9NcFgGSw= -github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.12.1 h1:iy4/2jZHe+AZ+dXaajLA9GiFqjCgSr98sNNaBchCWic= -github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.12.1/go.mod h1:m2DMDjqYA42+z/vUFqhCH0JMPSQBRj1x7qzx0xb3BGU= -github.com/aws/aws-sdk-go-v2/service/appmesh v1.31.1 h1:e8FX41jsKWustjg9j2aCB8U6lGEJc4M2AmQg/4sly4k= -github.com/aws/aws-sdk-go-v2/service/appmesh v1.31.1/go.mod h1:QI0IZBZJ5PDUkH5H3RsywJidrT6FfQ7kPKs+dCBXsfA= -github.com/aws/aws-sdk-go-v2/service/apprunner v1.35.1 h1:+Zn6vfiFbRmQCcGQiyImMftao+e7s360Q/qFhz2Cgmg= -github.com/aws/aws-sdk-go-v2/service/apprunner v1.35.1/go.mod h1:S07Cfmppi5b3wu11h6o3My/N9nUqjQ7u0U+wbISMciU= -github.com/aws/aws-sdk-go-v2/service/appstream v1.46.1 h1:I2q1xR7PWi/LQlEQKuYhs85c5Pe+8lVXhK8MJ6gbiMI= -github.com/aws/aws-sdk-go-v2/service/appstream v1.46.1/go.mod h1:5kFtgc4YQoe7OR0BU2niXUX/gIxvO0e7P3gl0w/qNa0= -github.com/aws/aws-sdk-go-v2/service/appsync v1.48.1 h1:ZDL25UdJ53x6+HRznXwBcgoZS3I8YtJKUyNAD9P37F8= -github.com/aws/aws-sdk-go-v2/service/appsync v1.48.1/go.mod h1:E8yfHHkF3MIWOWRmvopbeK8wfCkeiNIqQ5f8G7fPaO4= -github.com/aws/aws-sdk-go-v2/service/athena v1.52.1 h1:5rNoigvi9hF3zv7e8hI5l+iY5KAwKklcZCgpAh56JKI= -github.com/aws/aws-sdk-go-v2/service/athena v1.52.1/go.mod h1:Xu33b8kDuxb2omK+SUaQfbJh48c0QA7t08ne92DvTOM= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.41.1 h1:Qwhpy/ijOSxxI/V+je0qsHdxbqbDfBWR6MQ3HJF6BEs= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.41.1/go.mod h1:EarhE4+FhGV6sYnrDvsw7z4+pYSY9zX2xlkbuetUVmg= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.55.1 h1:zX6/huIuV5ldMXSiVVdmRT2oO1M+xNLzdt0du0QuhVE= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.55.1/go.mod h1:KWk5jIp+F7eu9vjz6g/UdeIk5FX2zw7zllkf8EwmHjM= -github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.26.1 h1:CkI6bqB4xGt4i8WFa4VPqkSS+2pnclSY4Zo0dwuplkE= -github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.26.1/go.mod h1:kvxZ8JSGk6ZHbsYqn02OFN2IPwKIyPq4gJJP2i68tlE= -github.com/aws/aws-sdk-go-v2/service/backup v1.44.1 h1:g8w8gNNnmpj6IB6f/ZwbTLgCHTq72EP3vFy3LYAQ49k= -github.com/aws/aws-sdk-go-v2/service/backup v1.44.1/go.mod h1:w/Tj0I8Gs1JAz/cDsWZg0Eph8Tq++krpwr5lxzRj9gs= -github.com/aws/aws-sdk-go-v2/service/batch v1.55.1 h1:Rw14EEy05ulJ8uVBr0NXS7rBF5blIdKgd+XB8IT9Cvk= -github.com/aws/aws-sdk-go-v2/service/batch v1.55.1/go.mod h1:JfQ32ZzGrphsjC5aSZ6NirIQKQEvIRxd7XOBA2GqP3Q= -github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.9.1 h1:KLTrvcyHoLx34b0r8DJrg6IveMJ6Rhrr/W7CTtcyHcY= -github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.9.1/go.mod h1:5ycq8robRvawqh+gGGSYDCtX/lgJcBHSpbXS41G2YZ0= -github.com/aws/aws-sdk-go-v2/service/bedrock v1.40.1 h1:sRAcWHE3DQOWNNfXfctc+R5QrVnDUwjqrqepIWo25HU= -github.com/aws/aws-sdk-go-v2/service/bedrock v1.40.1/go.mod h1:ZTp/fekiiAUkmAU4CDYjtk/hlRpPJnbGKaFzMNr+Hq4= -github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.46.1 h1:+964aZWEhatObFc4aShL6yyLXcmr4rA6NPGd+y6TlSM= -github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.46.1/go.mod h1:PYXdjAxfDP6jvOtgZIlXn+7DS2rYfMONfDiYxx1I3T0= -github.com/aws/aws-sdk-go-v2/service/billing v1.3.1 h1:ubne5J3y/pp9c/ojwPhTbBy5PJB7Gs1WM6JooUQJzCg= -github.com/aws/aws-sdk-go-v2/service/billing v1.3.1/go.mod h1:YeisxBuT89KEnsEw/BXZy+En8LjBzP4wfVqHf9Lkqzw= -github.com/aws/aws-sdk-go-v2/service/budgets v1.33.1 h1:Iai284Y0UvwLD8Bz/qDXbmdMGzrYOHCnvAKStFIn78A= -github.com/aws/aws-sdk-go-v2/service/budgets v1.33.1/go.mod h1:KkS6P8P77BprIvQyfB8cX0qkYftuwBSpug2AYjGQRow= -github.com/aws/aws-sdk-go-v2/service/chatbot v1.11.1 h1:MQ4cl83vzh3+xNt6p9wpd9Eu4UffTZDwPq3Ow6fr/4E= -github.com/aws/aws-sdk-go-v2/service/chatbot v1.11.1/go.mod h1:6WF++CTyTdZuyhTl1hXbgCe1GUvBop62/HpVvlX7uHY= -github.com/aws/aws-sdk-go-v2/service/chime v1.37.1 h1:uZotozsudJwrN4dmmRz35pXBCsDUyRNREHS6K54UNic= -github.com/aws/aws-sdk-go-v2/service/chime v1.37.1/go.mod h1:RtRWdRgq659iw+IX8GkicgBeUrAi/uM/F6UB2kRXLEw= -github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.23.1 h1:snEGKLwYw3hQWjnFWP4tJgeGB58EJ5pKVRXOQr8mgiM= -github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.23.1/go.mod h1:Jw4s1iOrBDZFuypWDpOLuZYnAWT1E7n7NI+F/oPTyR0= -github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.23.1 h1:37kUAkGtiiFvuwB8Q+fx9WwYuCN6UsCAj17hi30mVLs= -github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.23.1/go.mod h1:zbl4bbWYNgSrLi2KshZcnXhgUogEMwI7mTu0BL1z3m0= -github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.27.1 h1:BCWj3VrS1wrgaixwbrJ9VJG9JtdSdA5u5S5RHbv036E= -github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.27.1/go.mod h1:VNBjeDkZNToj7jboiPq4KlPI7Y7OP5m1tN5Y652vNgQ= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.30.1 h1:04cu8ernMSugkM31n9yPzvweuze8bTlifLe1Ky1J+3w= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.30.1/go.mod h1:vJ5ns5qOlLbAA3A4IhAXNYJ2ao+3ckUkeshi6IuBZxg= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.25.1 h1:7S5JbWI2b7lSCWcWcrgaE0XSYS3muGnt+rrxEWH7c5Y= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.25.1/go.mod h1:bvxQ0XpcdTa32bVV9ORpSQA3dLKBGZbbH+1HFQgx4ng= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.62.1 h1:gqN14m9ds7GOyB9B3es0Gv0xf1OaPpqmU1qUGXh8sR0= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.62.1/go.mod h1:bfVI9myeahAr36mMKS/dtXsU4inMeZd9CCYe1kcHmHA= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.49.0 h1:ZABkPLtfK+q2GkW1pA+NukaGM/EAKamEUR347B1md2U= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.49.0/go.mod h1:PHC5ybfgglvCqD7fLaqR5A7LIuJqIoUxhlwF/8faMt0= -github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.10.1 h1:c0BRZh3XLzqzx0UuJ13HsnFQEpPWwpGKDoiONRZmdPg= -github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.10.1/go.mod h1:Vyk18vQt9kEsM/YyRmnLKUmLd6DI/JhcL7MeRD60WpQ= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.31.1 h1:beB+ptVgyQsnISH3XjxUmbhtn7oO6cuuB8kwSQp6LfE= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.31.1/go.mod h1:lKCraexL7AGqlyR6j4uBJWKDMvMyDydrjOLcSmgCAK8= -github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.28.1 h1:ggLVSG9dPkP02VXhRAWLpq7FpNxM9S8F6M2UGqKsv98= -github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.28.1/go.mod h1:2+h6rZKo2OMnxiE5gyqLwB50cfGm25PsDYSiamOQ9Dg= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.50.1 h1:f+n0I/ayFBFUrq/x9Y7YwJlQr+SkoNjJpWy24scdtps= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.50.1/go.mod h1:OE2RTaxbHdirCXEtYu4/2K2VNDT2fJdW2XsGngXLEKA= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.46.1 h1:jdaLx0Fle7TsNNpd4fe1C5JOtIQCUtYveT5qOsmTHdg= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.46.1/go.mod h1:ZCCs9PKEJ2qp3sA1IH7VWYmEJnenvHoR1gEqDH6qNoI= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.54.1 h1:eKC7wj2CjC0dJcTPPZa33ku+mueglsEb3c8L8GMarnQ= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.54.1/go.mod h1:+Y32vrMhsQMA+q2x2cyQrox40n9RSkmZ6t+sGujF0ME= -github.com/aws/aws-sdk-go-v2/service/codeartifact v1.35.1 h1:q99yNK/Gt8XzQ7hfxIDlK97S9Vmjsg/R0ihMS4P+QPw= -github.com/aws/aws-sdk-go-v2/service/codeartifact v1.35.1/go.mod h1:VKj4D43shqsd8dQPL/ToiS07uq+T0EZrQAxSA/CpXJQ= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.62.1 h1:YgQ9aeWfU3BIvgATyl0QmrNJCJvptK1JGLOpSWyrAh8= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.62.1/go.mod h1:WOmjO0fUYhgcNaa2jaqqZ7mpJxcg08OmDcBeOManSrE= -github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.18.1 h1:w8Ehk06uqB2zyiKTnbkRUqdCiVe65GiLEXlsOXjPkPs= -github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.18.1/go.mod h1:q7wXTFLkr082Ae1N3j+r9as7Qjow+XTu3Ck/dKtksGo= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.29.1 h1:dpVTBYBDawcWN5Dzs/mEIsvbTIB7DZahTE8ZFbOXfDc= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.29.1/go.mod h1:CDOCvuSESB8TytvDLyElgP4gVMZgYJNEbCBWiVSHbYg= -github.com/aws/aws-sdk-go-v2/service/codeconnections v1.7.1 h1:f20DiugdjJZGsFhdaKrKX5bF2V7DzE48gPNWVBCtCaE= -github.com/aws/aws-sdk-go-v2/service/codeconnections v1.7.1/go.mod h1:B/DVlqEIwSkOQFdy5IMbTWvmvc/b/lY/v9wZFWlxCqc= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.31.1 h1:nLtbuM+D3kr0TANA53zNzfgCn1msUIZIVvO8GQ8zgsw= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.31.1/go.mod h1:nhyDCGnLTixvFU4RfdiQywPgounyF0se2CAAQZC200c= -github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.26.1 h1:yp9Ilhs7gtUeK90/Lfqr/zXPu+wFVHwI4ASR+EpzBP8= -github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.26.1/go.mod h1:M5AqEEJg0YVH0HolYS6qlDmVotbAkIaU1d17sAPFyDI= -github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.31.1 h1:o02/8n6dGGYFrTCE0mqHKLZkprnUjehxqf1WldSWrJ8= -github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.31.1/go.mod h1:HiWlOR1PpVyB59fCnPuULZ/M0P/qPPV27cJgMZza0+g= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.43.1 h1:4f9TwbJesmy9tqPtUbSMo7gg6TLnCK4ylLq7n0qFVWc= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.43.1/go.mod h1:s6P0ArGOLmTXbc1lIeRczLm6R04ZvayVWeX8k3Z9v6I= -github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.31.1 h1:YPFqlu6T3bxhmfur9CFazxh5puWiL0uxjrukw2GEFPg= -github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.31.1/go.mod h1:y3qe0icKlqpF2ccL/o6t8fPR8c0o4tGplskz34fvJx4= -github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.28.1 h1:fRqouJqnHOFgVHLjhe/UXJWkihuDByU9CBBuZGUU4Ek= -github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.28.1/go.mod h1:oPiggwnMwW1eRcFq3rImb6gms6HIqgr+h65NSZzOn3o= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.30.1 h1:NB1+cWutptq+UHLSodvhdhNw8mSf3L2slhysVs5HCh8= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.30.1/go.mod h1:nPuM/gz996X+i7RSnw1LNdaP9NFBMgEpamx6YB2mrQQ= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.54.1 h1:QS+vL4FEdHfs7wSGj7SQJZmbk3m7SMzNI3uluL8KMwU= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.54.1/go.mod h1:gdYsfThKvm9P3PAqtXR9Lx4up/w83eKGCW0myw5s5wI= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.37.1 h1:Xat/BhQMFHWTNCcZeYu6ETUyk1xrTBHmSBabQZsoCTQ= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.37.1/go.mod h1:j9LTyGi9ayVVJTv24l18umZyMghJMBGAz00LNa/FD+Y= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.44.1 h1:Vz3eSSKha0gWpZtUmGDJDUGw+J+CWNUs9NtM2FnOgiE= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.44.1/go.mod h1:/GZI/NTlYrq4ebfgeAWd28CYAIkma0LEhzR6LBxkAsc= -github.com/aws/aws-sdk-go-v2/service/configservice v1.54.1 h1:f6aReZOJPcBvEdpMUy16fHeOEs9Dy7PwqQ1qMQpYxt8= -github.com/aws/aws-sdk-go-v2/service/configservice v1.54.1/go.mod h1:AF+ERbemhpKFDlA+LTHNgol4p7uY1ovFe9fCB+RLALk= -github.com/aws/aws-sdk-go-v2/service/connect v1.132.1 h1:eKxoFnZ+WuKSCvnrUSfUYsxniYA1PCKtu97+3fhhdP0= -github.com/aws/aws-sdk-go-v2/service/connect v1.132.1/go.mod h1:rbvCsyvfb8gqfvmS25MbGtytizsOhSUcxLWt1rGCNj0= -github.com/aws/aws-sdk-go-v2/service/connectcases v1.27.1 h1:5aZmKdQjd1rSCDjEBKKt0EzQY5DRfHFCCTpNiw/0haw= -github.com/aws/aws-sdk-go-v2/service/connectcases v1.27.1/go.mod h1:Fv0vm+4lp7bGowaFlHsM6OWGRGsRmhL4R1UZU4F4Y68= -github.com/aws/aws-sdk-go-v2/service/controltower v1.23.1 h1:Y3vnotVgNjDLTajaTTH+XbDcmmB9jfQ+Qz/YN1dbONo= -github.com/aws/aws-sdk-go-v2/service/controltower v1.23.1/go.mod h1:nKfpvxTfSBs+V/OSWVlzYV5K7RL9J/P5ZvGNk+0/Mug= -github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.30.1 h1:SYiS9JKkBdWl3sV6v2KMt82XKc+JVUwifpf6JMIyI4U= -github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.30.1/go.mod h1:yElKdxGVSH05dS0kzR6AAiyp/+/c0tGk5DoPgffIl2A= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.52.1 h1:MRfsy+UosplTbrTui5cUVJ4era6XBjZv0lEGUgcG86Q= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.52.1/go.mod h1:XhV87ldg1xBh4WjKcc6aW3SFwzaIjNhuPtDEhZ5/gds= -github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.17.1 h1:wP6PryT7nTlNrnsBh5riZLJXM1zOjzcS0xCKvAqmRnM= -github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.17.1/go.mod h1:ptisHEhEb179hVX6qvulR2ZQ2oRJU3BpmouFmM8SRDU= -github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.48.1 h1:3vub+nmiLA8HX92CinuqtoTrcW//t+sAFFcOBioT2BA= -github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.48.1/go.mod h1:E96OYyTW0QrMri8Xc3RYV7BrJhd7SUrqsGL5YYCsneU= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.54.1 h1:tHAEfv1QzqRN0I46Bxc7vNav9B54dDPv8ZyJei+TtUU= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.54.1/go.mod h1:l/63jy0JYcuPgsIn0sCarneGQZT60Z3VJZCTHg9joJQ= -github.com/aws/aws-sdk-go-v2/service/databrew v1.35.1 h1:WyjDtS3+ZYk6PYc5f+r92dUbl8rKXafSALk4gbSc9sE= -github.com/aws/aws-sdk-go-v2/service/databrew v1.35.1/go.mod h1:ZU262AoIUejl0Sjc4iZcOa3V4tGM9eJGmFl2kVuqXmE= -github.com/aws/aws-sdk-go-v2/service/dataexchange v1.36.1 h1:vhAcPY29FzRoyJEeFZny/cW50gS24Gt94VLgEk00THQ= -github.com/aws/aws-sdk-go-v2/service/dataexchange v1.36.1/go.mod h1:+3KxWI5wJ70b7eCiUOQQArXw1ba9fRWjwrtJ++SlAcE= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.27.1 h1:yDWeBJrxYOeqZalv6rYH8pKG+yHHcT3IlagoVvWgGaU= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.27.1/go.mod h1:XOb2itVVqEMQUUsCisw4B2ViGuF8bgnxTJDEUfeQmfA= -github.com/aws/aws-sdk-go-v2/service/datasync v1.51.1 h1:OmB6TLQAlHe674BdA6iYos3twoaqlRi3O3D4ugY48PA= -github.com/aws/aws-sdk-go-v2/service/datasync v1.51.1/go.mod h1:sYdcLC2TL27hMrCF22BodOKNHw5qp9p+3lMR8MOhBT0= -github.com/aws/aws-sdk-go-v2/service/datazone v1.34.1 h1:7Vc7AKcOiWiUnEkuKIJym8mx0ZVAElRxek8nO/Fu1JQ= -github.com/aws/aws-sdk-go-v2/service/datazone v1.34.1/go.mod h1:7cSev4IbgiJPWqraB12r4ieb73nrGFfOCvDwuGkTdJ8= -github.com/aws/aws-sdk-go-v2/service/dax v1.25.1 h1:r3jbJgyI9lsSbQI8IMFEMmawIzEaD97nk54Xe/Voq0Q= -github.com/aws/aws-sdk-go-v2/service/dax v1.25.1/go.mod h1:PIN6XFvWGPlyg8Mb/P3OEBq4Qh7Ue1CGXNen/kpGi0U= -github.com/aws/aws-sdk-go-v2/service/detective v1.34.1 h1:R1+JPYi15Sow0hS36G0vbg7A6Xk5u3vUxDXSm/wry4c= -github.com/aws/aws-sdk-go-v2/service/detective v1.34.1/go.mod h1:76n0ZZINIlFxYRJAJE036Es05+2B29Ry9ua6sbwmeNc= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.32.1 h1:ReB2/CPevDweGjecwp8ya3vJsmhH6fziyhuYXbW7l8s= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.32.1/go.mod h1:yiyj6Af9/jK0/N3KwTsNf8HGEMDMzwWuKNeNCv+xq0g= -github.com/aws/aws-sdk-go-v2/service/devopsguru v1.36.1 h1:cvXl9NB4eCIcI2OJoGGUP1UTe3lgMwECXu6rKX4/fxA= -github.com/aws/aws-sdk-go-v2/service/devopsguru v1.36.1/go.mod h1:AGvxtUnglcKvdNDclLBhfO/ksr7cPXlcXYcErasXHM8= -github.com/aws/aws-sdk-go-v2/service/directconnect v1.33.1 h1:ur6teJsonXZ3DQ4HY4F68b5rEvRVxpm7WYaZTTZiYeY= -github.com/aws/aws-sdk-go-v2/service/directconnect v1.33.1/go.mod h1:Zz+wZAdmA+3xJ2/4HFfkDJUqCri4i4wJ51RC08CS39k= -github.com/aws/aws-sdk-go-v2/service/directoryservice v1.33.0 h1:6Mkvj/XKGR0un5ZN3C/fzbwEQDfvFyiqz9onbul2tXE= -github.com/aws/aws-sdk-go-v2/service/directoryservice v1.33.0/go.mod h1:cE8g6YE7isdWy1WJEuslcG9/O/xYpN56+Gd+v5Nay2Q= -github.com/aws/aws-sdk-go-v2/service/dlm v1.31.1 h1:X3N98uVi57B01cxV5wlSEXmaQDoH0SkT/cPVFNGis3o= -github.com/aws/aws-sdk-go-v2/service/dlm v1.31.1/go.mod h1:8cJzEU8w/u2gkatmGTd3O7EFLoGP0feaIWihDpDsS90= -github.com/aws/aws-sdk-go-v2/service/docdb v1.43.0 h1:KkTo1IeL3eI6bpAUzzte6byFZmO26njFqdfn0fMgrZU= -github.com/aws/aws-sdk-go-v2/service/docdb v1.43.0/go.mod h1:LXUurR6oU0Mur/zfXB6ZUpWeC3nGOv4TZCvKvxyd1Ts= -github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.16.1 h1:NpdGerAwJLMan0qv9FZkMKurlfrfWpB/tuIxQGcIoKQ= -github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.16.1/go.mod h1:Rt5mVlAnNpabHok0G9i2aP2kuCXmZqUluUWu9Gr4L2o= -github.com/aws/aws-sdk-go-v2/service/drs v1.32.1 h1:Bnca8nXq9fzKneUaKGg6EPs6BRokMoCMjCjxOujPsok= -github.com/aws/aws-sdk-go-v2/service/drs v1.32.1/go.mod h1:GkjA421JeU3rZw+OtqtRhcTX5/oMV4eCktMTP49RjEY= -github.com/aws/aws-sdk-go-v2/service/dsql v1.6.1 h1:9gsd5GS4hpu0Dy51zyUZbO48c94BaUL6445wO0puPfk= -github.com/aws/aws-sdk-go-v2/service/dsql v1.6.1/go.mod h1:zCjUFiEqbIipUKwhROZhoOtW7bgBBfOXf1FSGc2uSRQ= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.45.1 h1:gFD9BLrXox2Q5zxFwyD2OnGb40YYofQ/anaGxVP848Q= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.45.1/go.mod h1:J+qJkxNypYjDcwXldBH+ox2T7OshtP6LOq5VhU0v6hg= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.238.0 h1:fXZYx7xDSocFM3ht/mwML7eCP7cPbs1ltXEM8zpwU5o= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.238.0/go.mod h1:lhyI/MJGGbPnOdYmmQRZe07S+2fW2uWI1XrUfAZgXLM= -github.com/aws/aws-sdk-go-v2/service/ecr v1.47.1 h1:gwqCrRvz+vnhWyG9/WSzo6HspAO5mWXBeYo9ELFUcIM= -github.com/aws/aws-sdk-go-v2/service/ecr v1.47.1/go.mod h1:VVqrGCL0/zQif1J6axnyUBVRf6lySV5/QhxV9RspEHY= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.34.1 h1:BiOKbndtmSaZypHR0S7lO0DuffGegLvbkGfq4aNJlFc= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.34.1/go.mod h1:rAWV5KSmhcjfXEzn2j+heWufy+JWlNDvkhyirRPB0+o= -github.com/aws/aws-sdk-go-v2/service/ecs v1.61.1 h1:C9YpiBJwF9ORx1PNLK7hIT9edNcezQs+ioCT64414+8= -github.com/aws/aws-sdk-go-v2/service/ecs v1.61.1/go.mod h1:NzX/k/6nc9X5l1NShl1p2PLbBZ2IohBcD0d76o7uPtw= -github.com/aws/aws-sdk-go-v2/service/efs v1.37.1 h1:if46gpuITm8t4b7C/1hWSiHTI35LVWXN55H/SCWowl4= -github.com/aws/aws-sdk-go-v2/service/efs v1.37.1/go.mod h1:ytV6yB7YT5kElfKIubv3CP9nKG1IVEXAMDHOC0Wgrgo= -github.com/aws/aws-sdk-go-v2/service/eks v1.67.1 h1:Pw8b30mgnG894pn6DHOvnHqT9tIAqOyg3NuBcsBaL3c= -github.com/aws/aws-sdk-go-v2/service/eks v1.67.1/go.mod h1:ZkszcAXXOpLXbLBZrrog9lCwZF3NyZryUDxXY/InzSM= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.47.1 h1:DIP+2UukVi9P4PHLUF2HXpZEtkbDLmqYcWILuU/m0IQ= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.47.1/go.mod h1:8LEhIVZFKc9OfOrug9sIsm9lTSmiS0KT121aXUnoTPo= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.30.1 h1:j4jxdx6ZiG2Xcj9DfjHhX65af8gpUZ4uvEZxJsEuTHk= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.30.1/go.mod h1:PWa7FRheclz+S0lyhGNw0w4HBoa1fqBzE/a1UXfUqzk= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1 h1:ZZeI9bCwIbqoKu5hll1dmisMJ4ZeBEhdsszV/gOFm1s= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1/go.mod h1:fcC73gpU/J/SmRut8/CmwM5oJO3bSpW7wgufVdtWSbg= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.47.1 h1:H8+KiNkkY3q3u7IUSjc7oCshnHOOGvYOi7fT6ZJ23OI= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.47.1/go.mod h1:91PY/MUWThH0rH61v9r3QA4e7dS/PfXl+K63wltBeas= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.34.1 h1:kVZzJvXCPx1Tkiqfxxw/a4uZmbquVu5NG4FgYXkiHOg= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.34.1/go.mod h1:yHOWiozIeWy2Twojm1eq+2AV9XSY9NBcGLP81eaxTJs= -github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.29.1 h1:qMs7UOiRWN5skmmfmBkT+8ygksVYbPEUNflmlqYhTNM= -github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.29.1/go.mod h1:DThfdXM8k1f9rWh0nUVIqBA35+i8m9oNXdn7vbT9Aig= -github.com/aws/aws-sdk-go-v2/service/emr v1.51.1 h1:uqDQXEq5AEju5XxbycnFiLdsK1+IbmaOqqqt0D3MaRM= -github.com/aws/aws-sdk-go-v2/service/emr v1.51.1/go.mod h1:dYB/K65iH3LBAsSfE2V9hQMMZCWwZ/eskSnvwB+94Dg= -github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.36.1 h1:fatKIhCAmO39bB0XvT0aIsABOtNzirPHkY0O0mibr1I= -github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.36.1/go.mod h1:JkeTS9XADAj2PRKxxzXLlp+pyyxAQpbaoIFo7ydRGBM= -github.com/aws/aws-sdk-go-v2/service/emrserverless v1.33.1 h1:uFi7sYl7SR4WLG3h+L1rW/HFolCi/L/hWHG9fnj1c+Y= -github.com/aws/aws-sdk-go-v2/service/emrserverless v1.33.1/go.mod h1:puDjU4Zu69ZZjkh5L2RyR5T3TVJDeWmQhXV0ZpSfZg0= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.42.1 h1:ME8HTzLgCmHN32s9KChZexwyouSyLPvDn2LJl4r89OE= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.42.1/go.mod h1:lJVM+ARsu8r3lf4dR0RLB1G6NToIJQRb0Gu6ykAMGCM= -github.com/aws/aws-sdk-go-v2/service/evidently v1.25.1 h1:NhuU+ww2xUvZoMLQ2dLmTcZUt9rbU0avHsdAAgkl6fU= -github.com/aws/aws-sdk-go-v2/service/evidently v1.25.1/go.mod h1:tpNT0uaDvJIpW3ykBc3dQ+nr1SEnf/7RgExF6oD3sG4= -github.com/aws/aws-sdk-go-v2/service/evs v1.1.1 h1:/CDLFn0/JzQkRPudFgezHiocIyi466amw3+RcxvfZSY= -github.com/aws/aws-sdk-go-v2/service/evs v1.1.1/go.mod h1:Uz/HiziBhzCTge8mOxy8l2oMiS4Zsqr2uO52hRs7jLI= -github.com/aws/aws-sdk-go-v2/service/finspace v1.30.1 h1:V0gqQtpjjOtrt1Lede0xuTIa5DCf5geHAeEnFmeEqdU= -github.com/aws/aws-sdk-go-v2/service/finspace v1.30.1/go.mod h1:rA1xygzkTSu7WWIhd5QS7QHb6910QBIBe2rN+HTtbqo= -github.com/aws/aws-sdk-go-v2/service/firehose v1.38.1 h1:D5mbw/YzZ9ibZT/SZcc+jppu1EC2YPBXC7n60gEYHhw= -github.com/aws/aws-sdk-go-v2/service/firehose v1.38.1/go.mod h1:nvVn2pz5jdhGbwcYzJ/o+kbZXRwjblofi3stc2mfKpk= -github.com/aws/aws-sdk-go-v2/service/fis v1.34.1 h1:gEd15BudHu1LEW7cE+78CjASMvxrK36z1Z1ayzMwnbQ= -github.com/aws/aws-sdk-go-v2/service/fis v1.34.1/go.mod h1:F5SaK324QSusZ4YLbuROwZ2ZUaczsr4uGTNQK0cTjxA= -github.com/aws/aws-sdk-go-v2/service/fms v1.41.1 h1:b+ol8ooL9qFSVulRN7gT7LMPbCeSXYhS5irfU3U+gJU= -github.com/aws/aws-sdk-go-v2/service/fms v1.41.1/go.mod h1:H7I1xzO0zfGnTGLO5KxdFi3Sv2aHBm/LSEt/ECnMTbE= -github.com/aws/aws-sdk-go-v2/service/fsx v1.56.1 h1:CYITpNYHh86TCr2VJbo9x3BCbHepyF5Tah0P/Z12bqg= -github.com/aws/aws-sdk-go-v2/service/fsx v1.56.1/go.mod h1:vAxwTvmBYSfkC8qVllyQyL7XCgwQpYuUbGjyL/djBD4= -github.com/aws/aws-sdk-go-v2/service/gamelift v1.43.1 h1:DgDl1xmkazdMYxjQgE6dUAZ/IV4DtEjsbiZAt+VgTc8= -github.com/aws/aws-sdk-go-v2/service/gamelift v1.43.1/go.mod h1:3ovhs4O2fcf1tFiUC0J7D253BXrI9w3/VVo49EBCI1E= -github.com/aws/aws-sdk-go-v2/service/glacier v1.28.1 h1:UDiRjAcoJ9pxHvwaR83mGhdkVhXqYY8tnLLyYbR/X+w= -github.com/aws/aws-sdk-go-v2/service/glacier v1.28.1/go.mod h1:JF/OUsjyuN42tFdT6Z7XPMUL0TdgQauFdpAjOlgPzMA= -github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.31.1 h1:BlojjkVblgLjPzotny0DsKcfLBb/bC4ODhI9fXu/YpM= -github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.31.1/go.mod h1:BqZ/xicmt1yJLth0oV8o86GKsEIjF7XLKJA6o6+Tb4g= -github.com/aws/aws-sdk-go-v2/service/glue v1.120.1 h1:+XyO1sIwM4J7Ru5bGlUIkFF3BuSVHp9xHBDKLKt205g= -github.com/aws/aws-sdk-go-v2/service/glue v1.120.1/go.mod h1:GrfuFuhLuhdZy8Tx0W29A6avb0+Xey8DDS0izAj3/gY= -github.com/aws/aws-sdk-go-v2/service/grafana v1.28.1 h1:xef5GSQwdnBBEodb67YGYE7CanW5uuQyI/8q+rMs6IE= -github.com/aws/aws-sdk-go-v2/service/grafana v1.28.1/go.mod h1:wejuc0EF416jLYLVi4yyRZiZLtBwIPHR+L0fUnTlMeU= -github.com/aws/aws-sdk-go-v2/service/greengrass v1.29.1 h1:OiVM4eAVc1Ixumpnf4wQTJVHGA01qjzZlvaisWUBx08= -github.com/aws/aws-sdk-go-v2/service/greengrass v1.29.1/go.mod h1:ctd0N/Z5NBrVk8DRHDnVPDGXLYgEIw1UvG2ia2Tgbvg= -github.com/aws/aws-sdk-go-v2/service/groundstation v1.34.1 h1:dMBjI+4ScXf5fIeYI+70DHxC35hknZUYs2/u2ou9BZ0= -github.com/aws/aws-sdk-go-v2/service/groundstation v1.34.1/go.mod h1:co4tdt5zpodqW74jxLUio7V/EGMBNimy/8RJP8KF0vk= -github.com/aws/aws-sdk-go-v2/service/guardduty v1.58.1 h1:rsEOQaTAe6aJqwntPqjzY/o9E2/3HzP4GQajzizEgkA= -github.com/aws/aws-sdk-go-v2/service/guardduty v1.58.1/go.mod h1:eQ9c3TyaAMTn2/P6vjnPjZ6b3ViTaHsTPOY9gdUBvXo= -github.com/aws/aws-sdk-go-v2/service/healthlake v1.31.1 h1:71vwj+vvOeZJ3w9XuW/9tv80byCdifbQ/Qf5Mc5y2zU= -github.com/aws/aws-sdk-go-v2/service/healthlake v1.31.1/go.mod h1:QrR1Yf1RmLYOxRFL/ctdUAF8ee4LSBHKOa46wV90nQ8= -github.com/aws/aws-sdk-go-v2/service/iam v1.44.1 h1:V82Oyj0zU2QFJL+qvvdAqt2YYsRO0QNb9RewnvDWpdo= -github.com/aws/aws-sdk-go-v2/service/iam v1.44.1/go.mod h1:aZ7pMz0bZfPi485gVCIinav3M61EbkGENEMlcMMWuhI= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.29.1 h1:6EYdc0UwxUCGZRj+iGDU9z47XgUAt1Y/Ol+dALGynp0= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.29.1/go.mod h1:S0hd0msvckDEAMvVPpAv3A5ND3slDD/6V3K9an6sn7o= -github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.43.1 h1:PmJzM5B+coktfBZWoSqfehsm0x97bg0bEworfDe9rB4= -github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.43.1/go.mod h1:XQjpa5wcTMPwzOW+ur3sj3NRKhwkeyP4ofPuW6OG42A= -github.com/aws/aws-sdk-go-v2/service/inspector v1.27.1 h1:QG8CsTmAhAPFmpowqocbfVfRDkh5WkoNtzv4vW1BiJk= -github.com/aws/aws-sdk-go-v2/service/inspector v1.27.1/go.mod h1:3LVGyTD16Yf0GQ4jl39tnMRYO/nE8VS5rZGsJyAKm4A= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.39.1 h1:Uj4kFuhdRozJwkKtDx6lpSpu374B4zUeLAgRCrE6RRg= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.39.1/go.mod h1:Go5fLgTjY0qKiAVTvcS+nlYH0pHa5IAETQPsoYM/3WY= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.3 h1:ZV2XK2L3HBq9sCKQiQ/MdhZJppH/rH0vddEAamsHUIs= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.3/go.mod h1:b9F9tk2HdHpbf3xbN7rUZcfmJI26N6NcJu/8OsBFI/0= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.43.0 h1:GJpQPHoqFQadXt9zgU5y+8Jz242QOkjIZIw+FVsHSUA= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.43.0/go.mod h1:ubuqhQ5cwPPRnuqkDwW0BkA7s4CTsLdRhT/F0Jh5aPY= +github.com/aws/aws-sdk-go-v2/service/account v1.27.0 h1:AXdMJ3BikU0OcISX9Sn+d+G6Z5bWCMGBTi8CzRJc5/w= +github.com/aws/aws-sdk-go-v2/service/account v1.27.0/go.mod h1:yFx5lCxY8Inoi6DAnHA4zV99t9XK3Xm4jVTGJK834yg= +github.com/aws/aws-sdk-go-v2/service/acm v1.36.0 h1:U16SZFwZpyQGXUyrrmOqWqU9jMYhokCSpc+fYajYLy0= +github.com/aws/aws-sdk-go-v2/service/acm v1.36.0/go.mod h1:fdYDfiFuQij96Ryxl5uJK5xGAjyLhHGiBwquH7mpuAc= +github.com/aws/aws-sdk-go-v2/service/acmpca v1.43.0 h1:WukXneuq4cMqMAif9O6k9DJ8MYGChF3ADJu9Jp8gcOU= +github.com/aws/aws-sdk-go-v2/service/acmpca v1.43.0/go.mod h1:z6+6Jmnp4CXxXzJwydQhFVtPwYu9+6oTeEzx3oRcIL8= +github.com/aws/aws-sdk-go-v2/service/amp v1.37.0 h1:ENqKS9m7AL5HiNNTV4dwUQ5E2xARxbMPr2OeK97FHCc= +github.com/aws/aws-sdk-go-v2/service/amp v1.37.0/go.mod h1:LouVPFytdICLhyHVjIlFAO4nE5OJi3KXO+VmOhKwGWI= +github.com/aws/aws-sdk-go-v2/service/amplify v1.36.0 h1:hgh1hVUywvKGKE1SBOas15qK4tGf8tuOIdjMuMDZ5Yk= +github.com/aws/aws-sdk-go-v2/service/amplify v1.36.0/go.mod h1:UfCqtNa9PMpuD2KSJ8DELqJpgmG78U5CoUW2Vf2ZWKQ= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.34.0 h1:IZAET61abhm3dZEMPwU6VLiXKVL2Qwvg0q7Bukpz/kA= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.34.0/go.mod h1:WuGmD7SWYen7UZcDGptMvzl6bN5OZ1x+Io1eI5XN7kU= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.31.0 h1:bbHfZmF4H/PG5EEo0hXDyM/45XZDMbkscXolqardpB0= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.31.0/go.mod h1:qlUNYJtHoTWiJQMJkgi93jwRNRt9uIOUSMZrwMODh7Y= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.41.0 h1:1EQYqGI4Gwlk/dGj/F3IxdZEZPw5Nv26d1QGsSsVPUk= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.41.0/go.mod h1:iC0QI9BkqzOa3bqZ3SI1GGobEOML7mV+tBTnh8hOoYI= +github.com/aws/aws-sdk-go-v2/service/appfabric v1.15.0 h1:lymNTWawpNNwwiJY7BCqBIJzLQ8p8O0kHE9/iQ5UIXc= +github.com/aws/aws-sdk-go-v2/service/appfabric v1.15.0/go.mod h1:qKKz05wkdIZ+tkR3rnV66+sxYKIsppwx2hJiT3fuFdk= +github.com/aws/aws-sdk-go-v2/service/appflow v1.49.0 h1:Na5N1Pb88dfNt9LbDj4VIWa9KGPAPqm6HjXWaan75p0= +github.com/aws/aws-sdk-go-v2/service/appflow v1.49.0/go.mod h1:1vwP4HwCMVBINGTry8iEgeWJG8T7BCMUbwGq6jv2fyU= +github.com/aws/aws-sdk-go-v2/service/appintegrations v1.35.0 h1:4mIoI/hf2GdN0gMQGRcle62J11D4gGJRMcAeYLJeEzk= +github.com/aws/aws-sdk-go-v2/service/appintegrations v1.35.0/go.mod h1:BE6N7P4vcnkAK/ThYR7d65SMt+zjxpo3JMI+ccryyvg= +github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.39.0 h1:WknzwSXavLeI6hBZSDIpytKGGGXA+6rNQFf/jA9NtJI= +github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.39.0/go.mod h1:5KVddKIBcX5dqvw5NOxIW7/c5m2eP5OpdgOOtOmZV+k= +github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.33.0 h1:B4rFraSi6NFtwWg/QYr6Mug4ucibKlaDESd07gHTj40= +github.com/aws/aws-sdk-go-v2/service/applicationinsights v1.33.0/go.mod h1:g4GYCgL5sPZYHuq+20i4MbtbyzQVtdq46RNBsXtl8OA= +github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.15.0 h1:SqxybdZ6g/5bl0YaZXwzwO8nBZZVWYQEMTmrtIin2A4= +github.com/aws/aws-sdk-go-v2/service/applicationsignals v1.15.0/go.mod h1:uisXhUwAotYm2Fq/wZ/o2n41DjZJ6wOqOPKg3wg71vA= +github.com/aws/aws-sdk-go-v2/service/appmesh v1.33.0 h1:JBQbf6oX9kNpMj8ehtekQSd33S6BZWv577ddGUbFhQA= +github.com/aws/aws-sdk-go-v2/service/appmesh v1.33.0/go.mod h1:5d1YrmN3Md75Nu30REsNbXZuiFPZr/jFgB66VAP62v8= +github.com/aws/aws-sdk-go-v2/service/apprunner v1.37.0 h1:FD6ANh+B4eaJ5hxxHqgUXvyRLiuFGF+xnJR9vqsBVyA= +github.com/aws/aws-sdk-go-v2/service/apprunner v1.37.0/go.mod h1:V4jZDgQOKB2SQReBF+3/0isB/C2UnBV4A//4GhXZw+U= +github.com/aws/aws-sdk-go-v2/service/appstream v1.48.0 h1:vHXkPxz6DR28ISql1XUZX5yNee9IMyei3ybAUD4Hjqw= +github.com/aws/aws-sdk-go-v2/service/appstream v1.48.0/go.mod h1:i0zZFMnPUEbkFUjy5cgpbLONEpFQ/M1X+K1VxYG76l8= +github.com/aws/aws-sdk-go-v2/service/appsync v1.50.0 h1:V/aQVXHEgacW8l2lOnX9qgQh6SCkcKT3GDoMBdXHG4w= +github.com/aws/aws-sdk-go-v2/service/appsync v1.50.0/go.mod h1:wktq06C/DKgzBnfiAG91irzV6V/YZq3rjPfZn+Yxfp8= +github.com/aws/aws-sdk-go-v2/service/athena v1.54.0 h1:8QK47rrFawD8jtTmDKMKZr0lujNh23p1bJAZNyQJLYY= +github.com/aws/aws-sdk-go-v2/service/athena v1.54.0/go.mod h1:jph/XCzsyc69PoY1QOXFoGm/bk5VC5snc4uFYy6mrGU= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.44.0 h1:Sem8rU6yn64VNGn7OFB6XnMKUXTBprarXFeIhXHoZQc= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.44.0/go.mod h1:Q3FAo0fs6pq3Mgs0OU4kG73jfFFe8Q+n47ocWKdDUNc= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.57.0 h1:PwAha4djh1MsmRgtKQ6exCqX7pTTC7awEN+1zD+Lv0A= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.57.0/go.mod h1:MSY6dUZpI3obWYZlH77CXNR0gOsAX7bKVFv4fOIKODI= +github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.28.0 h1:K5VhfJPPyrToRq3JN0o2JKzIBKoZbBwHgVEecRpTNqI= +github.com/aws/aws-sdk-go-v2/service/autoscalingplans v1.28.0/go.mod h1:Oph1NMrQKGeygUJXWkxSub/ZaBHoXCGL0ikBWKqmwQ0= +github.com/aws/aws-sdk-go-v2/service/backup v1.46.0 h1:92R0oLf9R1kyC0LmH3rpH6R/TsmIXk5u8a7u0BqBC98= +github.com/aws/aws-sdk-go-v2/service/backup v1.46.0/go.mod h1:oZRnbfpP4suZxn9T13hpOy0JW1UAj+dY0cHuvQEzhl8= +github.com/aws/aws-sdk-go-v2/service/batch v1.57.0 h1:saon+alGICDcv5yIHE/O7eHNUCT6LgUMIAMHoY4kpg4= +github.com/aws/aws-sdk-go-v2/service/batch v1.57.0/go.mod h1:j1X5R4qrXpQlWH8JpQyTGHQ48KVTMyl4+W+bETY2x6k= +github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.11.0 h1:rqBqfB/V7SG7LNiUD2y5XzrJDlFFvParoT9HRGyx/1s= +github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.11.0/go.mod h1:u3oQZCGzxgN7coRlIY7WoU3xRDm9M6hXL1S+vDMwNHo= +github.com/aws/aws-sdk-go-v2/service/bedrock v1.44.0 h1:cDCNcaDxbB7B6ABhUsi/IxK8cOwucqfKD/s3d5B8lj8= +github.com/aws/aws-sdk-go-v2/service/bedrock v1.44.0/go.mod h1:jogJ8f7UaV3PgmblRtn1AJ+Xe8k+A6hjhHLUZlNI74s= +github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.48.0 h1:p7AHuhT9Xo23oS0B4Dlo3QTuR75wNxLdfXXvoXRRAMM= +github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.48.0/go.mod h1:Ff+BaL5h7/pTZxEVZfIFvqxD28GSDr05gjOErxsEvss= +github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol v1.3.0 h1:8vdMsSGKMJ0KKm9xRG3lWupvlxAfoT1H2mNL48Fcmss= +github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol v1.3.0/go.mod h1:y63i77wmkgOiBLuDo+BhQIkOogCi4YGEfWw8FLziSyA= +github.com/aws/aws-sdk-go-v2/service/billing v1.6.0 h1:Qjw1OzZ/xWlhAE/05KO8WPAt43g+KM34jyatIVSihy8= +github.com/aws/aws-sdk-go-v2/service/billing v1.6.0/go.mod h1:NGrGJEAUifD+yk6yDu18vcwB0/onrE/2duTXyWtpQpA= +github.com/aws/aws-sdk-go-v2/service/budgets v1.36.0 h1:l9NAh1G4Dx6ygvXtI+q1LjJhIOjFfuglgzCgK4oz4To= +github.com/aws/aws-sdk-go-v2/service/budgets v1.36.0/go.mod h1:hN7Azd0je7dP3pNZX2zwUqQUe1FnwT/lBqXFZcyeF4M= +github.com/aws/aws-sdk-go-v2/service/chatbot v1.13.0 h1:YSr29la/2ZjvLzpPSTNZ+4UKUMVIB/By9RHbwsozZAU= +github.com/aws/aws-sdk-go-v2/service/chatbot v1.13.0/go.mod h1:Hy1FNUMiWlbH1j54n2JHARTWa2s9SuC1EDV8/5rWneo= +github.com/aws/aws-sdk-go-v2/service/chime v1.39.0 h1:OrR18jIg9a5RBxgMPbWksJT9tmTa/KOf6LmJOTiL/nM= +github.com/aws/aws-sdk-go-v2/service/chime v1.39.0/go.mod h1:gAVdkdTSn/Kp/2aj5bQWX6RAjBtk0mhtx9kulUz6IdY= +github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.25.0 h1:/a4GRYzQy/9T48CqAGlythaPj6Y5PWCRnMFCbqXp1iY= +github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines v1.25.0/go.mod h1:hX5xwl8FzmIQMxfkaNxMbGVnTzDyCaNCe0qGApFDSHc= +github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.25.0 h1:BtwQUwyufH3WhisHCct+10JB3tbqYgnlcZkWQ8TrKrc= +github.com/aws/aws-sdk-go-v2/service/chimesdkvoice v1.25.0/go.mod h1:TzNwrF98kIjcl1NOYUqZ9P0OsUsD1GN8fSJrt+gOUMU= +github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.29.0 h1:wpkgV+tKLNoHsRlaIWv5gswz4hZY1TbwIIuQX/atPmw= +github.com/aws/aws-sdk-go-v2/service/cleanrooms v1.29.0/go.mod h1:s1Uq5wrZPR4SHPux9chAZ0woE7zzpTBaeFDOxNWEfOw= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.32.0 h1:GL80iUAU3t3NG8hqI1YM/VTehaHcYzBBu8lv0I0YrR0= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.32.0/go.mod h1:ZuzNLZis3yt5/NyM5jn7SWQ3uhtq9I5c3JQLcQZcOEI= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.27.0 h1:iYhGDJl3qGz7ZwBxnO8KWP3HBXBEHQwQuCTLtnvl+/c= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.27.0/go.mod h1:3i2UYK7+Me+/0j/X5PWt8lXpbxeIEHFqt9Y0yuP3lBU= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.64.0 h1:zkywcvvuwJcdNUErYJ3JaujgTYy8iOqTZnMJtbt5GQo= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.64.0/go.mod h1:CSZ4pTMdDdwePgGxMo5KOfOw+I0r0cOwLsyULTjFuUc= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.52.0 h1:rJcbtmScByQ6NBIXV97m6e8Rasd0zgvt1z84pdddU/4= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.52.0/go.mod h1:qTc2+9g3YGM5d/u+c4tmHun6vmEKwBjJ7rEM6N3qGVI= +github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.12.0 h1:3H2613Pj9FkIkgPOd5Vi8oj7iLyV2qYMkhd8Qv6Q7qI= +github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.12.0/go.mod h1:9FB5f838TtTLjmTrEkeZL1d75cbVNrTgQodokjUtwNU= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.33.0 h1:3JSAmJhQ2MgO8YFKv0CMab6NY3XUgK5SHemxqyCRdPY= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.33.0/go.mod h1:KcpoisoNJWn7kQf+b6fzdBDBtxzLfwc2UL+0stF8pVk= +github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.30.0 h1:32QN58w//10tYWkS+O+61EPBCKEM5FlLbM7n45wl0kM= +github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.30.0/go.mod h1:Dw/juJ9555u2hj4dnUA8fP68B5IHzS0wnxaPdNJPWNs= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.52.0 h1:Wgjh6Igu7HS57d8AjRIG0bHjybt015dBTc+zh2L/P3E= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.52.0/go.mod h1:TSIIBxkIwUawJ9JyiymBksYZYsvIv8GIF2DkrlcTc5o= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.48.0 h1:NmaelAJldom/+eWDlbYdurKrPL+TSvwKeHH/TnEYih8= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.48.0/go.mod h1:s+juX6Mf6RF+y14IK9Ed02U/q86Tqc3PKHIDtuzBMa4= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.56.0 h1:GiSL2mJ/gSJR4p2HHRrydkM/LVtP82gssI3CKeGCFAk= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.56.0/go.mod h1:0jzhov8WzD4VylEv83E+RkqA8W6k7DX37XyrwMavyvQ= +github.com/aws/aws-sdk-go-v2/service/codeartifact v1.37.0 h1:LVhbfPyUufKIjKVengJswggsFAbdRJe3LGNf6xVjgDg= +github.com/aws/aws-sdk-go-v2/service/codeartifact v1.37.0/go.mod h1:tNVsC5SHowfci8r2wS95tND/l5np9AyHs7P8+MHcqfU= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.66.0 h1:Tm4WvXnZ+tAlYB0W+hKi53reoQpUKr7/IiG/8zPYfOE= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.66.0/go.mod h1:HiaBb3/RkkKBXLfkHch1Wy8tdMkyxhAR75PDf2BZyd0= +github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.20.0 h1:1yOLOPPI/SP+z1z7v50r4i0yJEBe667Tg513qv34Mok= +github.com/aws/aws-sdk-go-v2/service/codecatalyst v1.20.0/go.mod h1:/YU2KmYK0mw3Nwo/Odx3vFsqfR9GYeirr2trSazXGFc= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.31.0 h1:Zen0PfPRG8lStgXUeuNxvdAJ3TlFYJfkJStGmG0RPMg= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.31.0/go.mod h1:OsWM+ToUGgq2s3odxVhJazzPUvmC5PTc/dnaV3Lotow= +github.com/aws/aws-sdk-go-v2/service/codeconnections v1.9.0 h1:B0MOHup8sByXTFmHBa0Gtx31IUPypG1IIN/Fb/c3p7Y= +github.com/aws/aws-sdk-go-v2/service/codeconnections v1.9.0/go.mod h1:/LWsV6gbnhvGjoh8VYYoCPLvmJARA8YrZ6c4YBQnPK0= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.33.0 h1:3YI4ckLMF0x8IgZJaNz81aaUCnPSEvn9DqDZKkBBi2Q= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.33.0/go.mod h1:OGx3gxawc0hbWRDXdCjBvNge9lca3jVugD3B+4FzdFw= +github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.28.0 h1:ZY7lzj4WCPPMSU0PU3FV6Lnx0VzWe9mjlu60YBMkGGE= +github.com/aws/aws-sdk-go-v2/service/codeguruprofiler v1.28.0/go.mod h1:uiGz8IkroknF/60Jb4ORQmcMw8EXyDKzgOt4BWn6hJg= +github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.33.0 h1:GN7I0M4vUQcc7BdwKqv2ly17OBeSPGfqm39BB1qFNkY= +github.com/aws/aws-sdk-go-v2/service/codegurureviewer v1.33.0/go.mod h1:LN5B61rqDh0EmmqAjIq7n0DUILP21RsFy2FWs5W39VY= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.45.0 h1:UsHh9s5J3gW0WdAQ6bXekyEGZl2kCAMDPSsm7lzC6O4= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.45.0/go.mod h1:yQNvzfwnOPhssQgu5vPAI7HPOF4A13sdL8Q6fzu6Jss= +github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.33.0 h1:yT67LHPTvlQ4pWq21DQSd8Fv8ERRDmsZCB2HQ1UjOvY= +github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.33.0/go.mod h1:cAIrqVfSEiixle0xrVTIFhI9PdJCmHPNGbhX2ZH+5Ho= +github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.30.0 h1:L35FZUTiamMITQUbVY2Y593ZE/z5NXu0Qf7AEhBOQng= +github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.30.0/go.mod h1:fqp3NJHc6O/LQMtoocsMxGGeAO9LKiLEv9cDXG2uHxw= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.32.0 h1:MybdZxWB1n6eljU2GuRXvrWXGW8YfFO3Iavml4qxnD4= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.32.0/go.mod h1:6Xk2rhL0WJmxuJUzMNeFafKcQVF5iQWsSouJDHJo7YE= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.56.0 h1:0WVvuvoDZnwF/KAVGQc/utCamQUNa+vctMH9iZqfg/0= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.56.0/go.mod h1:DuMkTI7zRRP+kWbSt0+SnE2qXdQp9YUCZckt+rDDH7Q= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.39.0 h1:1T63UDiImeXzq1itj5CAv0S2i89BnVqKyz9pVbQtC4c= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.39.0/go.mod h1:GjEauPr57vlcBPWW1DyiqkNySZRnMZBf/SmRPwqIXOs= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.46.0 h1:Z5DPlFHw3vVGN8p0jKqVChgffqMXQkMe3vm4agmgvII= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.46.0/go.mod h1:eYtOdX3+8Uj0HjOytehszSvtuTpSCsCzlKEriU8xifk= +github.com/aws/aws-sdk-go-v2/service/configservice v1.56.0 h1:BFDPvTQk/+BM9T8I6uHhtmur8uaroCXoJ0AI2kpNO1U= +github.com/aws/aws-sdk-go-v2/service/configservice v1.56.0/go.mod h1:46dDCtKXik+9IWU9oEOKBWzfQnyqn7EsmPnFUT7zqQw= +github.com/aws/aws-sdk-go-v2/service/connect v1.135.0 h1:pbB8nhUG+FyR29DSfnodqTTD8iiihSP4+PffWceQTQI= +github.com/aws/aws-sdk-go-v2/service/connect v1.135.0/go.mod h1:UNYwIAeewfxeNd8AraZR/l1oj8sVfsz71JmSm0c+yhA= +github.com/aws/aws-sdk-go-v2/service/connectcases v1.29.0 h1:F0hhZPgGQ/JNbd1fgaoooW9Wpi/uMwipeKYjJpeeRfQ= +github.com/aws/aws-sdk-go-v2/service/connectcases v1.29.0/go.mod h1:jYSsyjaru199f/yo0FRn5Z9/BnQEq/XLAl89ksJBe9c= +github.com/aws/aws-sdk-go-v2/service/controltower v1.25.0 h1:oWlHOpu0G3VxhnBirGF/0Tn+euvARocShoTs2Wo2wgY= +github.com/aws/aws-sdk-go-v2/service/controltower v1.25.0/go.mod h1:lGLCOsEUl7bFyjKgcp4ka3GHia6C1hTasvWGGFlaQ6Y= +github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.32.0 h1:LiLWwq5mYglYoksyMXV/L0ZLw+dtnIGXvpoAMri2zEs= +github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.32.0/go.mod h1:es7bS0XlU7PJHV3VFHuwPgFXvHtFzkC+9i5omJt+5Ug= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.54.0 h1:5e/C1PaQywGtklpMotdHKon/8MfsDyzJ9WFh0ge8G38= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.54.0/go.mod h1:tR04F/rUvoQ/5YFp3XS+SDB6pWc/Ls0f19WKA8PauDI= +github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.19.0 h1:nRXBomiIJKLbn8tYbYp2hOmP6mejmzksC8SaekKBVD0= +github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.19.0/go.mod h1:6Zn4eLosXezMNnIpHy2YeOz7lPtoR5Bc69C5RCpeEd4= +github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.51.0 h1:04V9n8NhsYlUFkn7IXKUeR6MpDq0XJ3eTXEJCJtYkdY= +github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.51.0/go.mod h1:35+xMcyogL7u49YQ3TJjJadjJWg8+LuDBdDgxyepZic= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.56.0 h1:Ne8EdY5+nD81tsUgYwijc5Lbc1Dnn1ijCG8npw/yGhA= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.56.0/go.mod h1:9M7lHwBQ/U86clroDhC9PKzHjXicJHn1kOcrMNjzfXo= +github.com/aws/aws-sdk-go-v2/service/databrew v1.37.0 h1:7vB0On4jaXFKzo71y89tWgv7LyrgXh4z5obihxV0IYg= +github.com/aws/aws-sdk-go-v2/service/databrew v1.37.0/go.mod h1:ukMQiiI+wmYPs3kMxbnUa/OqgDeJx+/euWAkoScrUtM= +github.com/aws/aws-sdk-go-v2/service/dataexchange v1.38.0 h1:cSSIBQiQhVVjDOTCKPqp0jsJvfY/zHjKc7VJkIeAQas= +github.com/aws/aws-sdk-go-v2/service/dataexchange v1.38.0/go.mod h1:z9BGYSQJFFReD7cHnDrScpSYsCDa/1T2enrQ9sKA7yM= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.29.0 h1:5a76AMaI1x9YHhL6qclsXWbV/vZEQN1r/cZK9T045pE= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.29.0/go.mod h1:iXVvFT/t6B96iXExuxVp4QMKfU2XUIGazYkptjmF+AQ= +github.com/aws/aws-sdk-go-v2/service/datasync v1.53.0 h1:6e3BS+A00UPLzkgtWj5Sakvom0G5qAn/dEk8U7QG/n4= +github.com/aws/aws-sdk-go-v2/service/datasync v1.53.0/go.mod h1:4gU+dv/Prdb8CB3TaRbrSFLO2tSqPNRnDqIX9IPuQHQ= +github.com/aws/aws-sdk-go-v2/service/datazone v1.37.0 h1:2gorOSV7BNgRqmV6z9u+dhZ1kkPcaaAF8XMnK3ZUfKw= +github.com/aws/aws-sdk-go-v2/service/datazone v1.37.0/go.mod h1:TG25xNgljNX2+CjQ0gkXiOjJG6BTyM7gRJdfC6jGIBw= +github.com/aws/aws-sdk-go-v2/service/dax v1.27.0 h1:wDyL0EZw99zVGuzf4E/AZMiHVp/V6j9+Z8VkP2Xr55M= +github.com/aws/aws-sdk-go-v2/service/dax v1.27.0/go.mod h1:SG2yNQjCwUNkjUxW7YCsUiIKQgoWUZpblEHpmf6Az3E= +github.com/aws/aws-sdk-go-v2/service/detective v1.36.0 h1:0av6yvy0lYUtlgDnZoinqIsYbjM8D4JkEnXzh0WKWwM= +github.com/aws/aws-sdk-go-v2/service/detective v1.36.0/go.mod h1:mS/k1sKOFKsE7Jr34gvsnX52nLSjAWfnjvvoUJwhkTU= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.34.0 h1:zvhsIkUZOol3DwpcvFl/y14uSSs1JNcGsbu7cMdSxqU= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.34.0/go.mod h1:3QfEUV+KuDYX+oOpu86CUe1/m9yVBO8Z+72OLmPGsWA= +github.com/aws/aws-sdk-go-v2/service/devopsguru v1.38.0 h1:+yQPtAOwzsA/4eIT1oGcZu30dljvlCNec2pGOPUsw4A= +github.com/aws/aws-sdk-go-v2/service/devopsguru v1.38.0/go.mod h1:yfBgovuMZJiyeD7iv6LNn45JYSLLWoNjALM0OPPf23I= +github.com/aws/aws-sdk-go-v2/service/directconnect v1.36.0 h1:2ol44vp1EY9Y4IyhWCpwcjZ2KOEl84r29q0bpyvykfo= +github.com/aws/aws-sdk-go-v2/service/directconnect v1.36.0/go.mod h1:nfTthF0vgdEKFt79wWB4mdX8YuLq2slQxG+mv3U+rmA= +github.com/aws/aws-sdk-go-v2/service/directoryservice v1.35.0 h1:raC54NZ3nBlLL8AJgcH4jcI6tM0bPm2gxVk5svtN1hw= +github.com/aws/aws-sdk-go-v2/service/directoryservice v1.35.0/go.mod h1:8ibkf4LivDOjEESETtUUWPVNKBGALuKQ8ApPNNJvQBU= +github.com/aws/aws-sdk-go-v2/service/dlm v1.33.0 h1:akYzmgxmrLRoKJ8USAoiCf8OANELsIkFAx66QFaq/gk= +github.com/aws/aws-sdk-go-v2/service/dlm v1.33.0/go.mod h1:9s516VTcyI6csh0GJxLpd0hGETtdHNVSVyq0R9cli04= +github.com/aws/aws-sdk-go-v2/service/docdb v1.45.0 h1:sFzfpQ9wg2aHBKLP/pphRDFuV2QXFlcWMU+ZVwN1UF8= +github.com/aws/aws-sdk-go-v2/service/docdb v1.45.0/go.mod h1:KHmHW5rJJ7bf8J56Rn2voXfsNTbUXS/TKdGNDurx7EQ= +github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.18.0 h1:afUxq/oBOeeCGxYBAq99U4lhHUL39BNUWnyA10VYtA0= +github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.18.0/go.mod h1:gGqhhqgs7rxjEYwH1T1cKaq3HL0yH6Ap/UvmLVCr2MQ= +github.com/aws/aws-sdk-go-v2/service/drs v1.34.0 h1:Vt2ZQQQEs+OS9bvrnHZiL9TnTXQr1bdZlagdltETc2s= +github.com/aws/aws-sdk-go-v2/service/drs v1.34.0/go.mod h1:E6H0jItb5XS0fk9Mb5OXU6tSoCoGnnWcXT3vaqTEB8o= +github.com/aws/aws-sdk-go-v2/service/dsql v1.9.0 h1:AWC9tLObLqxSeyolw7aug3PxEnU7S9oNqatToa+8XkI= +github.com/aws/aws-sdk-go-v2/service/dsql v1.9.0/go.mod h1:v4koXz6cYLm9p9kT2iYCcLCxxDkX8JFg3UBElyXB80I= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.48.0 h1:6QbNrD5/LaVqsbvw+XZkUwRfJuPh11Y6cmUT/Umva2o= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.48.0/go.mod h1:tMQ/Edfn5xLcBFSVd3JDreJPias8GqBq0dVbCbMz9vs= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.244.0 h1:KfETrpt7yv2nkSrjOltgmKyAl8scbzYc4TFtZeoV6uc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.244.0/go.mod h1:EeWmteKqZjaMj45MUmPET1SisFI+HkqWIRQoyjMivcc= +github.com/aws/aws-sdk-go-v2/service/ecr v1.49.0 h1:NgkSYzgM3UhdSrXUKkl49FhbIPpNguZE4EXEGRhDcEU= +github.com/aws/aws-sdk-go-v2/service/ecr v1.49.0/go.mod h1:bi1dAg6vk8KC8nyf6DjQ3dkNJbzTirMSmZHbcRNa2vE= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.36.0 h1:8GcatvIKYx5WkwjwY4H+K7egBHOddC3wwS6fIbpOUlQ= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.36.0/go.mod h1:yz4NeCWotlbHoT41Vc9NofCbKEyiNlKYZFT4SiqVQCY= +github.com/aws/aws-sdk-go-v2/service/ecs v1.63.0 h1:ZeUDPcF93I5pE614AD8Le5a1e+383jjJ8lopM/WVfB8= +github.com/aws/aws-sdk-go-v2/service/ecs v1.63.0/go.mod h1:k5xD9wMxhUgcFU0Q1F1iB3YJkmBmW7+o4rrsBg8yhdc= +github.com/aws/aws-sdk-go-v2/service/efs v1.39.0 h1:nxn7P1nAd7ThB1B0WASAKvjddJQcvLzaOo9iN4tp3ZU= +github.com/aws/aws-sdk-go-v2/service/efs v1.39.0/go.mod h1:8Ij4/TIExqfWWjcyQy82/V/aec2kQruuyndljE+Vuo0= +github.com/aws/aws-sdk-go-v2/service/eks v1.70.0 h1:05FWDmYfXhHbsHxeFQIY73GagpjkcTgVe8VotlO62Fc= +github.com/aws/aws-sdk-go-v2/service/eks v1.70.0/go.mod h1:HKX0JNwYDW543nJozPRB0PS1bo8qAdR74Gava69dNg4= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.49.0 h1:zJY3lR0AdRuigAub2GQkIMz/TP50Ia6R6VruPgWBIxk= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.49.0/go.mod h1:CeEl4WwCPhtncasl9kdhSp1rigeO3HdVJ3hiPu6ZdZI= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.32.0 h1:x5N6Wy/2mP1fhS+xWzm+netHTbwMJy8zMFO786yVrHY= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.32.0/go.mod h1:L72prIIk4I4TMwyVXRtoOVkwA4PGaOzWHE8dkGSTgPE= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.32.0 h1:FO6LzHczDXByBf8+WJ5cswxaGy1EOjDVXA3NQa97Bh8= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.32.0/go.mod h1:q2K5uszrJv1SBxKYp5M9KUf7XR/Xnu38vSCiQ/wwhfI= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.49.0 h1:2VJj7fSoDawAjQ91u/DtrrUDOGsuMaWxcbe9Ok/O27w= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.49.0/go.mod h1:vJgvNz01VmSuXKzoUwQxQCzYklI/f09wXCWoj6TBGJE= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.36.0 h1:1F8KThHdWVMySPUAzlFbr4dHZCPxnUh0xWhzroseuIM= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.36.0/go.mod h1:tUWbqh4G+5bPwtn3noFemaiOphmiW2ZHs9+ETgAP2yw= +github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.31.0 h1:WUWDUubAtepFBqD/wWvejfep4pkFJeAMWqWHtEzKqFs= +github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.31.0/go.mod h1:tu9W2f8Uc606uWFnnJ31chJhFYzuBhnlAiwlhODst9c= +github.com/aws/aws-sdk-go-v2/service/emr v1.53.0 h1:rgBAS4KMAN6wNHtAuW2bOTyx6FyyXUu56ZajFC5LG6c= +github.com/aws/aws-sdk-go-v2/service/emr v1.53.0/go.mod h1:NEXNTLFLUFSXQ5VVZeVTthpxBR3l7VbjBrlnOAb/WvE= +github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.38.0 h1:N1i7XCvJKHgzndeebYdlNqc9LbOZs0LZIVgsxGuh7GE= +github.com/aws/aws-sdk-go-v2/service/emrcontainers v1.38.0/go.mod h1:IcV4x6tPgVZZiIFaZnv7VwasNR4m53Tlxr4/CNUxD34= +github.com/aws/aws-sdk-go-v2/service/emrserverless v1.35.0 h1:q9n5fiDdkpwpxEO5BatJs3j5Z+6hhN1++34kGHXDXqg= +github.com/aws/aws-sdk-go-v2/service/emrserverless v1.35.0/go.mod h1:3gM+RYyfJVwLiVmUnsNVWcLgQXDmrH1joddL7SWMgg4= +github.com/aws/aws-sdk-go-v2/service/eventbridge v1.44.0 h1:uV0/UBsNeT3NMmUwfQxxWZCglA1EDcAuXAuUti8u0Mk= +github.com/aws/aws-sdk-go-v2/service/eventbridge v1.44.0/go.mod h1:yX+96FURJgbIEv+9tAhlAayu551vVVZMD+yAro++VFA= +github.com/aws/aws-sdk-go-v2/service/evidently v1.27.0 h1:XWxvVnRKkG/a5r0A6P5oJyfxMsYBOsCAk2RJt3ebSR0= +github.com/aws/aws-sdk-go-v2/service/evidently v1.27.0/go.mod h1:k1YfbZV8p8ab9fjRvlUTjCgWrrvonTEFKCg7P2Idxhw= +github.com/aws/aws-sdk-go-v2/service/evs v1.3.0 h1:3ukR4hfyYEyuZkYQxXY9c7lTL/KEzRsbT6DHqryMTZc= +github.com/aws/aws-sdk-go-v2/service/evs v1.3.0/go.mod h1:7P6+h9cvKgq4qDOe58rsI//rxVXb0nb+bLwEkuLDxiE= +github.com/aws/aws-sdk-go-v2/service/finspace v1.32.0 h1:qt27hk3l7kDo0rUvRk5HfrYiyPiT4t8ne9NDD2U3V9s= +github.com/aws/aws-sdk-go-v2/service/finspace v1.32.0/go.mod h1:EpxiRnvkTpQfwgOxPdFEFGUxOT3heC375s5MFWHDX9c= +github.com/aws/aws-sdk-go-v2/service/firehose v1.40.0 h1:ojhEbQATCj/vrI5046jdKMktHDhTtzYF0Wp1VZelB40= +github.com/aws/aws-sdk-go-v2/service/firehose v1.40.0/go.mod h1:XklPdrzHJNpFs9Wpq6takjsBigK2VxxlpREcLSM8nnQ= +github.com/aws/aws-sdk-go-v2/service/fis v1.36.0 h1:zsDCgJ6lWocX4wArsCQre2A92JzBPKKW+2Mg6SOQVVE= +github.com/aws/aws-sdk-go-v2/service/fis v1.36.0/go.mod h1:OOOhb7pKoJhZKCVzheRRd+aPKv9Ep+zNUPQtfcoxP5M= +github.com/aws/aws-sdk-go-v2/service/fms v1.43.0 h1:tTeH6402fy5Z8JHuUO6aL2yn5WFzWSKF6epxYvIPAMs= +github.com/aws/aws-sdk-go-v2/service/fms v1.43.0/go.mod h1:YtgJpTqlpa7n71B9snaa05vHND7UbQyOHjU4zouPpUM= +github.com/aws/aws-sdk-go-v2/service/fsx v1.60.0 h1:whgqtOX1XdLhHidRX5EYA1VrY1qtb+/+eV7GrUSA1QY= +github.com/aws/aws-sdk-go-v2/service/fsx v1.60.0/go.mod h1:tUva+sOgmPwfMu02pXdg+zKO02Zcu812xG8doKd7ogA= +github.com/aws/aws-sdk-go-v2/service/gamelift v1.45.0 h1:JdlVzc51kIkdne4ilxnHAfKfXyhzkJ3eYrfZwk38j/k= +github.com/aws/aws-sdk-go-v2/service/gamelift v1.45.0/go.mod h1:j6XU2uooS9YUEfpviJM3f/TFtGlBh/yYHUMhO82XT3o= +github.com/aws/aws-sdk-go-v2/service/glacier v1.30.0 h1:GILchKM1cgGoIjYEYh3oV2o4Xy4v745NtPCo5WIhLFk= +github.com/aws/aws-sdk-go-v2/service/glacier v1.30.0/go.mod h1:yqs+luUVTNkd9iVIstDEnJ7j0XReWABgJmTDVIhxBGc= +github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.33.0 h1:iyNvCA8OSZDuSZktR0kPL2wZbuCM4X1g5R0TyMMmVLI= +github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.33.0/go.mod h1:u4X7GrZWh5nMBiGkJPJoNaDZQvjikjCoPTf7rg0vKpc= +github.com/aws/aws-sdk-go-v2/service/glue v1.125.0 h1:yhqWto0e2E7V+XtYOsHryl2/GH/ugQRecoap3Ddeom0= +github.com/aws/aws-sdk-go-v2/service/glue v1.125.0/go.mod h1:xDM3DkasatX1hkG/dHQjh5F/vAYL7fsvuas0SgofNc4= +github.com/aws/aws-sdk-go-v2/service/grafana v1.30.0 h1:q8igUjHYqbjskJxA5CT4uxCMEYD9i4uV2MMSd4PMR7I= +github.com/aws/aws-sdk-go-v2/service/grafana v1.30.0/go.mod h1:LYAjxQeHmDeDHajiAQofIQLFzUfioTLXNl79+9olIkU= +github.com/aws/aws-sdk-go-v2/service/greengrass v1.31.0 h1:3cELzkqYTy1EEn5kbr5jXfzVaW3ha+5HTuNe7053VFE= +github.com/aws/aws-sdk-go-v2/service/greengrass v1.31.0/go.mod h1:yHdROXdauuEdWsTTuOZ2MCkw1MC352BJvHbzhvHjOJY= +github.com/aws/aws-sdk-go-v2/service/groundstation v1.36.0 h1:aTtuwsQIMHjO9/FFeRvj5SQ7vbBlmFxHXhySY8TNavY= +github.com/aws/aws-sdk-go-v2/service/groundstation v1.36.0/go.mod h1:4t0gY0t3e/xdxDoCxIUEXZkhg+Mp503K64+cs/JE65A= +github.com/aws/aws-sdk-go-v2/service/guardduty v1.62.0 h1:y+d7el0K+Vy5/YcxYst6uIHHFurCw0jc0jN3eHEMWxI= +github.com/aws/aws-sdk-go-v2/service/guardduty v1.62.0/go.mod h1:0RpdeWC47aAKjRQhmFkWB7AU7acRQ7t3C3sox93F69Y= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.33.0 h1:oVJU7GYNUPjlJN8kv8E1BI0MrI0Zif57BZvXUAOIWMw= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.33.0/go.mod h1:nRqPmywyo+J7YWO/z4oq+qxn10C6IncV40ALIiQcMxY= +github.com/aws/aws-sdk-go-v2/service/iam v1.46.0 h1:bJgrqPT2vy+OrJpSeVfZ4e4zaD/EVdcq+5yxDtUOql0= +github.com/aws/aws-sdk-go-v2/service/iam v1.46.0/go.mod h1:WsQuuejKHNC3UWs+n4usF+nNy1DFGYgWRugqFf+gGD4= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.31.0 h1:Ho/jmeFRCaRZM0hoTzaOFYbV74nWBefREYVPn75AqRA= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.31.0/go.mod h1:K1K6uXkdxb7GDvUTVfvEkE75fDI2eY5ISyr77St091Y= +github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.45.0 h1:h1DzFDVG7/vPWsQVf8oQdgmWMleJU5gWt4OPZVnxxIU= +github.com/aws/aws-sdk-go-v2/service/imagebuilder v1.45.0/go.mod h1:hHqxHKHoCnne1DZS/GKsjYU8JoQUuWOCEIfFcuDzDLY= +github.com/aws/aws-sdk-go-v2/service/inspector v1.29.0 h1:rqaDVBRPXDmWIVu6RClCQiF2eoBCEjqCjf9YgRiFYH4= +github.com/aws/aws-sdk-go-v2/service/inspector v1.29.0/go.mod h1:9bew1fUtgB9LK1O+JGpkNxUcRO7Sj3O2GxlRd7G+UUU= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.43.0 h1:pwIs1giy/xJWUCT0dfAK7EHvAdOFohFHJDyOLvOiMfk= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.43.0/go.mod h1:yHwqyTje7gDZtLivPaXrk8fLAvT6LaM/XR1Fxxaf/hg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 h1:6+lZi2JeGKtCraAj1rpoZfKqnQ9SptseRZioejfUOLM= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0/go.mod h1:eb3gfbVIxIoGgJsi9pGne19dhCBpK6opTYpQqAmdy44= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.1 h1:ps3nrmBWdWwakZBydGX1CxeYFK80HsQ79JLMwm7Y4/c= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.1/go.mod h1:bAdfrfxENre68Hh2swNaGEVuFYE74o0SaSCAlaG9E74= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.1 h1:/E4JUPMI8LRX2XpXsbmKN42l1lZPoLjGJ/Kun97pLc0= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.1/go.mod h1:qgbd/t8S8y5e87KPQ4kC0kyxZ0K6nC1QiDtFMoxlsOo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1 h1:ky79ysLMxhwk5rxJtS+ILd3Mc8kC5fhsLBrP27r6h4I= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1/go.mod h1:+2MmkvFvPYM1vsozBWduoLJUi5maxFk5B7KJFECujhY= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1 h1:MdVYlN5pcQu1t1OYx4Ajo3fKl1IEhzgdPQbYFCRjYS8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1/go.mod h1:iikmNLrvHm2p4a3/4BPeix2S9P+nW8yM1IZW73x8bFA= -github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.22.1 h1:3jvrdU0UOGm8mQ7eMrbsbKErYn13xM2rJVe9t7QFfE8= -github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.22.1/go.mod h1:loi2iyY5Vs3EC7FI5Yp8TWUGZQC8flvpisZK4HQdNBs= -github.com/aws/aws-sdk-go-v2/service/invoicing v1.3.1 h1:ZqHny6zHB8yb3NT0Wz9vSIy5Zub1qcqrEAF1d6K3zuE= -github.com/aws/aws-sdk-go-v2/service/invoicing v1.3.1/go.mod h1:K4gG6tXdTb/nIFfe1R5jyW1JRsFORvFiRMDJkGNc9dA= -github.com/aws/aws-sdk-go-v2/service/iot v1.65.1 h1:viIWoxWPR4NvRHjRGQ2vOKYNzQST+JyPiipbeGPx/7g= -github.com/aws/aws-sdk-go-v2/service/iot v1.65.1/go.mod h1:0ogtONfjFzm7daWG4XWQhmpHkC0P0nTjoO7n4JKzb0U= -github.com/aws/aws-sdk-go-v2/service/ivs v1.44.1 h1:k8SgaBMH/3e3oRv5XyMS6qJAvKtc5/3xTjCSMlkaeFI= -github.com/aws/aws-sdk-go-v2/service/ivs v1.44.1/go.mod h1:Oobt8m2Ut1xg78QLmsw13wnSknC9PnFOmvgFcN3OobA= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.18.1 h1:KeOqEh9bzMzaRbjzil41SOu7UVcHmyPZ415wDhvpRVI= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.18.1/go.mod h1:MHSEX+9G3NOzzTPs/sP88KgGBc1MyJm5eleKu6+4IqQ= -github.com/aws/aws-sdk-go-v2/service/kafka v1.40.1 h1:RpJi/JcawCLe/3Gc7XLr6wJVeaLmfIUcG0VFdqJNVpQ= -github.com/aws/aws-sdk-go-v2/service/kafka v1.40.1/go.mod h1:wHKXRek0tTlaXyzoS24hGiZHD0Nv2sHdv8qV0JwWbvs= -github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.24.2 h1:YbmQuJfiHhvtz+KkoVTEX5EJP+b0iLTqtBd0eXL3N8o= -github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.24.2/go.mod h1:rCCQe2X/+/7Lco7w5rDuepJF4PeTEjMpSJ0jpwOBSp4= -github.com/aws/aws-sdk-go-v2/service/kendra v1.57.1 h1:hJ6rwXUwlPbo+KtQFC+8DPRLLDAm9nLKwK89g1zeBq8= -github.com/aws/aws-sdk-go-v2/service/kendra v1.57.1/go.mod h1:SnU/DUXKZxP2o/WIKJZVa0aRsb4sSN9W2C2mI8hdvIA= -github.com/aws/aws-sdk-go-v2/service/keyspaces v1.20.1 h1:2Jhdp2Tt5zK+fYYtGvZSIUBJKTTOwR/dYFCbvwHTF4s= -github.com/aws/aws-sdk-go-v2/service/keyspaces v1.20.1/go.mod h1:r8yQore6pt2Qd5xYUha+USf7u0iRsRHJh/4gDB7jg/o= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.36.1 h1:rs+doEUMM7TYDQCm8hse37Nc8RtaOUR3L9yn72cYGEU= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.36.1/go.mod h1:4b3rDh9I9qfJ7otpn9F/QPplu8P70X3QYujWfsabPrU= -github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.27.1 h1:HJ/Yqyc+z6yPznLf7HTB2tnnCuV40KJEjwPBKPdIoLo= -github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.27.1/go.mod h1:lF63nbQGTaLvFxfl25+flfgcLy+TVUT5ACG8NQkdXbg= -github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.33.1 h1:IUTnaFqzwDoCbbT9dChPffQUwwwNplP9ZMwdVD/zzmM= -github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.33.1/go.mod h1:t8Gl3+K/J7GWoyTEkBF+ehVUIGP67o3OUiKnssQINBA= -github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.29.1 h1:UdzvaZQ7UgNPiWmk2yU9281DsKm1kGUyVAY3wZhZf2s= -github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.29.1/go.mod h1:FrPChe9AimOwPREPAMrmE9ZPJQY7PLxFaeg7QXHxKD8= -github.com/aws/aws-sdk-go-v2/service/kms v1.42.1 h1:YozphKGMWbikYX1H8Cjmh+QUboGA1c/D48m1pBosDmM= -github.com/aws/aws-sdk-go-v2/service/kms v1.42.1/go.mod h1:I/6K08h6XpKZPzb1jMZb1k5N6HpzLyjS4Z0uBFzvaDc= -github.com/aws/aws-sdk-go-v2/service/lakeformation v1.42.1 h1:4CyftMR6RY8OcqPXevgS1DOwiSwYwgTcLK2cdUcVZCo= -github.com/aws/aws-sdk-go-v2/service/lakeformation v1.42.1/go.mod h1:K9YPr/AqAVkWctfBvUQA0cx1rWVhmLK40TuVpSP5f2Y= -github.com/aws/aws-sdk-go-v2/service/lambda v1.74.1 h1:UOf0eSkWmna/6lR+tOwJYJaTSJsA/WFYm86nE2VPklY= -github.com/aws/aws-sdk-go-v2/service/lambda v1.74.1/go.mod h1:6wi1Ji6Z2WhSfVVrFj40GbWCX+cjaCEaTuCXnAVFytM= -github.com/aws/aws-sdk-go-v2/service/launchwizard v1.10.1 h1:UHzprFuR4wfo8uRS3L8v+dgKeh42yksH1B3hByojDcU= -github.com/aws/aws-sdk-go-v2/service/launchwizard v1.10.1/go.mod h1:jvg+B3ZzZjLCMUBKdLCpEIZv5Mz/QqPyWHlCUlQXxjg= -github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.30.1 h1:ZdNwKDTwPA1Bei71W6Q57HdTrAGWTCJEpKD24/r0Avo= -github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.30.1/go.mod h1:uYKKga1apHlzaH5HG+Y52OKjXLTJsC0HQ4+XTBkM7qA= -github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.53.1 h1:1qKrJXGcgICGlJ1dwlvOHS2gutVQpdBdYweO+spMIAo= -github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.53.1/go.mod h1:IQdDJQwO16pmmylU4iIgbgBSNk5bPhlUnuhsl5HhfS8= -github.com/aws/aws-sdk-go-v2/service/licensemanager v1.33.1 h1:BpPBMw8QekkoJpH34s/XYoNpVtMr7QTpDNcxQnMOvhw= -github.com/aws/aws-sdk-go-v2/service/licensemanager v1.33.1/go.mod h1:dSYHIVdITBrd19X2U36SemcuPoX7Mtxif3YjBSgKGa0= -github.com/aws/aws-sdk-go-v2/service/lightsail v1.44.1 h1:szsDy+Jx8LhOvlyqJfGzho4sPxist94khUm4QwTG+cs= -github.com/aws/aws-sdk-go-v2/service/lightsail v1.44.1/go.mod h1:FUyjCuISm1KKO++ZK9Lc251IfdJXZBRKo4cHCZa7RcI= -github.com/aws/aws-sdk-go-v2/service/location v1.46.1 h1:rWsI4OIvYu8fMV1KbccxlpTKWcQEPk1YKWiUiRLfNgs= -github.com/aws/aws-sdk-go-v2/service/location v1.46.1/go.mod h1:ZW2qOTqxIPQtuMLv7nj4WS+h4utqLoaNzDmCfgeqTNg= -github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.33.1 h1:/LIKKQyGfyjLElsw12AAD/b4T1gjvCRpo9PWXFBXG1Y= -github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.33.1/go.mod h1:Pw2uocVTqdNrapt5q/mtamq/+D57zWgIx3U+rzGc6To= -github.com/aws/aws-sdk-go-v2/service/m2 v1.22.1 h1:tFiMPcBLb+/33azrdMA2hqqc15D+h8H7mAI70dhuKLI= -github.com/aws/aws-sdk-go-v2/service/m2 v1.22.1/go.mod h1:HumPBe3ugDYqq08O7tsa4etAg05gfPRJCnXhVlmUR94= -github.com/aws/aws-sdk-go-v2/service/macie2 v1.46.1 h1:KEtnVAAkIZZ8/G6IKWxyaGKQBMaq9HetTD0QvPfcO4g= -github.com/aws/aws-sdk-go-v2/service/macie2 v1.46.1/go.mod h1:yMp0gljSvRon61sIkFuvhEocyO/YhPgCkwC/BR9t02k= -github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.41.1 h1:taLUiA6Yq4G+47P/wKx4c0DJvCeb7oIP55hjjd49kXA= -github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.41.1/go.mod h1:SebyqBabeN7s4OeaWRueG654W6sLdfCpx/G1sPuIEls= -github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.78.1 h1:ILaU1jUkOz1RsqmpUHv1sha/112LGVCbWMbOj9KdG1U= -github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.78.1/go.mod h1:RZLbG6qHRZJ6IlYG0dBVguA5Q5bBL6KwegIN9nzvxGs= -github.com/aws/aws-sdk-go-v2/service/medialive v1.77.1 h1:OXrgpZTIzQDjkXXBy/RQKVqF91IwyC0ryEw+erBjMzY= -github.com/aws/aws-sdk-go-v2/service/medialive v1.77.1/go.mod h1:56LdU29xEz15jYRBxzt8valuQ/2GQDhuftdNowx39io= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.36.1 h1:6sqsETpJLgYGK8IWAd6MX47sCAyqLvPuRGLoENO4sYQ= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.36.1/go.mod h1:zFu5Y9pAUOvd9APBDiwwaMdexPv8coEizOtJmcTTVKY= -github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.27.1 h1:FvjHODeuJ7LCmlOAB1hVQIFvOQyORIVuDJfi3+6R3oo= -github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.27.1/go.mod h1:H5n6sQyEZPmFcdU8XSh8iIh/oR7PeJXBKL2TVyAq4Yo= -github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.36.1 h1:AQ2g2KbJsfagdo2CwQAGINtwFhDpFo6U6NE/BP9ft54= -github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.36.1/go.mod h1:C/K0HedKYyj/az2xaZz5yWoi9vv6hpRTcPjCHk7jkTg= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.26.1 h1:vqr5cfKyoCtj3FJXYnHpZ/svnPUQ2Qce3wiX2exVKJU= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.26.1/go.mod h1:udUYbqmxEiWg4Pe4v7CoSWSZdVTjjbkvcnUKSY0ANM4= -github.com/aws/aws-sdk-go-v2/service/memorydb v1.28.1 h1:RlrxrWzRLmhIchnmXnBvzuklCur+mEuYJQ670y1YjNI= -github.com/aws/aws-sdk-go-v2/service/memorydb v1.28.1/go.mod h1:dn0CuzrlLsPQwdmrfd/7GjJxMTXiQX3/cYyYPw/cBU4= -github.com/aws/aws-sdk-go-v2/service/mgn v1.34.1 h1:mcW3ZmVS/c/al7w6/+2ren1FM6ZKsQ5OkffMODe8Yy4= -github.com/aws/aws-sdk-go-v2/service/mgn v1.34.1/go.mod h1:f5LNAteLLvz1d+a8udEyicskowMJv3tClJnA7H2DrHs= -github.com/aws/aws-sdk-go-v2/service/mq v1.30.1 h1:O9duS6XPKgBYv0JyqNXEjRb0Zp+DJdEqh/P1sTTFL9Y= -github.com/aws/aws-sdk-go-v2/service/mq v1.30.1/go.mod h1:uTgClBQfeUtsIdBJCbaf1xjtE6jCxGiMJSXHsi8WEAM= -github.com/aws/aws-sdk-go-v2/service/mwaa v1.36.1 h1:TptI10con5UPABjYCBMaBckWD5/gNMYD0m+88NkscSo= -github.com/aws/aws-sdk-go-v2/service/mwaa v1.36.1/go.mod h1:3pxCY9yQHuj3mntGtK5IR0HADRhEP+lWTOmg74n5ZR0= -github.com/aws/aws-sdk-go-v2/service/neptune v1.38.1 h1:NOYfXtQUnF41UakvQFfi4+mbgZ/4IgO1n5j8RMsIEfg= -github.com/aws/aws-sdk-go-v2/service/neptune v1.38.1/go.mod h1:+12tTJOR1ZRkMm1sBbwxbUJlNh2GRIam7Lc7C/+Pa94= -github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.18.1 h1:wIRxcq1kp678ogQ67us56SmBEr3JntDmtw0hzSnQIWk= -github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.18.1/go.mod h1:lF2OHvTjVdVU8fqeM/Cw7SMO8TWt515zlBFxLjzKEN0= -github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.52.1 h1:iMxoDME9qFjS6TOIYE99yC1ocnYfd1Rw8IMvgbZJBfo= -github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.52.1/go.mod h1:k2KrxH4IGJZsA6VI8CsTx+mGKEkxpbXLRl9XKTcqE2I= -github.com/aws/aws-sdk-go-v2/service/networkmanager v1.36.1 h1:Ps/spyjORK9/tx2pMpEzEjWOYqoNqR8OMHIXHudzvKg= -github.com/aws/aws-sdk-go-v2/service/networkmanager v1.36.1/go.mod h1:2QEw0rfjtUMjqiHcthI+GdvcHZ935TenF1UQyj++Ehc= -github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.9.1 h1:BdxoAPeLCPbrYHC/osQftQUzW2hkI5yIl36/iEQboXw= -github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.9.1/go.mod h1:ZlR0Ioqx3FHzSvPMLGWRJl7KG8fswWTTaBrZjixWhng= -github.com/aws/aws-sdk-go-v2/service/notifications v1.3.1 h1:W/V33HIpFFm3SEczC5rNTSk0oLuCZJiCRt3ftI+OfzQ= -github.com/aws/aws-sdk-go-v2/service/notifications v1.3.1/go.mod h1:lcT7GSBMHxkYhnvfrJ8KASTffPmVmwUVIXQA0+FQR+4= -github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.2.1 h1:P9vU+dUkH9J6NR8K1FWpuGCUrGYqPkxj97wDZI2cpYU= -github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.2.1/go.mod h1:M2m8kz89mBvwsJ3sHJ/sAniRFqQh2U2eQgj0Xcdgi38= -github.com/aws/aws-sdk-go-v2/service/oam v1.19.1 h1:Qy3Z3Iec62/ZQxeOtNMfGkW+0O+h4m1jlfpMG2v7Jqc= -github.com/aws/aws-sdk-go-v2/service/oam v1.19.1/go.mod h1:SELnx5vYtclgFgk0qAUuW8gPd9QaGGvn9J0gLLAN/qI= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.48.1 h1:5waSqIHB7r2/kPEUokYOCbAj94O86BMNEUdt0q5BsqU= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.48.1/go.mod h1:2MLCxAIIw9nb59dvYANZHyhoiOMaajJtKlBqvnyWg0c= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.21.1 h1:mbkX8wApJAaoWpV0V0EgnjN1/sI6ymNqQGPE+nakSP8= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.21.1/go.mod h1:C0qtSLUYGv6qGGy3nHPR7T4ZrsBA9/dcMDcov82uoK8= -github.com/aws/aws-sdk-go-v2/service/organizations v1.40.1 h1:9u1hD7vW7BjOxiCmE5TUDvyGk8sZiI6nTHhbUW9npPY= -github.com/aws/aws-sdk-go-v2/service/organizations v1.40.1/go.mod h1:pEuSCVYuJKZHwfkIkbO4Xa40lgUlVxWCiLJgckMppXo= -github.com/aws/aws-sdk-go-v2/service/osis v1.16.1 h1:Mfng5L3nO4JB4PCHqUUWIFgaB40DrMrkAb60hKnSP/o= -github.com/aws/aws-sdk-go-v2/service/osis v1.16.1/go.mod h1:AU8G+nH8NIQKfX1ibliZF+qoe4EwQ071UDRABz9X+Os= -github.com/aws/aws-sdk-go-v2/service/outposts v1.53.1 h1:NXHJcaJajCUFbim84eVwhFHCwUzp3BuGKP2ZACbF/oA= -github.com/aws/aws-sdk-go-v2/service/outposts v1.53.1/go.mod h1:xjh3+zMePLINjP5HtXTCkbKcnF4Ijet/c9yOCuBGxzA= -github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.20.1 h1:AX6HWyE3hshMWlMUGzZQ+dMVNaa2f+yJ8VIEnUKbsQg= -github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.20.1/go.mod h1:fPpm6h3keIbLil7fhZ0W1lLDg9DrfYHVans55yzlFyM= -github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.12.1 h1:IZ2DReKRxTvXr2RGhcB/z4DJGesXSfMvY5vSGycCEGk= -github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.12.1/go.mod h1:ySW1vL+f/079GdqHIx7tOSP81yiB1Z01uKdtNlH0eb8= -github.com/aws/aws-sdk-go-v2/service/pcs v1.7.1 h1:KSAs6CUxcS3ObH0aABXu6lpAdLGYd+KaDO4MqZ8uwpk= -github.com/aws/aws-sdk-go-v2/service/pcs v1.7.1/go.mod h1:06QcV8x3XG2rejuINX53oYb1+owkCEY0wW0orumnvOI= -github.com/aws/aws-sdk-go-v2/service/pinpoint v1.36.1 h1:7vBcJCy6iXGagB8Z5zaRpF49H8nd3TVdVxLN5DrYYAs= -github.com/aws/aws-sdk-go-v2/service/pinpoint v1.36.1/go.mod h1:D6qGC37YHDdlcGgNc9RA3++WTdWNRNq5gQP00cHFUQ4= -github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.21.1 h1:tzp5DSj5QSMDMSxr9BpxuJBocueIQJ9bFnmaa9kZuLQ= -github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.21.1/go.mod h1:Fch5jvGSwyCbJp4xaqnXaGAtbA0Hp6WWnTjN5JzRzts= -github.com/aws/aws-sdk-go-v2/service/pipes v1.20.1 h1:M1knm5Myge9U14SLwnEuJ/jMjnn/vVfk7CYCQd7H0Mg= -github.com/aws/aws-sdk-go-v2/service/pipes v1.20.1/go.mod h1:fi5webS7jgREIhMVEK9HcI1lXGzhyKf0l6JlgaQ4UZs= -github.com/aws/aws-sdk-go-v2/service/polly v1.49.1 h1:g4JAX2yxmN9iJSE42TGR5GnionKpizF5IGqRdkw0aXA= -github.com/aws/aws-sdk-go-v2/service/polly v1.49.1/go.mod h1:meOGU/2EvK6KAjTy4wey28iXOXOkMwYCw+jIQ3+7Mxs= -github.com/aws/aws-sdk-go-v2/service/pricing v1.36.1 h1:LDR5vJNnAVqg9bZBI9sqSEpjhPGVelVFkxUwdvD6L2s= -github.com/aws/aws-sdk-go-v2/service/pricing v1.36.1/go.mod h1:n6r5jWgZaSRvoEp+hVB18QPHBdlAnqu+nI/vaZXcZ4A= -github.com/aws/aws-sdk-go-v2/service/qbusiness v1.29.1 h1:UEg5RyOrwwTgO3pEPVkBOZBhlZjGiVTJlLzUJcXLKQs= -github.com/aws/aws-sdk-go-v2/service/qbusiness v1.29.1/go.mod h1:RbC8dW2YmTMAE9jWWuOw1imZjbGQXbzZs3i/XzmhZkc= -github.com/aws/aws-sdk-go-v2/service/qldb v1.27.1 h1:M0bDQzEES16it3M8iwvYw0JYWSHtAELprn66MS8jjBo= -github.com/aws/aws-sdk-go-v2/service/qldb v1.27.1/go.mod h1:UCoQ1I3GDheCu90XJjXyvO/v2AUFTwLER6h4QmvSego= -github.com/aws/aws-sdk-go-v2/service/quicksight v1.89.1 h1:HieaRkHHAJWegQxuuWm3duxdEuiLQBHnApCkfMGVLH0= -github.com/aws/aws-sdk-go-v2/service/quicksight v1.89.1/go.mod h1:YQlQUXV3sa9nZR2W2DyrOVHoLoEDUjcoqe3vGgYTPPg= -github.com/aws/aws-sdk-go-v2/service/ram v1.31.1 h1:DZ1qMqkin2aoXDI9X4G48hufZ5Unag/11WmDgIEN31w= -github.com/aws/aws-sdk-go-v2/service/ram v1.31.1/go.mod h1:EtWvsAzhCnrUB03jgf70O8Sqi5gmRUQsFExhChPMI3U= -github.com/aws/aws-sdk-go-v2/service/rbin v1.23.1 h1:MuUdwoKOOY+H54Fb596ADns1ug2qM9QxGUIsgZshhVQ= -github.com/aws/aws-sdk-go-v2/service/rbin v1.23.1/go.mod h1:Gs3msPhLk/QQjEfCDK3iZXEOJltg2JyQJMuQ0hhvFLk= -github.com/aws/aws-sdk-go-v2/service/rds v1.100.1 h1:1QZUBDI1zr0RrVorJMgtgs2heL/23IxiKM0eRdW48Cc= -github.com/aws/aws-sdk-go-v2/service/rds v1.100.1/go.mod h1:7xLgcsUoy294mtsJFC+1/lZBwkZRuhb6Tnr2X/AOrl8= -github.com/aws/aws-sdk-go-v2/service/redshift v1.55.1 h1:g2AXKrTkVjnWpYXBXJ00lU6NaU849/jIIRxLVo10HGM= -github.com/aws/aws-sdk-go-v2/service/redshift v1.55.1/go.mod h1:GGQqtUubSmvzcr23P48Qkkv2auTeatL67pL9SO6/b14= -github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.34.1 h1:4+OFVGzIg6JcwbR8FKtYdC6AuSg1jV11Hk3RIv6y2oY= -github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.34.1/go.mod h1:heOxElSAAGnh+jfAH0hK9ilW856kSFYBlYRJS5QKbm0= -github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.28.1 h1:Tybcb+WE3hbjkF3kfkppyS6qRigIZwlPbtnFdMN9Hvg= -github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.28.1/go.mod h1:PD4779i8tDuTz0p6k1XSZTF2RrepnIGeZOTCmuFhFOA= -github.com/aws/aws-sdk-go-v2/service/rekognition v1.48.1 h1:MKivszAL8Z3w1hzxV6peGzSQsSekbrYcUaYS0IxjxbI= -github.com/aws/aws-sdk-go-v2/service/rekognition v1.48.1/go.mod h1:cKS/VXrV5GDM0JLURHffLzC17fm3luMz/6XPH2A92fw= -github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.31.1 h1:Y6aoFAl88KNul8+otRs+DRKmp9FUEhWtCpyox/VkZzM= -github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.31.1/go.mod h1:Z0BCXb/w38nvM+lPuYMGXuOHFgKl1y+MY11yzW4WprY= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.18.1 h1:Ocp3eIEr9gyd7YunIdPRRDOAw+bm622Ys2rrw/Iylps= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.18.1/go.mod h1:RGYowXd4xqI/xxZdNyvk1b4lO43heRlHt5hvFQgqT8Q= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.30.1 h1:KhIp2JHWuSUDXyJK7PDfAr30cko1YKDhbE6O1byejkE= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.30.1/go.mod h1:2zyaohdBXZBnLMMXhx0e3cd63JycCSl+X9YFNHP7gtY= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.27.1 h1:dGw/U6NbhnWoW2gw+75/AZvnYjFuxYRtzUpxALoRhLc= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.27.1/go.mod h1:ZNIISn1QONFDUbTmkIK53IBTrGn1TbsrBH5pG/BCwew= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.18.1 h1:CS6N35VnEJGpPbXUoQEm0LBA/uDpTC/jfrAkkNsbjEo= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.18.1/go.mod h1:tlqfSYOwnjSkzCp1Oc5dT44TX1bvy1SchvixKOXPvTI= -github.com/aws/aws-sdk-go-v2/service/route53 v1.54.1 h1:DvwcqU6ec5NNCACSSEYKuTg9J3PDFFlngkwV0k7wvaI= -github.com/aws/aws-sdk-go-v2/service/route53 v1.54.1/go.mod h1:POH50FEbIpazXJUVj2hbpJT819o2UF547G+BJBM7HQM= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.30.1 h1:+0csOL9MiuIxe57+7TsHl/yzxIT1Jf0ai6qnp1bXGoA= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.30.1/go.mod h1:EbsE1mwREHAclraVgQhu89uyy2oE/C1ETLghnTE7ghs= -github.com/aws/aws-sdk-go-v2/service/route53profiles v1.6.1 h1:OjU8qqebap7OqDkLU0/70sQ3LBxrR+kxzj8b+3aLJ5o= -github.com/aws/aws-sdk-go-v2/service/route53profiles v1.6.1/go.mod h1:iTrcT7Arr04ilWo5huHKWP2Z+j9S5aRyZvuomlckusw= -github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.28.1 h1:P5ZnN/WfxPJ0lD6iZY0TvXKViw2U3m5LIs9pMCOvUH4= -github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.28.1/go.mod h1:Ng+ThDA2vsPOfe5nYvmWHMuCy8d4c1Jty3vLJ29fKF0= -github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.23.1 h1:AX9S7S7hvb4UJKIgZQ9SJ84LjTF3/fF5SBYjyu9/c6A= -github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.23.1/go.mod h1:pbDtCWqLwS6CyyTiOpZVRtv+O/Es7VkhhLWbT9zMEas= -github.com/aws/aws-sdk-go-v2/service/route53resolver v1.37.1 h1:mp3ADBMz3nLgY4k9bNUrID8kB8H3WoyNGKTV/TnGs/g= -github.com/aws/aws-sdk-go-v2/service/route53resolver v1.37.1/go.mod h1:nQNdcvkdveeChWT7i/0yD/vFsttMOqK/VbCOcsyx+E4= -github.com/aws/aws-sdk-go-v2/service/rum v1.25.1 h1:IPGVJBSdfbowzlpJ2WamBS6X5bbIG22VjWp961JEkoI= -github.com/aws/aws-sdk-go-v2/service/rum v1.25.1/go.mod h1:bP77oXsN8c23i7o1A46SQmqlmuslx4OmYtX2Ns4p0R8= -github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1 h1:Hsqo8+dFxSdDvv9B2PgIx1AJAnDpqgS0znVI+R+MoGY= -github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1/go.mod h1:8Q0TAPXD68Z8YqlcIGHs/UNIDHsxErV9H4dl4vJEpgw= -github.com/aws/aws-sdk-go-v2/service/s3control v1.61.1 h1:Fu6ZEW0t68B6Tjp/ubiOBa2OCRx2sHnRl1/1ehRU1Hc= -github.com/aws/aws-sdk-go-v2/service/s3control v1.61.1/go.mod h1:E6DME7R1bQBJaH/dIS2070dgcgba97shJWUTWMrTbgM= -github.com/aws/aws-sdk-go-v2/service/s3outposts v1.30.1 h1:iOFQNXtgNsVQjQLJQTvGC5NsIv43fW07igtoDHEIvKs= -github.com/aws/aws-sdk-go-v2/service/s3outposts v1.30.1/go.mod h1:ANvlkElAoLD7KBmZAXJv+BmB42Ifw8DhKb4eEhmveMA= -github.com/aws/aws-sdk-go-v2/service/s3tables v1.7.1 h1:Shyve/4zbd4pdKluYyXtcrBoZ1Olwodu/lbL9Dc6xOo= -github.com/aws/aws-sdk-go-v2/service/s3tables v1.7.1/go.mod h1:7M+LyYRRMZQOXS/7SbLOFKuFPp4+SsqDMmyoxzX8YGU= -github.com/aws/aws-sdk-go-v2/service/sagemaker v1.203.1 h1:jjitDItJQ3kdF5Jtkr1JMQ2Miu+X1axdpv+uJmU5eu4= -github.com/aws/aws-sdk-go-v2/service/sagemaker v1.203.1/go.mod h1:VTFTvNY3kYVqdwZBTRSfnqQBBuBGtRjUSOFGIHDy4AI= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.14.1 h1:Q2mO7GN5wcU4HVWXLT3Wwu317fiAwkiUoq0QeiqsZBY= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.14.1/go.mod h1:3Fdk8jqhTM6Eivjt0v6HBIMarExmWKnXEaUFhogCVSc= -github.com/aws/aws-sdk-go-v2/service/schemas v1.30.1 h1:AeR1HvScTM6v8FIL5ONZhOKxdiI+QJH2L/RGmg3vTEE= -github.com/aws/aws-sdk-go-v2/service/schemas v1.30.1/go.mod h1:RNx0SkALkXNDSJKm/I1cAMmUfdTKB/KHIq/ddWG6tvg= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.36.1 h1:fnOIjzwTVrtVnkRef3Qs+uTr3qYKwXuFom5pqdZERNQ= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.36.1/go.mod h1:/19D53IxSX9W8uu5bo0t89oCLncvNP68V1KiRthhLd4= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.59.1 h1:q/3LLpo4PcoM2GUTyE1GMiEtDekkuKjtqD9mw6K+g2s= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.59.1/go.mod h1:vZ92NituujfniQ/4SuNBn87qTvD2mNreUhaR3Kscm8U= -github.com/aws/aws-sdk-go-v2/service/securitylake v1.21.1 h1:/RKW3AGx4P4zBoiBevP9omqR4nawRTFcIaSX27l4fDE= -github.com/aws/aws-sdk-go-v2/service/securitylake v1.21.1/go.mod h1:NamZRs6fW0/J8Di0CqJXRwbB58f4xVPNTfohMxi5lB0= -github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.26.1 h1:G00kAq1ULynJ5Sl4yBoa+7CKd35YVJj4nLMl8s0OXsM= -github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.26.1/go.mod h1:l21Hlsg40fSBVz2QqhI1+w0iSmJ8j35V6pxsp+4rne4= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.35.1 h1:YnjdZk67nAaojegCz1QfvCjW6KxXRDbs3nONIaKd7R0= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.35.1/go.mod h1:ErWa3lU2aQKBwkdbwpccUW2nodv+S1Fn/R4bU7Rc18g= -github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.32.1 h1:bqfWM2gefpr4FOCZrEuKxV9LQdxKkmFBSxyAbeDoBj8= -github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.32.1/go.mod h1:TQJFC/xYbI6XAHE3Wz8GV63G0hEjlZzqtSCD/+DcjFg= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.36.1 h1:EqupyVMtt84ZljchBzq+X+pPwuYhUT7dzfBoDqC0DB4= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.36.1/go.mod h1:HrkmhW8FU7GObElHC6Lm3sosolbig21w00VOm77Vsss= -github.com/aws/aws-sdk-go-v2/service/servicequotas v1.29.1 h1:woOK9lW27mtpdERfmnV9DFdNmYBKZv0W+DbSMB7c8DI= -github.com/aws/aws-sdk-go-v2/service/servicequotas v1.29.1/go.mod h1:Bfj6o/QIVdpFkd95vGIY3fTEaTJZpu0vks/D8VKwLnU= -github.com/aws/aws-sdk-go-v2/service/ses v1.31.1 h1:hi11Ld0VefrexMU5GL7/hNKzm6eplrSF4A3xe0S0M0U= -github.com/aws/aws-sdk-go-v2/service/ses v1.31.1/go.mod h1:YEsycIZqO487LztPmM2Q1U/g0ynw7Zj7zSD4Jt79SDY= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.48.1 h1:IxgjwuZ/AGKFFYU6yYT8rZAysL/4oSPEwtfUgQChv+w= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.48.1/go.mod h1:GvobvR4QPd7vuWZIyvKyRUddjjSKkUHqYa8aBfpIKh4= -github.com/aws/aws-sdk-go-v2/service/sfn v1.36.1 h1:VEOUJkplqcaFW+Z3ZOFSWSVsmXVs10SFxb3Y6IGX+bc= -github.com/aws/aws-sdk-go-v2/service/sfn v1.36.1/go.mod h1:bwaYtZOogLKo3c/rpHpBQe7vnoieV5rQn+nQ52HFaz8= -github.com/aws/aws-sdk-go-v2/service/shield v1.31.1 h1:xVThf6EHHHIacded51XqxPMEnmruw/VXtrtbMim26Zc= -github.com/aws/aws-sdk-go-v2/service/shield v1.31.1/go.mod h1:Gr5mZJ4DgXyZBskh7KgfNUb+zqhywkI4tOizNK0ado0= -github.com/aws/aws-sdk-go-v2/service/signer v1.28.1 h1:9LIObcOOXWwrT3fdo//lXO5evcqhkzzFLpqkdwcg3/Y= -github.com/aws/aws-sdk-go-v2/service/signer v1.28.1/go.mod h1:L2cwuhZJxxw/dvQJLkkUW3iTBWAoHC+8EyI/14imqhs= -github.com/aws/aws-sdk-go-v2/service/sns v1.35.1 h1:rXYKNcWkL86HT+vbkf/3YSCFCoNFcUlyFJp78dF36Rk= -github.com/aws/aws-sdk-go-v2/service/sns v1.35.1/go.mod h1:el2B16jJPkZCHv7NcBt3uf/JLLt0TBxcHcsjsyG+L40= -github.com/aws/aws-sdk-go-v2/service/sqs v1.39.1 h1:fkHJs2m1rKVBsE0n6tKi988JhpOMIu2MO2ZIHQQfeho= -github.com/aws/aws-sdk-go-v2/service/sqs v1.39.1/go.mod h1:uo+sko7ERytamU7kYji04fBiMbPAgTHxzr0MX7KznO4= -github.com/aws/aws-sdk-go-v2/service/ssm v1.61.1 h1:Pu5hveFc6RslFZP61W5SEMOoPd6RR2yrOu11ZxCkr+Y= -github.com/aws/aws-sdk-go-v2/service/ssm v1.61.1/go.mod h1:8OOmGP4EK2O8eJIKIgTUXTfznuhC1BBarYzb+B5ep44= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.28.1 h1:1H1jDOo0680oHHo25w2z5zhQ18anlw3iyGBHEQ4KnHM= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.28.1/go.mod h1:20JJUbKRkWn+Ln9Xt8J3U4IfpM8Sbb0ks9KoQmgIGPA= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.36.1 h1:1/T3AGKsL3mUURd6Dk0qJa2Pgmeqx6ZjpY+cM4iHcX0= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.36.1/go.mod h1:a9gXJaVGkxv3DRJd9ZafQSCBaoBDSYOQnNzshN869gM= -github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.5.1 h1:kpAZB/7E8vcJabxjuBgOS14H4vew0vpE4/OXyzZh4/U= -github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.5.1/go.mod h1:5Paze51it1WMLnEuoMWZhJeXxAUThOdl0LNHqbFkVmY= -github.com/aws/aws-sdk-go-v2/service/ssmsap v1.21.1 h1:qHmgtw+6t+U3HoGEfBGRlnWyWH90u7g4yNT5r4YSBHQ= -github.com/aws/aws-sdk-go-v2/service/ssmsap v1.21.1/go.mod h1:dls7w/cdUdzL0r0oCbz/zNMtnuBNIayq2wDDYr57Mmo= -github.com/aws/aws-sdk-go-v2/service/sso v1.26.1 h1:uWaz3DoNK9MNhm7i6UGxqufwu3BEuJZm72WlpGwyVtY= -github.com/aws/aws-sdk-go-v2/service/sso v1.26.1/go.mod h1:ILpVNjL0BO+Z3Mm0SbEeUoYS9e0eJWV1BxNppp0fcb8= -github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.32.1 h1:Wqti4CxhMVIQU0ucF/RSIhgqy8i7jO/kX+s1uw73YH0= -github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.32.1/go.mod h1:TbMaMLH88FDGdgBJ/7lbx0fiUP/Zz0QloIaATlW8e2w= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.31.1 h1:XdG6/o1/ZDmn3wJU5SRAejHaWgKS4zHv0jBamuKuS2k= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.31.1/go.mod h1:oiotGTKadCOCl3vg/tYh4k45JlDF81Ka8rdumNhEnIQ= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.39.1 h1:O5zyb5Nag2fUvcIXMK1v+ZXWaPFCoPmqX6WAR0Jmsno= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.39.1/go.mod h1:AQSOz7HtJBbLMExu5ftB5sN8B9ZaHE00Rc/8P3MPpjo= -github.com/aws/aws-sdk-go-v2/service/sts v1.35.1 h1:iF4Xxkc0H9c/K2dS0zZw3SCkj0Z7n6AMnUiiyoJND+I= -github.com/aws/aws-sdk-go-v2/service/sts v1.35.1/go.mod h1:0bxIatfN0aLq4mjoLDeBpOjOke68OsFlXPDFJ7V0MYw= -github.com/aws/aws-sdk-go-v2/service/swf v1.29.1 h1:3MokmeLAz3SAzZW/PT3+QebJYVUtzNDpHrSpO0SQtPs= -github.com/aws/aws-sdk-go-v2/service/swf v1.29.1/go.mod h1:KBITTXjOcUqvzGilyMCW/lLL2aLTN6PxS+OxMJsoitw= -github.com/aws/aws-sdk-go-v2/service/synthetics v1.37.1 h1:bWH6tBabdGAWbpbV3FFukqUlY54I6jjzHHQWE/1YJbY= -github.com/aws/aws-sdk-go-v2/service/synthetics v1.37.1/go.mod h1:BedpiqRrnMFzbm/g8ZuUnA1/TjAzT475hVNpUiNWpaM= -github.com/aws/aws-sdk-go-v2/service/taxsettings v1.13.1 h1:1LsFNUBiAu20C/+DCTw3uhTmfgrenBJPGzNo5TkKPro= -github.com/aws/aws-sdk-go-v2/service/taxsettings v1.13.1/go.mod h1:5WaC771ktHDgK0787PVcUQ98ptYdxmYTCK4ymuQC4OE= -github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.12.1 h1:izKMjMihlIJdADsWKFDu2Q3epWiT1ee5w2fHnvMQ80E= -github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.12.1/go.mod h1:Sbgai5mZj8POGBYyMxpwajp6PNHF2lf/i5oLv3lI9qo= -github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.32.1 h1:TZ2ntXpVhqDub8hqOZnMJBFNETeYoFvy1gfTaIWB9vE= -github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.32.1/go.mod h1:FSe0ILWhP9eujXt5nq9j3MkDDeLs3/Mv7xxG2MR4sN0= -github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.32.1 h1:zh3Jm1emj0IZeZAdimPPHwo2kscIYxxW4fCa+eL1SUE= -github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.32.1/go.mod h1:a74kIao0vSolFoqFuqoU/ZLbQdE7ean791+w7ke3UmI= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.48.1 h1:ydeDmQyYbaVk4Kk4rT7rasqar7WKizpIZc/MtTwx3XU= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.48.1/go.mod h1:yebrHNdyMhIz0hKhQzHaKtr7GnfjCWfQXR8fI+biDOY= -github.com/aws/aws-sdk-go-v2/service/transfer v1.62.1 h1:h7ztYoDpj4P9TF6Tl22F2bK4ceiaxt6UR05KYvSXZ6Q= -github.com/aws/aws-sdk-go-v2/service/transfer v1.62.1/go.mod h1:pcob4Kb6kNQartCIk7k5DvcMgUWfFHgpvUmT6NJ+tfA= -github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.25.1 h1:YfjBV97VKP7BzolXmhkpoIIhfW2bMcxHbMOiK+bXVjA= -github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.25.1/go.mod h1:5Eyf+GB1CKpvbvZFT7MIO5Mk3gPHBcyx+WC7Jb1WeIs= -github.com/aws/aws-sdk-go-v2/service/vpclattice v1.15.1 h1:yNH2+yM+Fjdm7qyAkZ8jSvvGNJLY1B6Ojf0y1bxtnNU= -github.com/aws/aws-sdk-go-v2/service/vpclattice v1.15.1/go.mod h1:PIVQ2MlMezvs5/JN23nZQtdiCcXw1pck5Dc14UYXFys= -github.com/aws/aws-sdk-go-v2/service/waf v1.27.1 h1:KXfH2cD/09HuOfEMy4+dOSgswvjsLlIq4MfZq54XVTE= -github.com/aws/aws-sdk-go-v2/service/waf v1.27.1/go.mod h1:3Ox1y+Ece8qh6sh5SwhIApyChTMjB9M+ZPkfFrso9E8= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.27.1 h1:cT33VIS4q26eNlgc0BmJ3PztzPYz9fc2dZLwITYqLbA= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.27.1/go.mod h1:WTjSh2yRo99f7MXyTkQJ2+jrWyyiSKpUpVdeoPFBdqI= -github.com/aws/aws-sdk-go-v2/service/wafv2 v1.64.1 h1:oP8eLLYrvxRaOKd8P2Cx0v6BnlBHp9I7ke0hVIVM7Ow= -github.com/aws/aws-sdk-go-v2/service/wafv2 v1.64.1/go.mod h1:hOrt3LfmAbeUsafBWZpHYkKLzX4Lhd1O9Fgy5Jahr/g= -github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.36.1 h1:u5PVGnXaDhUzAi496HM0AqSHLMxsH8AXDGI+hvGGceg= -github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.36.1/go.mod h1:9T+lndTY7HGyy99UmFciMfeG8DvHJxQLgKcZkVpfxtA= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.59.1 h1:pHLxmX312+1Y4TPvAKS1cVS8ky4Lcqlv0tfmjvSQO7Y= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.59.1/go.mod h1:GKRVmQy+p6FxWidtWnsx/qbxIKyu96pEYCdMrcuTgeM= -github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.28.1 h1:EUGE9p+/Yfs3gsuazAvn9yDY5k+yjaPZD117hum4BUo= -github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.28.1/go.mod h1:gUs8tCNAp6COwgYIef9axji/vDiM5KXzjxXpSHrIz9U= -github.com/aws/aws-sdk-go-v2/service/xray v1.32.1 h1:cEgIUA7e2jJX6dtw7QZHZC4Npgzc3qAhI6VgBAJhLys= -github.com/aws/aws-sdk-go-v2/service/xray v1.32.1/go.mod h1:yNBhxYF0/a7HxlvvPZ9pljsw3wSh6ooyxg5llocFwBQ= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.3 h1:3ZKmesYBaFX33czDl6mbrcHb6jeheg6LqjJhQdefhsY= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.3/go.mod h1:7ryVb78GLCnjq7cw45N6oUb9REl7/vNUwjvIqC5UgdY= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.3 h1:xMmJPUT0G1q9+I0mzH4B6oN9fB5PkDoD+jvpVIcom1I= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.3/go.mod h1:U0JFMTY/gPxV07XTXXz152nX0Hg1eBenzyslKF2j4j4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.3 h1:ieRzyHXypu5ByllM7Sp4hC5f/1Fy5wqxqY0yB85hC7s= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.3/go.mod h1:O5ROz8jHiOAKAwx179v+7sHMhfobFVi6nZt8DEyiYoM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.3 h1:SE/e52dq9a05RuxzLcjT+S5ZpQobj3ie3UTaSf2NnZc= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.3/go.mod h1:zkpvBTsR020VVr8TOrwK2TrUW9pOir28sH5ECHpnAfo= +github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.24.0 h1:Pw+Ibvg2vG1gulfBO2FPjr5Y+SDyxzVA1EXw5nTCZiM= +github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.24.0/go.mod h1:q+A4de5nxY2w1IxXmxSz2ybaW71gjNr634rj8AaBeOs= +github.com/aws/aws-sdk-go-v2/service/invoicing v1.6.0 h1:DWBnflfGGvIj45VsuhUyg3K/0xYodsjHS7FQ73TZOGo= +github.com/aws/aws-sdk-go-v2/service/invoicing v1.6.0/go.mod h1:Unu+LGlKbxjDYhpgap35rN7vwxSalaiXzIlQIUH2n0I= +github.com/aws/aws-sdk-go-v2/service/iot v1.68.0 h1:eA05nWoMN0EF0rttyORxmB4mMLMhdS6PLpL/0GyTEm4= +github.com/aws/aws-sdk-go-v2/service/iot v1.68.0/go.mod h1:bJop9Eo7sy4kUxLfjXsgBUVzXMiEeVdnycU3AvyCG9Y= +github.com/aws/aws-sdk-go-v2/service/ivs v1.46.0 h1:7e91TZxrdMEe3HvHmFf+VS+VlLf/O9/HtQc6lMEP4Vs= +github.com/aws/aws-sdk-go-v2/service/ivs v1.46.0/go.mod h1:oZEFz9f6yBBPA1+CIKd5qDKX3+P0avnvsv4ZRbWefuE= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.20.0 h1:FNFXj1Ydfrf12zcGNgqVuTNV/UfPMVWZ/iH7hkups/A= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.20.0/go.mod h1:MsE+ZmmlW+UOhKhq8Ahp2CumqeVfwbpFxk0tFIZUtRQ= +github.com/aws/aws-sdk-go-v2/service/kafka v1.42.0 h1:/EB9p30Te0eClIIptu3g3meO38O87YVVdE/UVbyTvWA= +github.com/aws/aws-sdk-go-v2/service/kafka v1.42.0/go.mod h1:uvEnl4e5ie3zB+2qlQCqcv0CgOyI8ajOegLEKERjqfs= +github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.26.0 h1:PG2c7HZCVIBFhdIwqO5jg8xo1fHgalDdUwNsn8T1Esw= +github.com/aws/aws-sdk-go-v2/service/kafkaconnect v1.26.0/go.mod h1:p50f5u0jxoFWTV6l54BxrE+7zJ1/Iucap85GrSnpptY= +github.com/aws/aws-sdk-go-v2/service/kendra v1.59.0 h1:Np3pECOLZw4JZgx7d588fTuU2RtxkRRYlTqlCrLh/nk= +github.com/aws/aws-sdk-go-v2/service/kendra v1.59.0/go.mod h1:edFwG9l6+RJ9BjapAgxfnHY13/FsufZekEjw/T1Xp8I= +github.com/aws/aws-sdk-go-v2/service/keyspaces v1.22.0 h1:gFAqI4i3uvMo3Bk3ePdPwDEYgssnVCFF+p3p3KkRyQ4= +github.com/aws/aws-sdk-go-v2/service/keyspaces v1.22.0/go.mod h1:V6Iy+0hEq/ebivBZ7wBENH0cohMrhk77z1UW7Icp70E= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.38.0 h1:8acX21qNMUs/QTHB3iNpixJViYsu7sSWSmZVzdriRcw= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.38.0/go.mod h1:No5RhgJ+mKYZKCSrJQOdDtyz+8dAfNaeYwMnTJBJV/Q= +github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.29.0 h1:IJkGKIgX2ZCga4Ao4A8RcL1rty+s1Cc+N/JCtnmtm+c= +github.com/aws/aws-sdk-go-v2/service/kinesisanalytics v1.29.0/go.mod h1:jYH0HRqYnukQt14eBIgAfnIRjihLy5osnU0BN0G+Do8= +github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.35.0 h1:eoa+/AK+SVR5cTa/yPiDeupC0EZ8jA496jwjNMhrL+U= +github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 v1.35.0/go.mod h1:E4piy+DkyYY+2sIOdlI91iLrygWzEfIuldAwgyQmWQs= +github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.31.0 h1:wOcpGR9keDoaWcFQOUEQqA9EhRcl2yv2yOWS24sQnpM= +github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.31.0/go.mod h1:h095RtNvHu1cWmPHWxEitFuK7AcAjO6sKbovcmF+7mw= +github.com/aws/aws-sdk-go-v2/service/kms v1.44.0 h1:Z95XCqqSnwXr0AY7PgsiOUBhUG2GoDM5getw6RfD1Lg= +github.com/aws/aws-sdk-go-v2/service/kms v1.44.0/go.mod h1:DqcSngL7jJeU1fOzh5Ll5rSvX/MlMV6OZlE4mVdFAQc= +github.com/aws/aws-sdk-go-v2/service/lakeformation v1.44.0 h1:L48j3iwTIZPNp1FEnZ3d1L1Fx+9ac3N0Oyca42yY3sQ= +github.com/aws/aws-sdk-go-v2/service/lakeformation v1.44.0/go.mod h1:pp21VYtkJxgEINbEvBNkovKr3C1GOzKNYxxUiMM3tsY= +github.com/aws/aws-sdk-go-v2/service/lambda v1.76.0 h1:BbZi6/1W69NHTyM8CeusL35y1L3YQDky7vW2wzUAtio= +github.com/aws/aws-sdk-go-v2/service/lambda v1.76.0/go.mod h1:Uy6Tm+/QiIz3zvTOySvpMHTTQShZ/jZ0rVLtG/a+BE8= +github.com/aws/aws-sdk-go-v2/service/launchwizard v1.12.0 h1:Ep6t5xK/IYMotfsNJ0cDEh9g5GrxwIlBYXyGucmm/nM= +github.com/aws/aws-sdk-go-v2/service/launchwizard v1.12.0/go.mod h1:o3afUpWusM84fxzwOswLeKjAutBrLH5WZxC5Bg2+Kag= +github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.32.0 h1:vCV2K/9Wb5ubkqLF6bkaHG1yET2NXFf7TXgsWwv6Y3U= +github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.32.0/go.mod h1:EaraoM/hBrcTVf5ykRkMepUaJH7O5JJ+/D0uEz1k4Zk= +github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.55.0 h1:Pyf7XMt3ya+mV/0Zo5wRU0blp1kTZfvUBB/eP8SgvRM= +github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.55.0/go.mod h1:2E047X7x62z38tMw0lJ7smqSv1YeSiQTQFK+8/ONiok= +github.com/aws/aws-sdk-go-v2/service/licensemanager v1.35.0 h1:gdfSY6AmWavRp8Vl8jaBMbD5M0rmbiJZ2GjgyoBQw2I= +github.com/aws/aws-sdk-go-v2/service/licensemanager v1.35.0/go.mod h1:TBm4Zxk3cVPC/qu7CBBtxeDBRm+NxPumhD39np/9HZM= +github.com/aws/aws-sdk-go-v2/service/lightsail v1.47.0 h1:PGWe+dWCl7Iu+d6nnVS9mmeEWYtoHDu2D4GqyIgg7vo= +github.com/aws/aws-sdk-go-v2/service/lightsail v1.47.0/go.mod h1:k+O6WzXkLorOOArYPtOPtpVXtCJBAeUsV/7gQRR0wt4= +github.com/aws/aws-sdk-go-v2/service/location v1.48.0 h1:jOCYFO1GgCkG3bSeMsKzK/cqvBq65ocisfEkpduVGxo= +github.com/aws/aws-sdk-go-v2/service/location v1.48.0/go.mod h1:VL8j8BiySNuq5pDthDsyd4uqBXxtqjJlBb5WWbFbZmY= +github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.35.0 h1:33rj0RNRRxNHPGCCJ0lC9dOsrLWJXVsJteZQS6BHXdk= +github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.35.0/go.mod h1:lfJ6B6p/KQY1W7a2qVwYtXgQvbYPIZi+BQPHMfs7pWA= +github.com/aws/aws-sdk-go-v2/service/m2 v1.24.0 h1:9Lo/MEr45V5AJ8mf3gb0g8lxPlbXNXbQ8MlHWPgsWh0= +github.com/aws/aws-sdk-go-v2/service/m2 v1.24.0/go.mod h1:AFrHabRFBc00+A3Jh65w2KrPPUbj11tXqBb2dW0+7UA= +github.com/aws/aws-sdk-go-v2/service/macie2 v1.48.0 h1:7Ic+DGhlNQb5UoUGB/1gV+ULY/sLCB6Oe6F9MvowUZc= +github.com/aws/aws-sdk-go-v2/service/macie2 v1.48.0/go.mod h1:TWKvkEe8yeOKDNCMW47xAQJiqln+pa4RWDXUE6PGHjA= +github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.43.0 h1:ek+HR+h5mzH8ZW9yBOarF4Xu4Asj9SceDyrUle8y1yw= +github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.43.0/go.mod h1:+h6ngXuktUq919fdzDtWspFrg4Y+C15VlIra9CGVw1w= +github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.80.0 h1:sZ1KON5k/tyf3xbZKDW/gl4nHEm/84zDpXGsA0/7LcI= +github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.80.0/go.mod h1:QOmlr6sjqSPtQXGhi7hhj+ihkU47qs3ZTIh3vTbqX7o= +github.com/aws/aws-sdk-go-v2/service/medialive v1.80.0 h1:7zjskfsMrJGBs6y65V2TZG1xSUxWvZYnFiwBjiRN9F4= +github.com/aws/aws-sdk-go-v2/service/medialive v1.80.0/go.mod h1:ztAXVYzpWC8UtMzvZ5VPBmytv9exEv6BsAq7Z2oSJK8= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.38.0 h1:te/oZcPDK1WkmGy8tE0zoxTE5aEaEqZ/79jdTDxjyb4= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.38.0/go.mod h1:LizOnQyvCXr58pqNFq6Fijjzg6o38w5bnxxhnfBAQsI= +github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.29.0 h1:wBaXl/5Gxvc3dgiPFNFWw1QEL4ktn3bD+Tb/lU5zGIw= +github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.29.0/go.mod h1:JGsiQ3sKXi5OwUAJZfCppe4Cks0kN32eH6+oD2bq63Q= +github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.38.0 h1:zutK4lUa0WzbzA18TjqAcSCLFWYdtxh2adC9s9Jz2Lo= +github.com/aws/aws-sdk-go-v2/service/mediapackagevod v1.38.0/go.mod h1:EZC3Zxx4zA/VL5dHqUMBQZQh1GdN7ye1SgPSIpcB/Gg= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.28.0 h1:dr8QYzAgIt7JTEN65ujaa3qB1HDKL1Gg34rVvWBzxn0= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.28.0/go.mod h1:J9usg9CZaYqNdF9h0ggRA3oYbjp3YWwCaKNKD+VVVns= +github.com/aws/aws-sdk-go-v2/service/memorydb v1.30.0 h1:jmAOPEdLWcLdZjkmiDWb3rcKqPNbXKI0l7VgukYWZDw= +github.com/aws/aws-sdk-go-v2/service/memorydb v1.30.0/go.mod h1:NNlta0IS4G5ti97P4p0eDNYGBnv2uRLzSgVWpSARNdg= +github.com/aws/aws-sdk-go-v2/service/mgn v1.36.0 h1:hqeHoI8gefTz2qXgxG7B5PsVuJuyVnPfp7EveQtOeHg= +github.com/aws/aws-sdk-go-v2/service/mgn v1.36.0/go.mod h1:tDCA72Dhugy3hO10vTlROD3ahbJGuqnRvRrjvX4a/iE= +github.com/aws/aws-sdk-go-v2/service/mq v1.32.0 h1:h04Kq2u2B6bDeAmNoxlf9bqtKH3GUlkW3p/+e/mE7+o= +github.com/aws/aws-sdk-go-v2/service/mq v1.32.0/go.mod h1:tVSPpsQhalaf+DchZKFeDoohUeNE8dVSFGNRjZrDSQE= +github.com/aws/aws-sdk-go-v2/service/mwaa v1.38.0 h1:8ScMT/bvwaGzWE+5zVDxVPgSWaBrSaFZhEIhX7kCOhg= +github.com/aws/aws-sdk-go-v2/service/mwaa v1.38.0/go.mod h1:Mi/tghAzRmlNlqFwV/5D0NMLfhrkqSabMxA1wY6dCTw= +github.com/aws/aws-sdk-go-v2/service/neptune v1.40.0 h1:G8EHt/6UbzCG4ZvQZP/HHDHApq+zArzKEXMhpYlPhug= +github.com/aws/aws-sdk-go-v2/service/neptune v1.40.0/go.mod h1:lvD4yDK2ULNV+u6h3uVBlGNtcGj157l0e8rcRijqxhQ= +github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.20.0 h1:+zQYbnkNrMslzC+4RKJjoENheRA0oyRZWrr1GoaD6hc= +github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.20.0/go.mod h1:uIZJKA3sBDgaXKxORwej5uNIXInMaTtjROVFbhCoGQ4= +github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.54.0 h1:5v9hJYt08sME6Pzt7zEn3q7prnBKjjuv6dUzpStvm3I= +github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.54.0/go.mod h1:HKJfDUSWabuQ8Evx8mqmk/nNuL5JmZl5IRNlJ/iR6j4= +github.com/aws/aws-sdk-go-v2/service/networkmanager v1.38.0 h1:Rdh8HWrjiIn7lLugBf3uR9NQoUE0XvOyM8c3I7okBXk= +github.com/aws/aws-sdk-go-v2/service/networkmanager v1.38.0/go.mod h1:bXguklweVIXFjJ05yXJ1Jr5EoOofLT77UOrjYhmW/Qk= +github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.11.0 h1:4RstlGjxjPNGswiVCIPcwck+IH/HulpbaNY+1PA2Sg4= +github.com/aws/aws-sdk-go-v2/service/networkmonitor v1.11.0/go.mod h1:Z3pgjAIFoLaTC2GIBeE4wY31OeTAW7Yu59G+oJHUy+E= +github.com/aws/aws-sdk-go-v2/service/notifications v1.6.0 h1:oy/Wi6NFXYRg/1wtNNRn2gyEIJGmIon1osvj0E7s1tU= +github.com/aws/aws-sdk-go-v2/service/notifications v1.6.0/go.mod h1:2lcjRCU4jc7gouZFBGJw62bZDtDFy3DRCm9rho+BIVs= +github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.5.0 h1:cU81jdax5eqhZiEGRxRN5nfKj9Rp6jgHKnIDoRArU3A= +github.com/aws/aws-sdk-go-v2/service/notificationscontacts v1.5.0/go.mod h1:ZWRIBbneNn04ltFXrYN6r4j2GvC8KtilEWMRswSB8wQ= +github.com/aws/aws-sdk-go-v2/service/oam v1.21.0 h1:S0IoLaOU5NCanjuxRLmf+qjkz8cUnNvaAOOC/zb8c4Y= +github.com/aws/aws-sdk-go-v2/service/oam v1.21.0/go.mod h1:I9L7HVx7wBiIpnt8oV77si3ZqTA8BBCEB7RU3jk8F34= +github.com/aws/aws-sdk-go-v2/service/odb v1.3.0 h1:EDHfy8QUacuK48e3rA99EfrD7z4zSVYz99es2YicD2k= +github.com/aws/aws-sdk-go-v2/service/odb v1.3.0/go.mod h1:MLlHYMY+BRF9keX86rRA1zv4J7O2jIVeooJ3OpHTk/M= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.51.0 h1:dxYQ9hDRI/yXFzO3sYT+x3Ss2d8JDf2eX5hyUPHG6fA= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.51.0/go.mod h1:NQvq4ckAgpR9/QqqI5+eWnP6rNlpOVta9udBG9GVHcw= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.24.0 h1:usR9TyfGyoGq2SK2ksEc3qwpYeBe03rccTj63hUFWKk= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.24.0/go.mod h1:anGtuIsRziAehQRV6pPE6LbaGBQ2q1Gg20D3Ixtm4LU= +github.com/aws/aws-sdk-go-v2/service/organizations v1.43.0 h1:mkEqqGgdmOQ7DbfWVKL8TmAki9S3f+4YiMwgKN6TIyE= +github.com/aws/aws-sdk-go-v2/service/organizations v1.43.0/go.mod h1:DbK1D8dgPVhcX1eNASHk5Q9C+N58RFw5PvN+2osa+Ws= +github.com/aws/aws-sdk-go-v2/service/osis v1.18.0 h1:71GQ3yQ1sGjXsAOBso7nVLCLJrCoDQP1IhYbQciMpFk= +github.com/aws/aws-sdk-go-v2/service/osis v1.18.0/go.mod h1:O3bVtO289aQvaGA56/SPbLeoEBvkbr1BerS/A94Xeik= +github.com/aws/aws-sdk-go-v2/service/outposts v1.55.0 h1:PlpUSiYutFa6aEeRrQYUo8zomTuAx5oXxjwrZ/XZH+8= +github.com/aws/aws-sdk-go-v2/service/outposts v1.55.0/go.mod h1:3pSTlomz+DwHpKcE9mN+kOdPCMZyj1O2C/0tvPbSzKM= +github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.22.0 h1:VOGIH/MtfO0aIDRuCllgzlakSqzA66W5Yc2FHatgfuE= +github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.22.0/go.mod h1:sAThYxAnlQ/hkntlxj/KcD/8T0rShXIx0xA42eMiJe0= +github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.14.0 h1:IlYnE1ZfFKisSY2tOp6jgKBXZoNIfhHPYzBDPfwmY/0= +github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.14.0/go.mod h1:eVYoJ/sxF8Zc3DEo+O3CNpCuEYutm16FB0vAtFLaGgk= +github.com/aws/aws-sdk-go-v2/service/pcs v1.11.0 h1:KXl52JHAz09QVa9tymsKhofwoNRqmtdz8SkKLZa79HY= +github.com/aws/aws-sdk-go-v2/service/pcs v1.11.0/go.mod h1:B7H2wug0rXya8R4w8u2gw+NvbPjd/3W/28dCkpYUmaE= +github.com/aws/aws-sdk-go-v2/service/pinpoint v1.38.0 h1:2N2oZEWjjUWpqqOSNEgpd63ETgtp8UHFhMACk7ByM2I= +github.com/aws/aws-sdk-go-v2/service/pinpoint v1.38.0/go.mod h1:i3U6njVpG1uB9l9ueSttsU4+0NdH8V0U8QKjNdMvdUM= +github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.23.0 h1:BtpUqF+QdW6NYowWLd9LYYKO+cwxMpb1XpSYX6a8dMg= +github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2 v1.23.0/go.mod h1:SMXXR2N0zJmYAjJazRlfNSKCV4ei228xhFO+ZoqXH7w= +github.com/aws/aws-sdk-go-v2/service/pipes v1.22.0 h1:kjP4uojcr0zt3Xon5cuEWf95wDNZ2a3D9EWP1l2mYE4= +github.com/aws/aws-sdk-go-v2/service/pipes v1.22.0/go.mod h1:1AhqeD/xOF18b3v19C3p0gJigmQ52Kxe/Fifijwqtlo= +github.com/aws/aws-sdk-go-v2/service/polly v1.51.0 h1:/ArRJKD83NVXj+9OAfZEahwvHkSSqPfTYx0ThC/XsAI= +github.com/aws/aws-sdk-go-v2/service/polly v1.51.0/go.mod h1:S4iYoRxJQK+7h0jBi6fiUW9JyW8adhtoXW5mEc0qzhU= +github.com/aws/aws-sdk-go-v2/service/pricing v1.38.0 h1:WjynubA3yutEkbjZtzgNXAMhndGWraS2g5W9TXdtBhY= +github.com/aws/aws-sdk-go-v2/service/pricing v1.38.0/go.mod h1:6XKuQQSJAmFkNQ+6JxygxJw1rjbS4AMJ998ZvQAMGhI= +github.com/aws/aws-sdk-go-v2/service/qbusiness v1.32.0 h1:j2UihqELKZYVxUXtEJ/ANG+L4zyejh4B9K6Hc7ZzW/8= +github.com/aws/aws-sdk-go-v2/service/qbusiness v1.32.0/go.mod h1:Sjk/KzOJtKspO7hmHvT/oHZw5AtX1tsmbI0WAbrNu6E= +github.com/aws/aws-sdk-go-v2/service/qldb v1.29.0 h1:z8hxRH/lXSN0oWjvYyuxeAHIEOX2mP4m3QqbJgNZw2g= +github.com/aws/aws-sdk-go-v2/service/qldb v1.29.0/go.mod h1:eBVhzKjNK//VOPAetMab3jT/njEna4DKLvlK+dcJfLA= +github.com/aws/aws-sdk-go-v2/service/quicksight v1.92.0 h1:GzBorIQ93nyNDbC59odoBTRRSAx0Im9Z7xwJ5UbI81w= +github.com/aws/aws-sdk-go-v2/service/quicksight v1.92.0/go.mod h1:MKyuqaCqFV/T4cD00DDWbrBZbxDp6WLyHbSOBNxWHZI= +github.com/aws/aws-sdk-go-v2/service/ram v1.33.0 h1:S1OWl3a+IRR/GSqzjea0jflabLsHyDJXknxJk7pkYI0= +github.com/aws/aws-sdk-go-v2/service/ram v1.33.0/go.mod h1:ugO++LtUnJAM+y+SkHc/MnZdgIevyA2Eotn3J0UNluQ= +github.com/aws/aws-sdk-go-v2/service/rbin v1.25.0 h1:uxZwx9vobWg4IS1dyMoC/5Bqrkt9URYtUvj08SZPDRY= +github.com/aws/aws-sdk-go-v2/service/rbin v1.25.0/go.mod h1:V9wi+fIOqZV2lNpSeWGEs4FJBNF2ROkPWLhbweCl7NM= +github.com/aws/aws-sdk-go-v2/service/rds v1.103.0 h1:OWsmICx9jHtBVrgYwYb+2q0iVSPLIfDZOiKhoQA+gjc= +github.com/aws/aws-sdk-go-v2/service/rds v1.103.0/go.mod h1:tUKTkGAlJo0Gs4t0Z46vaSGD6H1Z6RvtuF03mZY+tPk= +github.com/aws/aws-sdk-go-v2/service/redshift v1.57.0 h1:gFNE53MstNSex5n2AeuqDeO9y6YrAEq5r9ohIo0Q1S4= +github.com/aws/aws-sdk-go-v2/service/redshift v1.57.0/go.mod h1:royODzFrVBRoek5vd76xF7WnwhMGjDj9ZdYcg7Hj8Es= +github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.36.0 h1:m900Kua81M38+2mViQR0WyXuVJHXfHhBMZE2KEOKCxg= +github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.36.0/go.mod h1:fKbyyPpRvNxxd3FC8IllvIVic0l4C/IGKIcU7lb5tfI= +github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.30.0 h1:jB/wGP9pe9pbXCFqZELx9MxLmkZetN0yK0kc7jFDlIY= +github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.30.0/go.mod h1:qPNYvgSCnM6m27k766S1vd+QquZYz5efWKbMGjB2cU8= +github.com/aws/aws-sdk-go-v2/service/rekognition v1.50.0 h1:bn5Y52YaLv5p7sa6TIH3Fr/V+gLpoQkcctNAvYT1YP8= +github.com/aws/aws-sdk-go-v2/service/rekognition v1.50.0/go.mod h1:5vEhAy+7ycQg3WVq7kp1YWTi43DxOqbUPkDLP8vB1Yk= +github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.33.0 h1:DUJziWLjN4tzfLFz+h2DRDItRtrD3NdGWs0xztSZlFU= +github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.33.0/go.mod h1:SLrdEDIWvazT0GTFQ6ph3QW2EAYYeizvd7g9CMpoMs0= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.20.0 h1:26bUDFcdGzHxBax1oY+HL/YRmUVfqyvcbgdKHr0FDfE= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.20.0/go.mod h1:eFxDYEcdKWIT77Mrq/fT+6KL9bu3ACn5sDFk7Be8FKg= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.32.0 h1:ZzEJclXVP4woTKwsQChUKOZuekxc/DBjlHKmfFWpYrg= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.32.0/go.mod h1:uGcWLsjkPjZYRpw67cFbNND8jtLokfgLTvZSGpAT7cs= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.29.0 h1:jevrLpVG9sOEPsuipO3eGcdDzJyo36Dmme9iSu/8GVE= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.29.0/go.mod h1:t/zZb99l0WrcNYbDIF3tgj0rJNklhiVa6B1x/Rz4rHc= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.20.0 h1:KBw/bfF87jfAgm0ZcQOCgqJSY7tMLg9x+1f+EdUHQt0= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.20.0/go.mod h1:mWcjTY8epINHRpQmgBLjOTYM5TYUeBOysugdyG128io= +github.com/aws/aws-sdk-go-v2/service/route53 v1.56.0 h1:+8/JB7/ZIk86sDBtcy+md9qqHOjc6rR75NySpsrujDY= +github.com/aws/aws-sdk-go-v2/service/route53 v1.56.0/go.mod h1:aSIshIhq15I4lMlrkvvIoH7E4eLTAEW+isWbga9guNg= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.32.0 h1:ZjfNS/AmmzzGbM9Au1219mq3rh7L3HhzgCV04Z5k24M= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.32.0/go.mod h1:v6BvxeZNn9Ys2Fv/6IGmGCcrf5a10guA3YvlpQId/1o= +github.com/aws/aws-sdk-go-v2/service/route53profiles v1.8.0 h1:MuXKThC0Lv83LdIiFc5aMjmjYuG7hC49Da3H+dvt6xo= +github.com/aws/aws-sdk-go-v2/service/route53profiles v1.8.0/go.mod h1:3m2fCUiYfoCDxPMHZGP6u5w9oMOTJnmI8rEc0iKEba0= +github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.30.0 h1:mYSV8Ih3PRx9/uKuMMYRGWnUSDjOKDJAlPLqw/fhxB4= +github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig v1.30.0/go.mod h1:XTAEe+ed1/YhRZr7IwJOcd7LxwEhdHgXFyAbhW5/0GU= +github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.25.0 h1:M1lJ8nSB8pL5XPIq82UsizGi+t4ZXkmBkW2WpPWczpw= +github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness v1.25.0/go.mod h1:P9I8vfH8zNEoQNAqKYgpuWRce0tdKZQaCHHs1oF7SV8= +github.com/aws/aws-sdk-go-v2/service/route53resolver v1.39.0 h1:JCUZSQ0pCqqihKLmicNKzvKt0JpXzwyWr4izSjyKxbg= +github.com/aws/aws-sdk-go-v2/service/route53resolver v1.39.0/go.mod h1:gF2Hv8YowjskA+/IKprIj9QroaE0HdD7H0Ay39K4y2s= +github.com/aws/aws-sdk-go-v2/service/rum v1.27.0 h1:3r/u8MwfSuEu/PggD/JS+1/p2/g/a3mz+bjg1uTSyys= +github.com/aws/aws-sdk-go-v2/service/rum v1.27.0/go.mod h1:P7vki/W7C8Yufk6IMf8pZys8ZecwQ9AELEQf2KtRAXA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.87.0 h1:egoDf+Geuuntmw79Mz6mk9gGmELCPzg5PFEABOHB+6Y= +github.com/aws/aws-sdk-go-v2/service/s3 v1.87.0/go.mod h1:t9MDi29H+HDbkolTSQtbI0HP9DemAWQzUjmWC7LGMnE= +github.com/aws/aws-sdk-go-v2/service/s3control v1.64.0 h1:vq66S6Ulu9VLBGCuOtENpbxBEdpUdn6sBopaoP9/SKY= +github.com/aws/aws-sdk-go-v2/service/s3control v1.64.0/go.mod h1:W2e0S97cCup2ME32T3fECFSELYcU71486wsnjMG5GwQ= +github.com/aws/aws-sdk-go-v2/service/s3outposts v1.32.0 h1:mT0D16ojwEPM0/XW1yVAeJYvX1F5B2yMhwf7CDpvIqw= +github.com/aws/aws-sdk-go-v2/service/s3outposts v1.32.0/go.mod h1:CiSms5HhJ3M2Q0sYi27TI7a11rVYW4J92nYKpwRm7qk= +github.com/aws/aws-sdk-go-v2/service/s3tables v1.9.0 h1:b+DS5OdH3yZCVMHLs/8aA9Nuw+g/WphnYqWj1lnrZbU= +github.com/aws/aws-sdk-go-v2/service/s3tables v1.9.0/go.mod h1:jVLVoLsG7vN8XEO7OQ7Bqw6qqHXMqWbSBMZ7tmY8R9Q= +github.com/aws/aws-sdk-go-v2/service/s3vectors v1.4.0 h1:9xIfi7XPNyqbrZBCVsAnxlajEsNLP4qZ/T+rw6NYtZ0= +github.com/aws/aws-sdk-go-v2/service/s3vectors v1.4.0/go.mod h1:1ByJ/xRNkPDVddSxcpou91CiBIose3JWIWwFw/QjzD8= +github.com/aws/aws-sdk-go-v2/service/sagemaker v1.209.0 h1:d4f7/eKImxS52878zZOgRsi3mg7LAQNl9uyIN6hfuQ8= +github.com/aws/aws-sdk-go-v2/service/sagemaker v1.209.0/go.mod h1:sawKpnbUfWJb/Q/i2P3rXiM+vXUosAqJ1KOsuKxPRxU= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.16.0 h1:vlmeLcOZ1PtqEpgRIZOOw49DABG9EWYkHHmC96IBgBM= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.16.0/go.mod h1:2XG5FGAj7Ao8KR3scdaU76/YEsdUG304Qt1dIUfHIGM= +github.com/aws/aws-sdk-go-v2/service/schemas v1.32.0 h1:37TFUN36cFLnIj32FFanXqD+uuXwASxCEEckhdBjCnE= +github.com/aws/aws-sdk-go-v2/service/schemas v1.32.0/go.mod h1:kZyD0Nd+qn+NgT7Bc3wWwkgTs+J9ufgH46zvV/aC1x0= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.38.0 h1:r5HePq6z0BEXHOZ5/k6bLZVYMSAplzNbvBxHlb2R31A= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.38.0/go.mod h1:Vjg2dOkHDyjU1GFkMtly8DF0r2hKzddAnotNHN6qovY= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.62.0 h1:sKzvE3fkQNa4iXbS2zhPsWhoYZUuPGeyCx29zWaUAyg= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.62.0/go.mod h1:O3x2LxaDhY0QmJKHLaw2MGgKeYhDMWvi7zsJ+rcnWQU= +github.com/aws/aws-sdk-go-v2/service/securitylake v1.23.0 h1:bhfdvrLXqdIbe+XixpCiW5plHoozqTO7afs+26ovHAk= +github.com/aws/aws-sdk-go-v2/service/securitylake v1.23.0/go.mod h1:QV9oXwcwhXmG0epKJcTFu0mfZEwkowRVpkhIteltA5M= +github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.28.0 h1:zJ4sLmAK4W6tk1czlTcu0pPMyCEFsZvv/v0NC1CymuE= +github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.28.0/go.mod h1:HYxuleUSaHgXo2zG8LX1x//z561i55ilDsrVdLbxt78= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.37.0 h1:c9obaYL+TZzWwZf59bU+F18J89YWxciIiGYf+Sr1NU4= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.37.0/go.mod h1:r7nLneDqXu0JsahY3BLtRYyQhsIBloK9O2KLYbSvHU8= +github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.34.0 h1:kSiJ+KBflpGStdvVB8osVwzglb9QOcCGeaNeveHUAuo= +github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.34.0/go.mod h1:6QMbXmJiAJ/+xLTDMZJUq36LdNsMXKj9cH5MeG69a5c= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.0 h1:UjC4316d1/eUrPGYZxs1nDdA2yD7VgsB6Ep7HQmX1xE= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.0/go.mod h1:nnG6Pe7Qu1Bv/mE3eL/3gCiQYrAWyXFXDOtOKcC7eh0= +github.com/aws/aws-sdk-go-v2/service/servicequotas v1.31.0 h1:IqZZ0dHv/NhExc+8HI6CdgTZLz7Yjn9OaExTmFX4UX8= +github.com/aws/aws-sdk-go-v2/service/servicequotas v1.31.0/go.mod h1:q+dUus04tyoWH3qZxKzu68bfL4MFs5ahSTSkyFIqmFQ= +github.com/aws/aws-sdk-go-v2/service/ses v1.33.0 h1:3BEXxnGZpqGWVFL8lntsAtWjT19EtQp2uUmXS0+wWpA= +github.com/aws/aws-sdk-go-v2/service/ses v1.33.0/go.mod h1:WvsgG068tbYpznWb1e4z09bo7pdNfKyHK05muGk3JPA= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.51.0 h1:EGgXgQlHPLB4AQ2EitqhfkhRkyxHJ+Y1CTFbP6vfS60= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.51.0/go.mod h1:z/Ty4fCI3RR3vFh/z2kYmdv4KgXh6z/ydK5XN/hfCcY= +github.com/aws/aws-sdk-go-v2/service/sfn v1.38.0 h1:qDg+pW4hxuM1zlixvZy3EyRxGiy4FknvKwfYHsUGvYw= +github.com/aws/aws-sdk-go-v2/service/sfn v1.38.0/go.mod h1:UXg+xZNhGCuhG8tg8Qj9XBH3qRA5WgmJkelLEyOassI= +github.com/aws/aws-sdk-go-v2/service/shield v1.33.0 h1:vIp1dRkvVu4oKSl41ds/Y/rBRfw9tyUAOMS1E0FRdG8= +github.com/aws/aws-sdk-go-v2/service/shield v1.33.0/go.mod h1:oT7arIE6sZstDjgtKfXZtLqpnsJuX261eFPfp7+0LR8= +github.com/aws/aws-sdk-go-v2/service/signer v1.30.0 h1:iuz8rTwAAVIKp4BL2yafOsZDvuW5tkkPsOmxRcytPhw= +github.com/aws/aws-sdk-go-v2/service/signer v1.30.0/go.mod h1:9zSvP8LjLc7+ZKNU7wiKFYdtT103jk43rZ8VLh+SxOI= +github.com/aws/aws-sdk-go-v2/service/sns v1.37.0 h1:+GWmgZ6TeJ12tLw4l981+5nc9FDdzXtdZlnmp6KVHig= +github.com/aws/aws-sdk-go-v2/service/sns v1.37.0/go.mod h1:O4eFpSa/AodvDLJqarL+0vnRgDP9d/FEKHZmzLnA/1c= +github.com/aws/aws-sdk-go-v2/service/sqs v1.41.0 h1:xobvQ4NxlXFUNgVwE6cnMI/ww7K7jtQMWKor2Gi61Xg= +github.com/aws/aws-sdk-go-v2/service/sqs v1.41.0/go.mod h1:RExz4LhRKY5iogQ1dz7KVa3JyBY0PBotXovrDj850Sc= +github.com/aws/aws-sdk-go-v2/service/ssm v1.63.0 h1:1T8wFNEtOP4lgLC7v8Fzgbb4kFrMmnscG7kOqkbA26c= +github.com/aws/aws-sdk-go-v2/service/ssm v1.63.0/go.mod h1:CDVmu8K5JKdgdJakdZ9gC3K6OJ/+izv/kUncFeGRIj4= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.30.0 h1:kr0zUJ5+O+3XOO5k30ZFWw6BuW77y1wpYl8QbDxgyuo= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.30.0/go.mod h1:76T1ZqJLS3lBmShTO2230KTCoqjw7Lbxj6U7YwEQv+o= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.38.0 h1:6sjrNE9OXSuF3P2Y+++303mkGbQlmFweTLvZLUz4Ric= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.38.0/go.mod h1:vAUirHmPQmQF5LO19CMdt10p/9Nl4cqqdygIsdPjx4Y= +github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.7.0 h1:OHfg8SKR3X5AV6/LpinRDBPciw12F4qQjsvf6o0GiGE= +github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.7.0/go.mod h1:/B5AIPHVKVfZSsofTSfqrvl5QH5r/XK8/qcdHW3jjV4= +github.com/aws/aws-sdk-go-v2/service/ssmsap v1.23.0 h1:21pRqoiIDamny/57BJYBrGumQKQEAcZ1+7X2xpMkOdc= +github.com/aws/aws-sdk-go-v2/service/ssmsap v1.23.0/go.mod h1:tLEEa+UsBhm/fZNrnA1O8Vf69/Y94pYuLFP/v1UpB3U= +github.com/aws/aws-sdk-go-v2/service/sso v1.28.0 h1:Mc/MKBf2m4VynyJkABoVEN+QzkfLqGj0aiJuEe7cMeM= +github.com/aws/aws-sdk-go-v2/service/sso v1.28.0/go.mod h1:iS5OmxEcN4QIPXARGhavH7S8kETNL11kym6jhoS7IUQ= +github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.34.0 h1:aiGJnlWqp3e81gDzbSX/+67LqbnW9ppW/Md2CqLVCrQ= +github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.34.0/go.mod h1:0PiTFSuC4ripX730Y5aU/E6Nvge5JgVJUR36FAnCFCw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.0 h1:6csaS/aJmqZQbKhi1EyEMM7yBW653Wy/B9hnBofW+sw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.0/go.mod h1:59qHWaY5B+Rs7HGTuVGaC32m0rdpQ68N8QCN3khYiqs= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.41.0 h1:IZmMc03E2ay2j+4It6+XKpWLwdH9RNfLYr31ZjTmlpk= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.41.0/go.mod h1:WcJG/CyL+W/E19D8G5fV16EBWP/V1mxsZChP1i6HflA= +github.com/aws/aws-sdk-go-v2/service/sts v1.37.0 h1:MG9VFW43M4A8BYeAfaJJZWrroinxeTi2r3+SnmLQfSA= +github.com/aws/aws-sdk-go-v2/service/sts v1.37.0/go.mod h1:JdeBDPgpJfuS6rU/hNglmOigKhyEZtBmbraLE4GK1J8= +github.com/aws/aws-sdk-go-v2/service/swf v1.31.0 h1:rH21FB+YB32tQXRRqw5GOXLRlEY6sF0niNUnjIz2K4c= +github.com/aws/aws-sdk-go-v2/service/swf v1.31.0/go.mod h1:K53Z8VIehp17bkIdte5qQJGIg/TTAnSijG5M3SRVQvo= +github.com/aws/aws-sdk-go-v2/service/synthetics v1.39.0 h1:M7W7qo3OsHzH+zrmoU8gR4Or+WB2aV32kJ6H5qSYgEs= +github.com/aws/aws-sdk-go-v2/service/synthetics v1.39.0/go.mod h1:W+FGMMTt/jHWUUM5es5OTFA22E2Ofia4wT9sqs8RmQM= +github.com/aws/aws-sdk-go-v2/service/taxsettings v1.15.0 h1:+LdZx81sNrpT4v1+zr+5LJa8CBtKjWv9UFE+fLdzWRM= +github.com/aws/aws-sdk-go-v2/service/taxsettings v1.15.0/go.mod h1:VHRAf77eBVojkVkK/6Eh0YyqW474JYo2rkdo0ZSbT9U= +github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.14.0 h1:x/RJ5w+RJ7F6DXSqUdRd5oo/L2qq2ziciIep+5G+U7A= +github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb v1.14.0/go.mod h1:k9gnnRDj9A3E71aGKvAT6cZTTDQCQ1hHT9mu6ayNjkg= +github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.34.0 h1:e2NwGYwvTV2yNa76PRkQ/gtjEmnvCw9h6kRTNCg/PUI= +github.com/aws/aws-sdk-go-v2/service/timestreamquery v1.34.0/go.mod h1:DwajsOry3HW3LDuBdlkTA2YbZkOXl0lGqf/Tmh52RhU= +github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.34.0 h1:/Ec93n7oXPhZvalYxFphWMSNjaAy/A2dWkKhqCAePEg= +github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.34.0/go.mod h1:zR+5dzF2qJz6WneebK+JkFEheDRa8CbRKYs//5XycJU= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.51.0 h1:UMgzltOpkvNdZK15iptmssjAEWqKIffMTZRroY76MnA= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.51.0/go.mod h1:zKZY1p5qYRYG/NMOMv8GVeUJLliaK+EpgD9Q2q4v7O4= +github.com/aws/aws-sdk-go-v2/service/transfer v1.64.0 h1:QsCjJRBHeDHhOc0J+GIPxhHesz5yTSYXR1jyMWzXcNQ= +github.com/aws/aws-sdk-go-v2/service/transfer v1.64.0/go.mod h1:LYJ3Lj45sKL6TmHqQQGGzOBTUWjPvo9rqjYmMzbpIlY= +github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.27.0 h1:eGVvpr1n1sMvSnvYAQVUKK+JUPNFjUTy2iSR8nutPMc= +github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.27.0/go.mod h1:XHTOqO6Iy5JS7BTOT5fg5HvmMTxUJRksaypat8yHexw= +github.com/aws/aws-sdk-go-v2/service/vpclattice v1.17.0 h1:l/hNjnFe+0P+0YjVaYghBZDooc5OFJOx4c+hG/YyX5Y= +github.com/aws/aws-sdk-go-v2/service/vpclattice v1.17.0/go.mod h1:lVuOOAjNmWYyLy+pHYu0QzZ07u8b+0rfPXrQNJ48N9o= +github.com/aws/aws-sdk-go-v2/service/waf v1.29.0 h1:KiJHde7jxo8ppD7jcYopFKZ73of3SSyTbXRPifyCSjc= +github.com/aws/aws-sdk-go-v2/service/waf v1.29.0/go.mod h1:DVC3u2m55AWSV5tUmODpmG4gojAwO94Osa7YDLw9BCg= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.29.0 h1:gFCxExCqt4/HWMVKmzf+Mxt3i1gyovNNL8xlfVaN0a4= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.29.0/go.mod h1:brjH7E2LWOtLNsAupQL1Lv803e2xm3v+3wzqlX4BAOk= +github.com/aws/aws-sdk-go-v2/service/wafv2 v1.66.0 h1:zEbaP92GXITM2TrYiw4mNer/ViT4z/Zq8hmrIzSF3Y0= +github.com/aws/aws-sdk-go-v2/service/wafv2 v1.66.0/go.mod h1:EPNcb1lt/lfWkpjINo7eP5AwfvlG8ioVT9frx5w5k9s= +github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.38.0 h1:5+II3BO8cotBo0VNs3Ix2EakRC+PP//loHRaEKDQUNE= +github.com/aws/aws-sdk-go-v2/service/wellarchitected v1.38.0/go.mod h1:ObNr9KblAM/kLbDQAhRAqmi8sY5CPdEd9VqeyZxU79Y= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.62.0 h1:RLGywWWnKeGJkWlg1Su2jH7DCC7y7QD1zbgGU0IVmZY= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.62.0/go.mod h1:AJ7eKGcsgQ07kXJ4YWAf7PTFOvkoHc0Voh7CkAj9Bqk= +github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.31.0 h1:n4HU/6mkGI9nTgt5Q80hvLMWv4HeXwfx51Ux5lVkRTY= +github.com/aws/aws-sdk-go-v2/service/workspacesweb v1.31.0/go.mod h1:fCtcQlrmCiCA0BRxpkhrOCFPGDSi7YNw7IV+NS2bKyY= +github.com/aws/aws-sdk-go-v2/service/xray v1.34.0 h1:gFPqTmIg8UI0CcW0pk4LXT2BQK2osloIE6xf46p2144= +github.com/aws/aws-sdk-go-v2/service/xray v1.34.0/go.mod h1:zzWVXnnO820ouM6JAIv2dQa8p5rPTVOCRoEvkljwnnM= github.com/aws/smithy-go v1.22.5 h1:P9ATCXPMb2mPjYBgueqJNCA5S9UfktsW0tTxi+a7eqw= github.com/aws/smithy-go v1.22.5/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= github.com/beevik/etree v1.5.1 h1:TC3zyxYp+81wAmbsi8SWUpZCurbxa6S8RITYRSkNRwo= @@ -565,8 +571,8 @@ github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8 github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/cedar-policy/cedar-go v0.1.0 h1:2tZwWn8tNO/896YAM7OQmH3vn98EeHEA3g9anwdVZvA= -github.com/cedar-policy/cedar-go v0.1.0/go.mod h1:pEgiK479O5dJfzXnTguOMm+bCplzy5rEEFPGdZKPWz4= +github.com/cedar-policy/cedar-go v1.2.6 h1:q6f1sRxhoBG7lnK/fH6oBG33ruf2yIpcfcPXNExANa0= +github.com/cedar-policy/cedar-go v1.2.6/go.mod h1:h5+3CVW1oI5LXVskJG+my9TFCYI5yjh/+Ul3EJie6MI= github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= @@ -652,10 +658,10 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.23.0 h1:MUiBM1s0CNlRFsCLJuM5wXZrzA3MnPYEsiXmzATMW/I= github.com/hashicorp/terraform-exec v0.23.0/go.mod h1:mA+qnx1R8eePycfwKkCRk3Wy65mwInvlpAeOwmA7vlY= -github.com/hashicorp/terraform-json v0.25.0 h1:rmNqc/CIfcWawGiwXmRuiXJKEiJu1ntGoxseG1hLhoQ= -github.com/hashicorp/terraform-json v0.25.0/go.mod h1:sMKS8fiRDX4rVlR6EJUMudg1WcanxCMoWwTLkgZP/vc= -github.com/hashicorp/terraform-plugin-framework v1.15.0 h1:LQ2rsOfmDLxcn5EeIwdXFtr03FVsNktbbBci8cOKdb4= -github.com/hashicorp/terraform-plugin-framework v1.15.0/go.mod h1:hxrNI/GY32KPISpWqlCoTLM9JZsGH3CyYlir09bD/fI= +github.com/hashicorp/terraform-json v0.26.0 h1:+BnJavhRH+oyNWPnfzrfQwVWCZBFMvjdiH2Vi38Udz4= +github.com/hashicorp/terraform-json v0.26.0/go.mod h1:eyWCeC3nrZamyrKLFnrvwpc3LQPIJsx8hWHQ/nu2/v4= +github.com/hashicorp/terraform-plugin-framework v1.15.1 h1:2mKDkwb8rlx/tvJTlIcpw0ykcmvdWv+4gY3SIgk8Pq8= +github.com/hashicorp/terraform-plugin-framework v1.15.1/go.mod h1:hxrNI/GY32KPISpWqlCoTLM9JZsGH3CyYlir09bD/fI= github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0 h1:SJXL5FfJJm17554Kpt9jFXngdM6fXbnUnZ6iT2IeiYA= github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0/go.mod h1:p0phD0IYhsu9bR4+6OetVvvH59I6LwjXGnTVEr8ox6E= github.com/hashicorp/terraform-plugin-framework-timeouts v0.5.0 h1:I/N0g/eLZ1ZkLZXUQ0oRSXa8YG/EF0CEuQP1wXdrzKw= @@ -792,18 +798,20 @@ go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -821,25 +829,25 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/version/VERSION b/version/VERSION index ba92e72f5775..b81ba511f6db 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -6.6.1 \ No newline at end of file +6.9.1 \ No newline at end of file diff --git a/website/allowed-subcategories.txt b/website/allowed-subcategories.txt index 45c4b8b75701..36c1480daafd 100644 --- a/website/allowed-subcategories.txt +++ b/website/allowed-subcategories.txt @@ -26,6 +26,7 @@ BCM Data Exports Backup Batch Bedrock +Bedrock AgentCore Bedrock Agents Billing CE (Cost Explorer) @@ -174,6 +175,7 @@ Network Manager OpenSearch OpenSearch Ingestion OpenSearch Serverless +Oracle Database@AWS Organizations Outposts Outposts (EC2) @@ -207,6 +209,7 @@ S3 (Simple Storage) S3 Control S3 Glacier S3 Tables +S3 Vectors S3 on Outposts SES (Simple Email) SESv2 (Simple Email V2) diff --git a/website/docs/cdktf/python/d/cloudwatch_event_bus.html.markdown b/website/docs/cdktf/python/d/cloudwatch_event_bus.html.markdown index bc008641112b..5306eb852123 100644 --- a/website/docs/cdktf/python/d/cloudwatch_event_bus.html.markdown +++ b/website/docs/cdktf/python/d/cloudwatch_event_bus.html.markdown @@ -50,5 +50,8 @@ This data source exports the following attributes in addition to the arguments a * `description` - Event bus description. * `id` - Name of the event bus. * `kms_key_identifier` - Identifier of the AWS KMS customer managed key for EventBridge to use to encrypt events on this event bus, if one has been specified. +* `log_config` - Block for logging configuration settings for the event bus. + * `include_detail` - Whether EventBridge include detailed event information in the records it generates. + * `level` - Level of logging detail to include. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/codebuild_fleet.html.markdown b/website/docs/cdktf/python/d/codebuild_fleet.html.markdown index 402ee96b1556..0705a2fbc26f 100644 --- a/website/docs/cdktf/python/d/codebuild_fleet.html.markdown +++ b/website/docs/cdktf/python/d/codebuild_fleet.html.markdown @@ -84,6 +84,7 @@ This data source exports the following attributes in addition to the arguments a * `base_capacity` - Number of machines allocated to the fleet. * `compute_configuration` - Compute configuration of the compute fleet. * `disk` - Amount of disk space of the instance type included in the fleet. + * `instance_type` - EC2 instance type in the fleet. * `machine_type` - Machine type of the instance type included in the fleet. * `memory` - Amount of memory of the instance type included in the fleet. * `vcpu` - Number of vCPUs of the instance type included in the fleet. @@ -112,4 +113,4 @@ This data source exports the following attributes in addition to the arguments a * `subnets` - A list of one or more subnet IDs in your Amazon VPC. * `vpc_id` - The ID of the Amazon VPC. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ebs_volume.html.markdown b/website/docs/cdktf/python/d/ebs_volume.html.markdown index 4e490d7078b1..0016f04830ea 100644 --- a/website/docs/cdktf/python/d/ebs_volume.html.markdown +++ b/website/docs/cdktf/python/d/ebs_volume.html.markdown @@ -70,6 +70,7 @@ This data source exports the following attributes in addition to the arguments a * `throughput` - Throughput that the volume supports, in MiB/s. * `volume_id` - Volume ID (e.g., vol-59fcb34e). * `volume_type` - Type of EBS volume. +* `volume_initialization_rate` - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. ## Timeouts @@ -79,4 +80,4 @@ This data source exports the following attributes in addition to the arguments a [1]: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-volumes.html - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ecs_service.html.markdown b/website/docs/cdktf/python/d/ecs_service.html.markdown index 100f1d6488ab..02dd2c656a42 100644 --- a/website/docs/cdktf/python/d/ecs_service.html.markdown +++ b/website/docs/cdktf/python/d/ecs_service.html.markdown @@ -48,8 +48,28 @@ This data source exports the following attributes in addition to the arguments a * `arn` - ARN of the ECS Service * `desired_count` - Number of tasks for the ECS Service * `launch_type` - Launch type for the ECS Service +* `load_balancer` - Load balancers for the ECS Service. See [`load_balancer` Block](#load_balancer-block) for details. * `scheduling_strategy` - Scheduling strategy for the ECS Service * `task_definition` - Family for the latest ACTIVE revision or full ARN of the task definition. * `tags` - Resource tags. - \ No newline at end of file +### `load_balancer` Block + +The `load_balancer` block exports the following attributes: + +* `advanced_configuration` - Settings for Blue/Green deployment. See [`advanced_configuration` Block](#advanced_configuration-block) for details. +* `container_name` - Name of the container to associate with the load balancer. +* `container_port` - Port on the container to associate with the load balancer. +* `elb_name` - Name of the load balancer. +* `target_group_arn` - ARN of the target group to associate with the load balancer. + +### `advanced_configuration` Block + +The `advanced_configuration` block exports the following attributes: + +* `alternate_target_group_arn` - ARN of the alternate target group to use for Blue/Green deployments. +* `production_listener_rule` - ARN of the listener rule that routes production traffic. +* `role_arn` - ARN of the IAM role that allows ECS to manage the target groups. +* `test_listener_rule` - ARN of the listener rule that routes test traffic. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_cluster_versions.html.markdown b/website/docs/cdktf/python/d/eks_cluster_versions.html.markdown index c652c6d2a3ea..4e34ce4c7a40 100644 --- a/website/docs/cdktf/python/d/eks_cluster_versions.html.markdown +++ b/website/docs/cdktf/python/d/eks_cluster_versions.html.markdown @@ -19,7 +19,7 @@ Terraform data source for managing AWS EKS (Elastic Kubernetes) Cluster Versions ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct -from cdktf import TerraformStack +from cdktf import TerraformOutput, TerraformStack # # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. @@ -28,7 +28,16 @@ from imports.aws.data_aws_eks_cluster_versions import DataAwsEksClusterVersions class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataAwsEksClusterVersions(self, "example") + example = DataAwsEksClusterVersions(self, "example") + TerraformOutput(self, "eks_cluster_version_filtered", + value="${[ for version in ${" + example.cluster_versions + "} : version if version.cluster_version == \"1.33\"]}" + ) + TerraformOutput(self, "eks_cluster_version_list", + value="${[ for version in ${" + example.cluster_versions + "} : version.cluster_version]}" + ) + TerraformOutput(self, "eks_cluster_versions", + value=example.cluster_versions + ) ``` ### Filter by Cluster Type @@ -76,7 +85,6 @@ The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `cluster_type` - (Optional) Type of clusters to filter by. Currently, the only valid value is `eks`. -* `cluster_versions` - (Optional) A list of Kubernetes versions that you can use to check if EKS supports it. * `default_only` - (Optional) Whether to show only the default versions of Kubernetes supported by EKS. * `include_all` - (Optional) Whether to include all kubernetes versions in the response. * `version_status` - (Optional) Status of the EKS cluster versions to list. @@ -86,14 +94,15 @@ Valid values are `STANDARD_SUPPORT` or `UNSUPPORTED` or `EXTENDED_SUPPORT`. This data source exports the following attributes in addition to the arguments above: -* `cluster_type` - Type of cluster that the version belongs to. -* `cluster_version` - Kubernetes version supported by EKS. -* `default_platform_version` - Default eks platform version for the cluster version. -* `default_version` - Default Kubernetes version for the cluster version. -* `end_of_extended_support_date` - End of extended support date for the cluster version. -* `end_of_standard_support_date` - End of standard support date for the cluster version. -* `kubernetes_patch_version` - Kubernetes patch version for the cluster version. -* `release_date` - Release date of the cluster version. -* `version_status` - Status of the EKS cluster version. - - \ No newline at end of file +* `cluster_versions` - A list of Kubernetes version information. + * `cluster_type` - Type of cluster that the version belongs to. + * `cluster_version` - Kubernetes version supported by EKS. + * `default_platform_version` - Default eks platform version for the cluster version. + * `default_version` - Default Kubernetes version for the cluster version. + * `end_of_extended_support_date` - End of extended support date for the cluster version. + * `end_of_standard_support_date` - End of standard support date for the cluster version. + * `kubernetes_patch_version` - Kubernetes patch version for the cluster version. + * `release_date` - Release date of the cluster version. + * `version_status` - Status of the EKS cluster version. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/quicksight_analysis.html.markdown b/website/docs/cdktf/python/d/quicksight_analysis.html.markdown index 9346916c5fa5..d1e9d1c6fbad 100644 --- a/website/docs/cdktf/python/d/quicksight_analysis.html.markdown +++ b/website/docs/cdktf/python/d/quicksight_analysis.html.markdown @@ -37,9 +37,9 @@ class MyConvertedCode(TerraformStack): This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `analysis_id` - (Required) Identifier for the analysis. -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -48,4 +48,4 @@ This data source exports the following attributes in addition to the arguments a See the [Analysis Resource](/docs/providers/aws/r/quicksight_analysis.html) for details on the returned attributes - they are identical. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/quicksight_data_set.html.markdown b/website/docs/cdktf/python/d/quicksight_data_set.html.markdown index d785ebdbc583..e876f35376df 100644 --- a/website/docs/cdktf/python/d/quicksight_data_set.html.markdown +++ b/website/docs/cdktf/python/d/quicksight_data_set.html.markdown @@ -37,9 +37,9 @@ class MyConvertedCode(TerraformStack): This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `data_set_id` - (Required) Identifier for the data set. -* `aws_account_id` - (Optional) AWS account ID. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -48,4 +48,4 @@ This data source exports the following attributes in addition to the arguments a See the [Data Set Resource](/docs/providers/aws/r/quicksight_data_set.html) for details on the returned attributes - they are identical. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/quicksight_group.html.markdown b/website/docs/cdktf/python/d/quicksight_group.html.markdown index fb4ce7c655dd..d963834e80d8 100644 --- a/website/docs/cdktf/python/d/quicksight_group.html.markdown +++ b/website/docs/cdktf/python/d/quicksight_group.html.markdown @@ -43,9 +43,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -55,4 +55,4 @@ This data source exports the following attributes in addition to the arguments a * `description` - The group description. * `principal_id` - The principal ID of the group. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/quicksight_theme.html.markdown b/website/docs/cdktf/python/d/quicksight_theme.html.markdown index bfa79839d92e..595ad5b8d278 100644 --- a/website/docs/cdktf/python/d/quicksight_theme.html.markdown +++ b/website/docs/cdktf/python/d/quicksight_theme.html.markdown @@ -41,8 +41,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - AWS account ID. ## Attribute Reference @@ -132,4 +132,4 @@ This data source exports the following attributes in addition to the arguments a * `warning` - Color (hexadecimal) that applies to warning and informational messages. * `warning_foreground` - Color (hexadecimal) that applies to any text or other elements that appear over the warning color. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/quicksight_user.html.markdown b/website/docs/cdktf/python/d/quicksight_user.html.markdown index 243bf60388e9..3100d77c6635 100644 --- a/website/docs/cdktf/python/d/quicksight_user.html.markdown +++ b/website/docs/cdktf/python/d/quicksight_user.html.markdown @@ -43,9 +43,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -53,6 +53,7 @@ This data source exports the following attributes in addition to the arguments a * `active` - The active status of user. When you create an Amazon QuickSight user that’s not an IAM user or an Active Directory user, that user is inactive until they sign in and provide a password. * `arn` - The Amazon Resource Name (ARN) for the user. +* `custom_permissions_name` - The custom permissions profile associated with this user. * `email` - The user's email address. * `identity_type` - The type of identity authentication used by the user. * `principal_id` - The principal ID of the user. @@ -61,4 +62,4 @@ This data source exports the following attributes in addition to the arguments a - `AUTHOR`: A user who can create data sources, datasets, analyzes, and dashboards. - `ADMIN`: A user who is an author, who can also manage Amazon QuickSight settings. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/s3_access_point.html.markdown b/website/docs/cdktf/python/d/s3_access_point.html.markdown index bb3b70d104af..d20f8b51fb85 100644 --- a/website/docs/cdktf/python/d/s3_access_point.html.markdown +++ b/website/docs/cdktf/python/d/s3_access_point.html.markdown @@ -56,7 +56,8 @@ This data source exports the following attributes in addition to the arguments a * `block_public_policy` - Whether Amazon S3 blocks public bucket policies for buckets in this account. * `ignore_public_acls` - Whether Amazon S3 ignores public ACLs for buckets in this account. * `restrict_public_buckets` - Whether Amazon S3 restricts public bucket policies for buckets in this account. +* `tags` - Tags assigned to the access point. * `vpc_configuration` - VPC configuration for the access point. * `vpc_id` - Access point will only allow connections from this VPC. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssm_patch_baseline.html.markdown b/website/docs/cdktf/python/d/ssm_patch_baseline.html.markdown index 0312b5995332..39a9a8626a4d 100644 --- a/website/docs/cdktf/python/d/ssm_patch_baseline.html.markdown +++ b/website/docs/cdktf/python/d/ssm_patch_baseline.html.markdown @@ -85,6 +85,7 @@ This data source exports the following attributes in addition to the arguments a * `patch_filter` - Patch filter group that defines the criteria for the rule. * `key` - Key for the filter. * `values` - Value for the filter. +* `available_security_updates_compliance_status` - Indicates the compliance status of managed nodes for which security-related patches are available but were not approved. Supported for Windows Server managed nodes only. * `global_filter` - Set of global filters used to exclude patches from the baseline. * `key` - Key for the filter. * `values` - Value for the filter. @@ -99,4 +100,4 @@ This data source exports the following attributes in addition to the arguments a * `name` - Name specified to identify the patch source. * `products` - Specific operating system versions a patch repository applies to. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/verifiedpermissions_policy_store.html.markdown b/website/docs/cdktf/python/d/verifiedpermissions_policy_store.html.markdown index ba19b654b6f6..32fb1b61a972 100644 --- a/website/docs/cdktf/python/d/verifiedpermissions_policy_store.html.markdown +++ b/website/docs/cdktf/python/d/verifiedpermissions_policy_store.html.markdown @@ -46,8 +46,9 @@ This data source exports the following attributes in addition to the arguments a * `arn` - The ARN of the Policy Store. * `created_date` - The date the Policy Store was created. +* `deletion_protection` - Whether the policy store can be deleted. * `last_updated_date` - The date the Policy Store was last updated. * `tags` - Map of key-value pairs associated with the policy store. * `validation_settings` - Validation settings for the policy store. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/wafv2_web_acl.html.markdown b/website/docs/cdktf/python/d/wafv2_web_acl.html.markdown index cd1f5ad322af..fc054c899e3c 100644 --- a/website/docs/cdktf/python/d/wafv2_web_acl.html.markdown +++ b/website/docs/cdktf/python/d/wafv2_web_acl.html.markdown @@ -14,6 +14,8 @@ Retrieves the summary of a WAFv2 Web ACL. ## Example Usage +### Lookup by name + ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct @@ -32,12 +34,37 @@ class MyConvertedCode(TerraformStack): ) ``` +### Lookup by associated resource + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_wafv2_web_acl import DataAwsWafv2WebAcl +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsWafv2WebAcl(self, "alb_example", + resource_arn="arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx", + scope="REGIONAL" + ) + DataAwsWafv2WebAcl(self, "cloudfront_example", + resource_arn="arn:aws:cloudfront::123456789012:distribution/XXX", + scope="CLOUDFRONT" + ) +``` + ## Argument Reference This data source supports the following arguments: +* `name` - (Optional) Name of the WAFv2 Web ACL. Exactly one of `name` or `resource_arn` must be specified. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `name` - (Required) Name of the WAFv2 Web ACL. +* `resource_arn` - (Optional) ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of `name` or `resource_arn` must be specified. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. ## Attribute Reference @@ -48,4 +75,4 @@ This data source exports the following attributes in addition to the arguments a * `description` - Description of the WebACL that helps with identification. * `id` - Unique identifier of the WebACL. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/guides/custom-service-endpoints.html.markdown b/website/docs/cdktf/python/guides/custom-service-endpoints.html.markdown index 57807f87cf16..21e16d2a0380 100644 --- a/website/docs/cdktf/python/guides/custom-service-endpoints.html.markdown +++ b/website/docs/cdktf/python/guides/custom-service-endpoints.html.markdown @@ -135,6 +135,7 @@ class MyConvertedCode(TerraformStack): |BCM Data Exports|`bcmdataexports`|`AWS_ENDPOINT_URL_BCM_DATA_EXPORTS`|`bcm_data_exports`| |Bedrock|`bedrock`|`AWS_ENDPOINT_URL_BEDROCK`|`bedrock`| |Bedrock Agents|`bedrockagent`|`AWS_ENDPOINT_URL_BEDROCK_AGENT`|`bedrock_agent`| +|Bedrock AgentCore|`bedrockagentcore`|`AWS_ENDPOINT_URL_BEDROCK_AGENTCORE_CONTROL`|`bedrock_agentcore_control`| |Billing|`billing`|`AWS_ENDPOINT_URL_BILLING`|`billing`| |Web Services Budgets|`budgets`|`AWS_ENDPOINT_URL_BUDGETS`|`budgets`| |CE (Cost Explorer)|`ce`(or `costexplorer`)|`AWS_ENDPOINT_URL_COST_EXPLORER`|`cost_explorer`| @@ -274,6 +275,7 @@ class MyConvertedCode(TerraformStack): |User Notifications|`notifications`|`AWS_ENDPOINT_URL_NOTIFICATIONS`|`notifications`| |User Notifications Contacts|`notificationscontacts`|`AWS_ENDPOINT_URL_NOTIFICATIONSCONTACTS`|`notificationscontacts`| |CloudWatch Observability Access Manager|`oam`(or `cloudwatchobservabilityaccessmanager`)|`AWS_ENDPOINT_URL_OAM`|`oam`| +|Oracle Database@AWS|`odb`|`AWS_ENDPOINT_URL_ODB`|`odb`| |OpenSearch|`opensearch`(or `opensearchservice`)|`AWS_ENDPOINT_URL_OPENSEARCH`|`opensearch`| |OpenSearch Serverless|`opensearchserverless`|`AWS_ENDPOINT_URL_OPENSEARCHSERVERLESS`|`opensearchserverless`| |Organizations|`organizations`|`AWS_ENDPOINT_URL_ORGANIZATIONS`|`organizations`| @@ -313,6 +315,7 @@ class MyConvertedCode(TerraformStack): |S3 Control|`s3control`|`AWS_ENDPOINT_URL_S3_CONTROL`|`s3_control`| |S3 on Outposts|`s3outposts`|`AWS_ENDPOINT_URL_S3OUTPOSTS`|`s3outposts`| |S3 Tables|`s3tables`|`AWS_ENDPOINT_URL_S3TABLES`|`s3tables`| +|S3 Vectors|`s3vectors`|`AWS_ENDPOINT_URL_S3VECTORS`|`s3vectors`| |SageMaker AI|`sagemaker`|`AWS_ENDPOINT_URL_SAGEMAKER`|`sagemaker`| |EventBridge Scheduler|`scheduler`|`AWS_ENDPOINT_URL_SCHEDULER`|`scheduler`| |EventBridge Schemas|`schemas`|`AWS_ENDPOINT_URL_SCHEMAS`|`schemas`| @@ -456,4 +459,4 @@ class MyConvertedCode(TerraformStack): ) ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index cb8a24d5cfc8..1ec4ed0f1fd8 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -13,7 +13,7 @@ Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. You must configure the provider with the proper credentials before you can use it. -Use the navigation to the left to read about the available resources. There are currently 1509 resources and 608 data sources available in the provider. +Use the navigation to the left to read about the available resources. There are currently 1516 resources and 609 data sources available in the provider. To learn the basics of Terraform using this provider, follow the hands-on [get started tutorials](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code?in=terraform/aws-get-started&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). Interact with AWS services, @@ -902,4 +902,4 @@ Approaches differ per authentication providers: There used to be no better way to get account ID out of the API when using the federated account until `sts:GetCallerIdentity` was introduced. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/appsync_source_api_association.html.markdown b/website/docs/cdktf/python/r/appsync_source_api_association.html.markdown index d25761b33196..64b3e3e92f0d 100644 --- a/website/docs/cdktf/python/r/appsync_source_api_association.html.markdown +++ b/website/docs/cdktf/python/r/appsync_source_api_association.html.markdown @@ -3,13 +3,13 @@ subcategory: "AppSync" layout: "aws" page_title: "AWS: aws_appsync_source_api_association" description: |- - Terraform resource for managing an AWS AppSync Source Api Association. + Terraform resource for managing an AWS AppSync Source API Association. --- # Resource: aws_appsync_source_api_association -Terraform resource for managing an AWS AppSync Source Api Association. +Terraform resource for managing an AWS AppSync Source API Association. ## Example Usage @@ -55,9 +55,9 @@ The `source_api_association_config` configuration block supports the following a This resource exports the following attributes in addition to the arguments above: -* `arn` - ARN of the Source Api Association. -* `association_id` - ID of the Source Api Association. -* `id` - Combined ID of the Source Api Association and Merge Api. +* `arn` - ARN of the Source API Association. +* `association_id` - ID of the Source API Association. +* `id` - Combined ID of the Source API Association and Merge API. ## Timeouts @@ -69,7 +69,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source Api Association using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source API Association using the `association_id` and `merged_api_id` separated by `,`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -86,10 +86,10 @@ class MyConvertedCode(TerraformStack): AppsyncSourceApiAssociation.generate_config_for_import(self, "example", "gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31") ``` -Using `terraform import`, import AppSync Source Api Association using the `gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31`. For example: +Using `terraform import`, import AppSync Source API Association using the `association_id` and `merged_api_id` separated by `,`. For example: ```console % terraform import aws_appsync_source_api_association.example gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/athena_database.html.markdown b/website/docs/cdktf/python/r/athena_database.html.markdown index 6c7ee8e6aa39..ba8302c0c379 100644 --- a/website/docs/cdktf/python/r/athena_database.html.markdown +++ b/website/docs/cdktf/python/r/athena_database.html.markdown @@ -51,6 +51,7 @@ This resource supports the following arguments: * `expected_bucket_owner` - (Optional) AWS account ID that you expect to be the owner of the Amazon S3 bucket. * `force_destroy` - (Optional, Default: false) Boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are *not* recoverable. * `properties` - (Optional) Key-value map of custom metadata properties for the database definition. +* `workgroup` - (Optional) Name of the workgroup. ### ACL Configuration @@ -118,4 +119,4 @@ class MyConvertedCode(TerraformStack): ) ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/athena_workgroup.html.markdown b/website/docs/cdktf/python/r/athena_workgroup.html.markdown index b61ec331d0c1..9395a708f015 100644 --- a/website/docs/cdktf/python/r/athena_workgroup.html.markdown +++ b/website/docs/cdktf/python/r/athena_workgroup.html.markdown @@ -59,19 +59,25 @@ This resource supports the following arguments: * `bytes_scanned_cutoff_per_query` - (Optional) Integer for the upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. Must be at least `10485760`. * `enforce_workgroup_configuration` - (Optional) Boolean whether the settings for the workgroup override client-side settings. For more information, see [Workgroup Settings Override Client-Side Settings](https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). Defaults to `true`. * `engine_version` - (Optional) Configuration block for the Athena Engine Versioning. For more information, see [Athena Engine Versioning](https://docs.aws.amazon.com/athena/latest/ug/engine-versions.html). See [Engine Version](#engine-version) below. -* `execution_role` - (Optional) Role used in a notebook session for accessing the user's resources. +* `execution_role` - (Optional) Role used to access user resources in notebook sessions and IAM Identity Center enabled workgroups. The property is required for IAM Identity Center enabled workgroups. +* `identity_center_configuration` - (Optional) Configuration block to set up an IAM Identity Center enabled workgroup. See [Identity Center Configuration](#identity-center-configuration) below. * `publish_cloudwatch_metrics_enabled` - (Optional) Boolean whether Amazon CloudWatch metrics are enabled for the workgroup. Defaults to `true`. -* `result_configuration` - (Optional) Configuration block with result settings. See [Result Configuration](#result-configuration) below. * `requester_pays_enabled` - (Optional) If set to true , allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false , workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false . For more information about Requester Pays buckets, see [Requester Pays Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) in the Amazon Simple Storage Service Developer Guide. +* `result_configuration` - (Optional) Configuration block with result settings. See [Result Configuration](#result-configuration) below. #### Engine Version * `selected_engine_version` - (Optional) Requested engine version. Defaults to `AUTO`. +#### Identity Center Configuration + +* `enable_identity_center` - (Optional) Specifies whether the workgroup is IAM Identity Center supported. +* `identity_center_instance_arn` - (Optional) The IAM Identity Center instance ARN that the workgroup associates to. + #### Result Configuration -* `encryption_configuration` - (Optional) Configuration block with encryption settings. See [Encryption Configuration](#encryption-configuration) below. * `acl_configuration` - (Optional) That an Amazon S3 canned ACL should be set to control ownership of stored query results. See [ACL Configuration](#acl-configuration) below. +* `encryption_configuration` - (Optional) Configuration block with encryption settings. See [Encryption Configuration](#encryption-configuration) below. * `expected_bucket_owner` - (Optional) AWS account ID that you expect to be the owner of the Amazon S3 bucket. * `output_location` - (Optional) Location in Amazon S3 where your query results are stored, such as `s3://path/to/query/bucket/`. For more information, see [Queries and Query Result Files](https://docs.aws.amazon.com/athena/latest/ug/querying.html). @@ -120,4 +126,4 @@ Using `terraform import`, import Athena Workgroups using their name. For example % terraform import aws_athena_workgroup.example example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/bedrock_guardrail.html.markdown b/website/docs/cdktf/python/r/bedrock_guardrail.html.markdown index 7b51d4938cab..e7b04b5940da 100644 --- a/website/docs/cdktf/python/r/bedrock_guardrail.html.markdown +++ b/website/docs/cdktf/python/r/bedrock_guardrail.html.markdown @@ -36,15 +36,23 @@ resource "aws_bedrock_guardrail" "example" { sensitive_information_policy_config { pii_entities_config { - action = "BLOCK" - type = "NAME" + action = "BLOCK" + input_action = "BLOCK" + output_action = "ANONYMIZE" + input_enabled = true + output_enabled = true + type = "NAME" } regexes_config { - action = "BLOCK" - description = "example regex" - name = "regex_example" - pattern = "^\\d{3}-\\d{2}-\\d{4}$" + action = "BLOCK" + input_action = "BLOCK" + output_action = "BLOCK" + input_enabled = true + output_enabled = false + description = "example regex" + name = "regex_example" + pattern = "^\\d{3}-\\d{2}-\\d{4}$" } } @@ -157,13 +165,21 @@ The `tier_config` configuration block supports the following arguments: #### PII Entities Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_action` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_enabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. +* `output_action` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `output_enabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `type` (Required) The currently supported PII entities. #### Regexes Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_action` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_enabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. * `name` (Required) The regex name. +* `output_action` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `output_enabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `pattern` (Required) The regex pattern. * `description` (Optional) The regex description. @@ -223,4 +239,4 @@ Using `terraform import`, import Amazon Bedrock Guardrail using using a comma-de % terraform import aws_bedrock_guardrail.example guardrail-id-12345678,DRAFT ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/bedrock_inference_profile.html.markdown b/website/docs/cdktf/python/r/bedrock_inference_profile.html.markdown index 31a77ee4c3f4..f699f826b912 100644 --- a/website/docs/cdktf/python/r/bedrock_inference_profile.html.markdown +++ b/website/docs/cdktf/python/r/bedrock_inference_profile.html.markdown @@ -88,7 +88,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `name`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -105,10 +105,10 @@ class MyConvertedCode(TerraformStack): BedrockInferenceProfile.generate_config_for_import(self, "example", "inference_profile-id-12345678") ``` -Using `terraform import`, import Bedrock Inference Profile using the `example_id_arg`. For example: +Using `terraform import`, import Bedrock Inference Profile using the `name`. For example: ```console % terraform import aws_bedrock_inference_profile.example inference_profile-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/cleanrooms_collaboration.html.markdown b/website/docs/cdktf/python/r/cleanrooms_collaboration.html.markdown index 49d94e0ccc63..1042dc98bfa5 100644 --- a/website/docs/cdktf/python/r/cleanrooms_collaboration.html.markdown +++ b/website/docs/cdktf/python/r/cleanrooms_collaboration.html.markdown @@ -10,13 +10,11 @@ description: |- # Resource: aws_cleanrooms_collaboration -Provides a AWS Clean Rooms collaboration. All members included in the definition will be invited to -join the collaboration and can create memberships. +Provides a AWS Clean Rooms collaboration. +All members included in the definition will be invited to join the collaboration and can create memberships. ## Example Usage -### Collaboration with tags - ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct @@ -30,6 +28,7 @@ class MyConvertedCode(TerraformStack): def __init__(self, scope, name, *, memberAbilities): super().__init__(scope, name) CleanroomsCollaboration(self, "test_collaboration", + analytics_engine="SPARK", creator_display_name="Creator ", creator_member_abilities=["CAN_QUERY", "CAN_RECEIVE_RESULTS"], data_encryption_metadata=CleanroomsCollaborationDataEncryptionMetadata( @@ -55,15 +54,18 @@ class MyConvertedCode(TerraformStack): ## Argument Reference -This resource supports the following arguments: +The following arguments are required: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `name` - (Required) - The name of the collaboration. Collaboration names do not need to be unique. * `description` - (Required) - A description for a collaboration. * `creator_member_abilities` - (Required - Forces new resource) - The list of member abilities for the creator of the collaboration. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-creatorMemberAbilities). * `creator_display_name` - (Required - Forces new resource) - The name for the member record for the collaboration creator. * `query_log_status` - (Required - Forces new resource) - Determines if members of the collaboration can enable query logs within their own. emberships. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-queryLogStatus). + +The following arguments are optional: + +* `analytics_engine` - (Optional) Analytics engine used by the collaboration. Valid values are `CLEAN_ROOMS_SQL` (deprecated) and `SPARK`. * `data_encryption_metadata` - (Required - Forces new resource) - a collection of settings which determine how the [c3r client](https://docs.aws.amazon.com/clean-rooms/latest/userguide/crypto-computing.html) will encrypt data for use within this collaboration. * `data_encryption_metadata.allow_clear_text` - (Required - Forces new resource) - Indicates whether encrypted tables can contain cleartext data. This is a boolea field. @@ -77,17 +79,18 @@ or cryptographically processed (false). * `member.account_id` - (Required - Forces new resource) - The account id for the invited member. * `member.display_name` - (Required - Forces new resource) - The display name for the invited member. * `member.member_abilities` - (Required - Forces new resource) - The list of abilities for the invited member. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-creatorMemberAbilities). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) - Key value pairs which tag the collaboration. ## Attribute Reference This resource exports the following attributes in addition to the arguments above: -* `arn` - The arn of the collaboration. -* `id` - The id of the collaboration. -* `create_time` - The date and time the collaboration was created. +* `arn` - ARN of the collaboration. +* `id` - ID of the collaboration. +* `create_time` - Date and time the collaboration was created. * `member status` - For each member included in the collaboration an additional computed attribute of status is added. These values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_MemberSummary.html#API-Type-MemberSummary-status). -* `updated_time` - The date and time the collaboration was last updated. +* `updated_time` - Date and time the collaboration was last updated. ## Timeouts @@ -122,4 +125,4 @@ Using `terraform import`, import `aws_cleanrooms_collaboration` using the `id`. % terraform import aws_cleanrooms_collaboration.collaboration 1234abcd-12ab-34cd-56ef-1234567890ab ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/cloudfront_function.html.markdown b/website/docs/cdktf/python/r/cloudfront_function.html.markdown index 9d5a3d127da1..7f66cfe10d2a 100644 --- a/website/docs/cdktf/python/r/cloudfront_function.html.markdown +++ b/website/docs/cdktf/python/r/cloudfront_function.html.markdown @@ -53,7 +53,7 @@ The following arguments are optional: * `comment` - (Optional) Comment. * `publish` - (Optional) Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`. -* `key_value_store_associations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to on key value store per function. +* `key_value_store_associations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to one key value store per function. ## Attribute Reference @@ -89,4 +89,4 @@ Using `terraform import`, import CloudFront Functions using the `name`. For exam % terraform import aws_cloudfront_function.test my_test_function ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/cloudfrontkeyvaluestore_key.html.markdown b/website/docs/cdktf/python/r/cloudfrontkeyvaluestore_key.html.markdown index 57ef50dfd362..58337a4b5b99 100644 --- a/website/docs/cdktf/python/r/cloudfrontkeyvaluestore_key.html.markdown +++ b/website/docs/cdktf/python/r/cloudfrontkeyvaluestore_key.html.markdown @@ -61,7 +61,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `key_value_store_arn` and 'key' separated by `,`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -78,10 +78,10 @@ class MyConvertedCode(TerraformStack): CloudfrontkeyvaluestoreKey.generate_config_for_import(self, "example", "arn:aws:cloudfront::111111111111:key-value-store/8562g61f-caba-2845-9d99-b97diwae5d3c,someKey") ``` -Using `terraform import`, import CloudFront KeyValueStore Key using the `id`. For example: +Using `terraform import`, import CloudFront KeyValueStore Key using the `key_value_store_arn` and 'key' separated by `,`. For example: ```console % terraform import aws_cloudfrontkeyvaluestore_key.example arn:aws:cloudfront::111111111111:key-value-store/8562g61f-caba-2845-9d99-b97diwae5d3c,someKey ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/cloudwatch_event_bus.html.markdown b/website/docs/cdktf/python/r/cloudwatch_event_bus.html.markdown index f13792db62aa..dd6d288a8f13 100644 --- a/website/docs/cdktf/python/r/cloudwatch_event_bus.html.markdown +++ b/website/docs/cdktf/python/r/cloudwatch_event_bus.html.markdown @@ -16,6 +16,8 @@ Provides an EventBridge event bus resource. ## Example Usage +### Basic Usages + ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct @@ -58,6 +60,229 @@ class MyConvertedCode(TerraformStack): aws_cloudwatch_event_bus_examplepartner.override_logical_id("examplepartner") ``` +### Logging to CloudWatch Logs, S3, and Data Firehose + +See [Configuring logs for Amazon EventBridge event buses](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus-logs.html) for more details. + +#### Required Resources + +* EventBridge Event Bus with `log_config` configured +* Log destinations: + + * CloudWatch Logs log group + * S3 bucket + * Data Firehose delivery stream + +* Resource-based policy or tagging for the service-linked role: + + * CloudWatch Logs log group - `aws_cloudwatch_log_resource_policy` to allow `delivery.logs.amazonaws.com` to put logs into the log group + * S3 bucket - `aws_s3_bucket_policy` to allow `delivery.logs.amazonaws.com` to put logs into the bucket + * Data Firehose delivery stream - tagging the delivery stream with `LogDeliveryEnabled = "true"` to allow the service-linked role `AWSServiceRoleForLogDelivery` to deliver logs + +* CloudWatch Logs Delivery: + + * `aws_cloudwatch_log_delivery_source` for each log type (INFO, ERROR, TRACE) + * `aws_cloudwatch_log_delivery_destination` for the log destination (S3 bucket, CloudWatch Logs log group, or Data Firehose delivery stream) + * `aws_cloudwatch_log_delivery` to link each log type’s delivery source to the delivery destination + +#### Example Usage + +The following example demonstrates how to set up logging for an EventBridge event bus to all three destinations: CloudWatch Logs, S3, and Data Firehose. + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.cloudwatch_event_bus import CloudwatchEventBus +from imports.aws.cloudwatch_log_delivery import CloudwatchLogDelivery +from imports.aws.cloudwatch_log_delivery_destination import CloudwatchLogDeliveryDestination +from imports.aws.cloudwatch_log_delivery_source import CloudwatchLogDeliverySource +from imports.aws.cloudwatch_log_group import CloudwatchLogGroup +from imports.aws.cloudwatch_log_resource_policy import CloudwatchLogResourcePolicy +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.kinesis_firehose_delivery_stream import KinesisFirehoseDeliveryStream +from imports.aws.s3_bucket import S3Bucket +from imports.aws.s3_bucket_policy import S3BucketPolicy +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, destination, name): + super().__init__(scope, name) + example = CloudwatchEventBus(self, "example", + log_config=CloudwatchEventBusLogConfig( + include_detail="FULL", + level="TRACE" + ), + name="example-event-bus" + ) + error_logs = CloudwatchLogDeliverySource(self, "error_logs", + log_type="ERROR_LOGS", + name="EventBusSource-${" + example.name + "}-ERROR_LOGS", + resource_arn=example.arn + ) + info_logs = CloudwatchLogDeliverySource(self, "info_logs", + log_type="INFO_LOGS", + name="EventBusSource-${" + example.name + "}-INFO_LOGS", + resource_arn=example.arn + ) + trace_logs = CloudwatchLogDeliverySource(self, "trace_logs", + log_type="TRACE_LOGS", + name="EventBusSource-${" + example.name + "}-TRACE_LOGS", + resource_arn=example.arn + ) + event_bus_logs = CloudwatchLogGroup(self, "event_bus_logs", + name="/aws/vendedlogs/events/event-bus/${" + example.name + "}" + ) + cloudfront_logs = KinesisFirehoseDeliveryStream(self, "cloudfront_logs", + tags={ + "LogDeliveryEnabled": "true" + }, + destination=destination, + name=name + ) + aws_s3_bucket_example = S3Bucket(self, "example_6", + bucket="example-event-bus-logs" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_s3_bucket_example.override_logical_id("example") + current = DataAwsCallerIdentity(self, "current") + bucket = DataAwsIamPolicyDocument(self, "bucket", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["s3:PutObject"], + condition=[DataAwsIamPolicyDocumentStatementCondition( + test="StringEquals", + values=["bucket-owner-full-control"], + variable="s3:x-amz-acl" + ), DataAwsIamPolicyDocumentStatementCondition( + test="StringEquals", + values=[Token.as_string(current.account_id)], + variable="aws:SourceAccount" + ), DataAwsIamPolicyDocumentStatementCondition( + test="ArnLike", + values=[info_logs.arn, error_logs.arn, trace_logs.arn], + variable="aws:SourceArn" + ) + ], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["delivery.logs.amazonaws.com"], + type="Service" + ) + ], + resources=["${" + aws_s3_bucket_example.arn + "}/AWSLogs/${" + current.account_id + "}/EventBusLogs/*" + ] + ) + ] + ) + cwlogs = DataAwsIamPolicyDocument(self, "cwlogs", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["logs:CreateLogStream", "logs:PutLogEvents"], + condition=[DataAwsIamPolicyDocumentStatementCondition( + test="StringEquals", + values=[Token.as_string(current.account_id)], + variable="aws:SourceAccount" + ), DataAwsIamPolicyDocumentStatementCondition( + test="ArnLike", + values=[info_logs.arn, error_logs.arn, trace_logs.arn], + variable="aws:SourceArn" + ) + ], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["delivery.logs.amazonaws.com"], + type="Service" + ) + ], + resources=["${" + event_bus_logs.arn + "}:log-stream:*"] + ) + ] + ) + aws_cloudwatch_log_delivery_destination_cwlogs = + CloudwatchLogDeliveryDestination(self, "cwlogs_10", + delivery_destination_configuration=[CloudwatchLogDeliveryDestinationDeliveryDestinationConfiguration( + destination_resource_arn=event_bus_logs.arn + ) + ], + name="EventsDeliveryDestination-${" + example.name + "}-CWLogs" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_cloudwatch_log_delivery_destination_cwlogs.override_logical_id("cwlogs") + firehose = CloudwatchLogDeliveryDestination(self, "firehose", + delivery_destination_configuration=[CloudwatchLogDeliveryDestinationDeliveryDestinationConfiguration( + destination_resource_arn=cloudfront_logs.arn + ) + ], + name="EventsDeliveryDestination-${" + example.name + "}-Firehose" + ) + s3 = CloudwatchLogDeliveryDestination(self, "s3", + delivery_destination_configuration=[CloudwatchLogDeliveryDestinationDeliveryDestinationConfiguration( + destination_resource_arn=Token.as_string(aws_s3_bucket_example.arn) + ) + ], + name="EventsDeliveryDestination-${" + example.name + "}-S3" + ) + aws_cloudwatch_log_resource_policy_example = + CloudwatchLogResourcePolicy(self, "example_13", + policy_document=Token.as_string(cwlogs.json), + policy_name="AWSLogDeliveryWrite-${" + example.name + "}" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_cloudwatch_log_resource_policy_example.override_logical_id("example") + aws_s3_bucket_policy_example = S3BucketPolicy(self, "example_14", + bucket=Token.as_string(aws_s3_bucket_example.bucket), + policy=Token.as_string(bucket.json) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_s3_bucket_policy_example.override_logical_id("example") + s3_info_logs = CloudwatchLogDelivery(self, "s3_info_logs", + delivery_destination_arn=s3.arn, + delivery_source_name=info_logs.name + ) + cwlogs_info_logs = CloudwatchLogDelivery(self, "cwlogs_info_logs", + delivery_destination_arn=Token.as_string(aws_cloudwatch_log_delivery_destination_cwlogs.arn), + delivery_source_name=info_logs.name, + depends_on=[s3_info_logs] + ) + firehose_info_logs = CloudwatchLogDelivery(self, "firehose_info_logs", + delivery_destination_arn=firehose.arn, + delivery_source_name=info_logs.name, + depends_on=[cwlogs_info_logs] + ) + s3_error_logs = CloudwatchLogDelivery(self, "s3_error_logs", + delivery_destination_arn=s3.arn, + delivery_source_name=error_logs.name, + depends_on=[s3_info_logs] + ) + s3_trace_logs = CloudwatchLogDelivery(self, "s3_trace_logs", + delivery_destination_arn=s3.arn, + delivery_source_name=trace_logs.name, + depends_on=[s3_error_logs] + ) + cwlogs_error_logs = CloudwatchLogDelivery(self, "cwlogs_error_logs", + delivery_destination_arn=Token.as_string(aws_cloudwatch_log_delivery_destination_cwlogs.arn), + delivery_source_name=error_logs.name, + depends_on=[s3_error_logs, cwlogs_info_logs] + ) + cwlogs_trace_logs = CloudwatchLogDelivery(self, "cwlogs_trace_logs", + delivery_destination_arn=Token.as_string(aws_cloudwatch_log_delivery_destination_cwlogs.arn), + delivery_source_name=trace_logs.name, + depends_on=[s3_trace_logs, cwlogs_error_logs] + ) + firehose_error_logs = CloudwatchLogDelivery(self, "firehose_error_logs", + delivery_destination_arn=firehose.arn, + delivery_source_name=error_logs.name, + depends_on=[cwlogs_error_logs, firehose_info_logs] + ) + CloudwatchLogDelivery(self, "firehose_trace_logs", + delivery_destination_arn=firehose.arn, + delivery_source_name=trace_logs.name, + depends_on=[cwlogs_trace_logs, firehose_error_logs] + ) +``` + ## Argument Reference This resource supports the following arguments: @@ -75,6 +300,9 @@ The following arguments are optional: * `description` - (Optional) Event bus description. * `event_source_name` - (Optional) Partner event source that the new event bus will be matched with. Must match `name`. * `kms_key_identifier` - (Optional) Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN. +* `log_config` - (Optional) Block for logging configuration settings for the event bus. + * `include_detail` - (Optional) Whether EventBridge include detailed event information in the records it generates. Valid values are `NONE` and `FULL`. + * `level` - (Optional) Level of logging detail to include. Valid values are `OFF`, `ERROR`, `INFO`, and `TRACE`. * `tags` - (Optional) Map of tags assigned to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -110,4 +338,4 @@ Using `terraform import`, import EventBridge event buses using the name of the e % terraform import aws_cloudwatch_event_bus.messenger chat-messages ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/cloudwatch_log_anomaly_detector.html.markdown b/website/docs/cdktf/python/r/cloudwatch_log_anomaly_detector.html.markdown index 125f6116a336..5443285927b1 100644 --- a/website/docs/cdktf/python/r/cloudwatch_log_anomaly_detector.html.markdown +++ b/website/docs/cdktf/python/r/cloudwatch_log_anomaly_detector.html.markdown @@ -95,10 +95,10 @@ class MyConvertedCode(TerraformStack): CloudwatchLogAnomalyDetector.generate_config_for_import(self, "example", "log_anomaly_detector-arn-12345678") ``` -Using `terraform import`, import CloudWatch Log Anomaly Detector using the `example_id_arg`. For example: +Using `terraform import`, import CloudWatch Log Anomaly Detector using the `arn`. For example: ```console % terraform import aws_cloudwatch_log_anomaly_detector.example log_anomaly_detector-arn-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/codebuild_fleet.html.markdown b/website/docs/cdktf/python/r/codebuild_fleet.html.markdown index 072a9e1df2b3..ada755c829ab 100644 --- a/website/docs/cdktf/python/r/codebuild_fleet.html.markdown +++ b/website/docs/cdktf/python/r/codebuild_fleet.html.markdown @@ -78,7 +78,7 @@ The following arguments are required: The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `compute_configuration` - (Optional) The compute configuration of the compute fleet. This is only required if `compute_type` is set to `ATTRIBUTE_BASED_COMPUTE`. See [`compute_configuration`](#compute_configuration) below. +* `compute_configuration` - (Optional) The compute configuration of the compute fleet. This is only required if `compute_type` is set to `ATTRIBUTE_BASED_COMPUTE` or `CUSTOM_INSTANCE_TYPE`. See [`compute_configuration`](#compute_configuration) below. * `fleet_service_role` - (Optional) The service role associated with the compute fleet. * `image_id` - (Optional) The Amazon Machine Image (AMI) of the compute fleet. * `overflow_behavior` - (Optional) Overflow behavior for compute fleet. Valid values: `ON_DEMAND`, `QUEUE`. @@ -89,9 +89,10 @@ The following arguments are optional: ### compute_configuration * `disk` - (Optional) Amount of disk space of the instance type included in the fleet. -* `machine_type` - (Optional) Machine type of the instance type included in the fleet. Valid values: `GENERAL`, `NVME`. -* `memory` - (Optional) Amount of memory of the instance type included in the fleet. -* `vcpu` - (Optional) Number of vCPUs of the instance type included in the fleet. +* `instance_type` - (Optional) EC2 instance type to be launched in the fleet. Specify only if `compute_type` is set to `CUSTOM_INSTANCE_TYPE`. See [Supported instance families](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.instance-types). +* `machine_type` - (Optional) Machine type of the instance type included in the fleet. Valid values: `GENERAL`, `NVME`. Specify only if `compute_type` is set to `ATTRIBUTE_BASED_COMPUTE`. +* `memory` - (Optional) Amount of memory of the instance type included in the fleet. Specify only if `compute_type` is set to `ATTRIBUTE_BASED_COMPUTE`. +* `vcpu` - (Optional) Number of vCPUs of the instance type included in the fleet. Specify only if `compute_type` is set to `ATTRIBUTE_BASED_COMPUTE`. ### scaling_configuration @@ -148,4 +149,4 @@ Using `terraform import`, import CodeBuild Fleet using the `name`. For example: % terraform import aws_codebuild_fleet.name fleet-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/computeoptimizer_recommendation_preferences.html.markdown b/website/docs/cdktf/python/r/computeoptimizer_recommendation_preferences.html.markdown index 9164a204ff8d..8463bb65c5f5 100644 --- a/website/docs/cdktf/python/r/computeoptimizer_recommendation_preferences.html.markdown +++ b/website/docs/cdktf/python/r/computeoptimizer_recommendation_preferences.html.markdown @@ -83,7 +83,7 @@ This resource supports the following arguments: * `inferred_workload_types` - (Optional) The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`. * `look_back_period` - (Optional) The preference to control the number of days the utilization metrics of the AWS resource are analyzed. Valid values: `DAYS_14`, `DAYS_32`, `DAYS_93`. * `preferred_resource` - (Optional) The preference to control which resource type values are considered when generating rightsizing recommendations. See [Preferred Resources](#preferred-resources) below. -* `resource_type` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`. +* `resource_type` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`, `AuroraDBClusterStorage`. * `savings_estimation_mode` - (Optional) The status of the savings estimation mode preference. Valid values: `AfterDiscounts`, `BeforeDiscounts`. * `scope` - (Required) The scope of the recommendation preferences. See [Scope](#scope) below. * `utilization_preference` - (Optional) The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. See [Utilization Preferences](#utilization-preferences) below. @@ -142,4 +142,4 @@ Using `terraform import`, import recommendation preferences using the resource t % terraform import aws_computeoptimizer_recommendation_preferences.example Ec2Instance,AccountId,123456789012 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/datazone_glossary.html.markdown b/website/docs/cdktf/python/r/datazone_glossary.html.markdown index fabbeb78a9a2..29c0ac25dc95 100644 --- a/website/docs/cdktf/python/r/datazone_glossary.html.markdown +++ b/website/docs/cdktf/python/r/datazone_glossary.html.markdown @@ -137,7 +137,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using a comma-delimited string combining the domain id, glossary id, and the id of the project it's under. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -160,4 +160,4 @@ Using `terraform import`, import DataZone Glossary using the import Datazone Glo % terraform import aws_datazone_glossary.example domain-id,glossary-id,owning-project-identifier ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/dlm_lifecycle_policy.html.markdown b/website/docs/cdktf/python/r/dlm_lifecycle_policy.html.markdown index b2d75a954331..30c603dfc9ea 100644 --- a/website/docs/cdktf/python/r/dlm_lifecycle_policy.html.markdown +++ b/website/docs/cdktf/python/r/dlm_lifecycle_policy.html.markdown @@ -247,7 +247,7 @@ This resource supports the following arguments: * `action` - (Optional) The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`action` configuration](#action-arguments) block. * `event_source` - (Optional) The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`event_source` configuration](#event-source-arguments) block. * `resource_types` - (Optional) A list of resource types that should be targeted by the lifecycle policy. Valid values are `VOLUME` and `INSTANCE`. -* `resource_locations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If you specify `OUTPOST`, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values are `CLOUD` and `OUTPOST`. +* `resource_locations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If the source resources are located in a Local Zone, specify `LOCAL_ZONE`. Valid values are `CLOUD`, `LOCAL_ZONE`, and `OUTPOST`. * `policy_type` - (Optional) The valid target resource types and actions a policy can manage. Specify `EBS_SNAPSHOT_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify `IMAGE_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify `EVENT_BASED_POLICY` to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value is `EBS_SNAPSHOT_MANAGEMENT`. * `parameters` - (Optional) A set of optional parameters for snapshot and AMI lifecycle policies. See the [`parameters` configuration](#parameters-arguments) block. * `schedule` - (Optional) See the [`schedule` configuration](#schedule-arguments) block. @@ -385,4 +385,4 @@ Using `terraform import`, import DLM lifecycle policies using their policy ID. F % terraform import aws_dlm_lifecycle_policy.example policy-abcdef12345678901 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/docdb_cluster.html.markdown b/website/docs/cdktf/python/r/docdb_cluster.html.markdown index 889292355d7e..d70d1a0a25b2 100644 --- a/website/docs/cdktf/python/r/docdb_cluster.html.markdown +++ b/website/docs/cdktf/python/r/docdb_cluster.html.markdown @@ -88,6 +88,7 @@ This resource supports the following arguments: Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 * `preferred_maintenance_window` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `restore_to_point_in_time` - (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. +* `serverless_v2_scaling_configuration` - (Optional) Scaling configuration of an Amazon DocumentDB Serverless cluster. See [Serverless V2 Scaling Configuration](#serverless-v2-scaling-configuration) below for details. * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false`. @@ -108,6 +109,14 @@ The `restore_to_point_in_time` block supports the following arguments: * `source_cluster_identifier` - (Required) The identifier of the source DB cluster from which to restore. Must match the identifier of an existing DB cluster. * `use_latest_restorable_time` - (Optional) A boolean value that indicates whether the DB cluster is restored from the latest backup time. Defaults to `false`. Cannot be specified with `restore_to_time`. +### Serverless V2 Scaling Configuration + +The `serverless_v2_scaling_configuration` block supports the following arguments. +Adding this block (i.e. switching to serverless) or removing it (i.e. switching from serverless) will trigger cluster replacement. + +* `max_capacity` - (Required) Maximum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 1 and 256. +* `min_capacity` - (Required) Minimum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 0.5 and 256. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: @@ -155,4 +164,4 @@ Using `terraform import`, import DocumentDB Clusters using the `cluster_identifi % terraform import aws_docdb_cluster.docdb_cluster docdb-prod-cluster ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/dynamodb_resource_policy.html.markdown b/website/docs/cdktf/python/r/dynamodb_resource_policy.html.markdown index 66ea98c13c1c..4aa7b6a69da4 100644 --- a/website/docs/cdktf/python/r/dynamodb_resource_policy.html.markdown +++ b/website/docs/cdktf/python/r/dynamodb_resource_policy.html.markdown @@ -55,7 +55,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `resource_arn`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -72,10 +72,10 @@ class MyConvertedCode(TerraformStack): DynamodbResourcePolicy.generate_config_for_import(self, "example", "arn:aws:dynamodb:us-east-1:1234567890:table/my-table") ``` -Using `terraform import`, import DynamoDB Resource Policy using the `example_id_arg`. For example: +Using `terraform import`, import DynamoDB Resource Policy using the `resource_arn`. For example: ```console % terraform import aws_dynamodb_resource_policy.example arn:aws:dynamodb:us-east-1:1234567890:table/my-table ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/dynamodb_table.html.markdown b/website/docs/cdktf/python/r/dynamodb_table.html.markdown index dbf46fb2f8d1..75913eb8153b 100644 --- a/website/docs/cdktf/python/r/dynamodb_table.html.markdown +++ b/website/docs/cdktf/python/r/dynamodb_table.html.markdown @@ -335,6 +335,7 @@ The following arguments are optional: **Note:** This attribute will _not_ be populated with the ARN of _default_ keys. **Note:** Changing this value will recreate the replica. * `point_in_time_recovery` - (Optional) Whether to enable Point In Time Recovery for the replica. Default is `false`. +* `deletion_protection_enabled` - (Optional) Whether deletion protection is enabled (true) or disabled (false) on the replica. Default is `false`. * `propagate_tags` - (Optional) Whether to propagate the global table's tags to a replica. Default is `false`. Changes to tags only move in one direction: from global (source) to replica. @@ -404,4 +405,4 @@ Using `terraform import`, import DynamoDB tables using the `name`. For example: % terraform import aws_dynamodb_table.basic-dynamodb-table GameScores ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ebs_fast_snapshot_restore.html.markdown b/website/docs/cdktf/python/r/ebs_fast_snapshot_restore.html.markdown index 69c075bf4d31..4505918828cd 100644 --- a/website/docs/cdktf/python/r/ebs_fast_snapshot_restore.html.markdown +++ b/website/docs/cdktf/python/r/ebs_fast_snapshot_restore.html.markdown @@ -58,7 +58,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availability_zone` and `snapshot_id` separated by `,`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -75,10 +75,10 @@ class MyConvertedCode(TerraformStack): EbsFastSnapshotRestore.generate_config_for_import(self, "example", "us-west-2a,snap-abcdef123456") ``` -Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `id`. For example: +Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availability_zone` and `snapshot_id` separated by `,`. For example: ```console % terraform import aws_ebs_fast_snapshot_restore.example us-west-2a,snap-abcdef123456 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ebs_volume.html.markdown b/website/docs/cdktf/python/r/ebs_volume.html.markdown index 77950628b02f..3f667d6b3f93 100644 --- a/website/docs/cdktf/python/r/ebs_volume.html.markdown +++ b/website/docs/cdktf/python/r/ebs_volume.html.markdown @@ -52,6 +52,7 @@ This resource supports the following arguments: * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `throughput` - (Optional) Throughput that the volume supports, in MiB/s. Only valid for `type` of `gp3`. * `type` - (Optional) Type of EBS volume. Can be `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1` or `st1` (Default: `gp2`). +* `volume_initialization_rate` - (Optional) EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This argument can only be set if `snapshot_id` is specified. ~> **NOTE:** At least one of `size` or `snapshot_id` is required. @@ -99,4 +100,4 @@ Using `terraform import`, import EBS Volumes using the `id`. For example: % terraform import aws_ebs_volume.id vol-049df61146c4d7901 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ecr_repository.html.markdown b/website/docs/cdktf/python/r/ecr_repository.html.markdown index 9691f5e6ee1f..1cd1d60fbe4a 100644 --- a/website/docs/cdktf/python/r/ecr_repository.html.markdown +++ b/website/docs/cdktf/python/r/ecr_repository.html.markdown @@ -35,6 +35,34 @@ class MyConvertedCode(TerraformStack): ) ``` +### With Image Tag Mutability Exclusion + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ecr_repository import EcrRepository +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EcrRepository(self, "example", + image_tag_mutability="IMMUTABLE_WITH_EXCLUSION", + image_tag_mutability_exclusion_filter=[EcrRepositoryImageTagMutabilityExclusionFilter( + filter="latest*", + filter_type="WILDCARD" + ), EcrRepositoryImageTagMutabilityExclusionFilter( + filter="dev-*", + filter_type="WILDCARD" + ) + ], + name="example-repo" + ) +``` + ## Argument Reference This resource supports the following arguments: @@ -44,7 +72,8 @@ This resource supports the following arguments: * `encryption_configuration` - (Optional) Encryption configuration for the repository. See [below for schema](#encryption_configuration). * `force_delete` - (Optional) If `true`, will delete the repository even if it contains images. Defaults to `false`. -* `image_tag_mutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE`. Defaults to `MUTABLE`. +* `image_tag_mutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE`, `IMMUTABLE`, `IMMUTABLE_WITH_EXCLUSION`, or `MUTABLE_WITH_EXCLUSION`. Defaults to `MUTABLE`. +* `image_tag_mutability_exclusion_filter` - (Optional) Configuration block that defines filters to specify which image tags can override the default tag mutability setting. Only applicable when `image_tag_mutability` is set to `IMMUTABLE_WITH_EXCLUSION` or `MUTABLE_WITH_EXCLUSION`. See [below for schema](#image_tag_mutability_exclusion_filter). * `image_scanning_configuration` - (Optional) Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the [ECR User Guide](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) for more information about image scanning. * `scan_on_push` - (Required) Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -54,6 +83,11 @@ This resource supports the following arguments: * `encryption_type` - (Optional) The encryption type to use for the repository. Valid values are `AES256` or `KMS`. Defaults to `AES256`. * `kms_key` - (Optional) The ARN of the KMS key to use when `encryption_type` is `KMS`. If not specified, uses the default AWS managed key for ECR. +### image_tag_mutability_exclusion_filter + +* `filter` - (Required) The filter pattern to use for excluding image tags from the mutability setting. Must contain only letters, numbers, and special characters (._*-). Each filter can be up to 128 characters long and can contain a maximum of 2 wildcards (*). +* `filter_type` - (Required) The type of filter to use. Must be `WILDCARD`. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: @@ -94,4 +128,4 @@ Using `terraform import`, import ECR Repositories using the `name`. For example: % terraform import aws_ecr_repository.service test-service ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/emr_cluster.html.markdown b/website/docs/cdktf/python/r/emr_cluster.html.markdown index 8f28f2535717..d469614d7ce5 100644 --- a/website/docs/cdktf/python/r/emr_cluster.html.markdown +++ b/website/docs/cdktf/python/r/emr_cluster.html.markdown @@ -517,6 +517,8 @@ class MyConvertedCode(TerraformStack): * `unhealthy_node_replacement` - (Optional) Whether whether Amazon EMR should gracefully replace core nodes that have degraded within the cluster. Default value is `false`. * `visible_to_all_users` - (Optional) Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true`. + **NOTE:** As per the [Amazon EMR API Reference](https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html#EMR-RunJobFlow-request-VisibleToAllUsers), this argument is no longer supported. Do not set this argument, particularly to `false`, as it would lead to perpetual differences. + ### bootstrap_action * `args` - (Optional) List of command line arguments to pass to the bootstrap action script. @@ -683,7 +685,6 @@ This resource exports the following attributes in addition to the arguments abov * `release_label` - Release label for the Amazon EMR release. * `service_role` - IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf. * `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). -* `visible_to_all_users` - Indicates whether the job flow is visible to all IAM users of the AWS account associated with the job flow. ## Import @@ -735,4 +736,4 @@ class MyConvertedCode(TerraformStack): ) ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/globalaccelerator_cross_account_attachment.html.markdown b/website/docs/cdktf/python/r/globalaccelerator_cross_account_attachment.html.markdown index 18222a027531..c7e5d32ec89a 100644 --- a/website/docs/cdktf/python/r/globalaccelerator_cross_account_attachment.html.markdown +++ b/website/docs/cdktf/python/r/globalaccelerator_cross_account_attachment.html.markdown @@ -93,7 +93,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `arn`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -110,10 +110,10 @@ class MyConvertedCode(TerraformStack): GlobalacceleratorCrossAccountAttachment.generate_config_for_import(self, "example", "arn:aws:globalaccelerator::012345678910:attachment/01234567-abcd-8910-efgh-123456789012") ``` -Using `terraform import`, import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +Using `terraform import`, import Global Accelerator Cross Account Attachment using the `arn`. For example: ```console % terraform import aws_globalaccelerator_cross_account_attachment.example arn:aws:globalaccelerator::012345678910:attachment/01234567-abcd-8910-efgh-123456789012 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/imagebuilder_workflow.html.markdown b/website/docs/cdktf/python/r/imagebuilder_workflow.html.markdown index d0042227063b..f43b2399d2f1 100644 --- a/website/docs/cdktf/python/r/imagebuilder_workflow.html.markdown +++ b/website/docs/cdktf/python/r/imagebuilder_workflow.html.markdown @@ -65,7 +65,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `arn`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -82,7 +82,7 @@ class MyConvertedCode(TerraformStack): ImagebuilderWorkflow.generate_config_for_import(self, "example", "workflow-id-12345678") ``` -Using `terraform import`, import EC2 Image Builder Workflow using the `example_id_arg`. For example: +Using `terraform import`, import EC2 Image Builder Workflow using the `arn`. For example: ```console % terraform import aws_imagebuilder_workflow.example arn:aws:imagebuilder:us-east-1:aws:workflow/test/example/1.0.1/1 @@ -90,4 +90,4 @@ Using `terraform import`, import EC2 Image Builder Workflow using the `example_i Certain resource arguments, such as `uri`, cannot be read via the API and imported into Terraform. Terraform will display a difference for these arguments the first run after import if declared in the Terraform configuration for an imported resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/inspector2_enabler.html.markdown b/website/docs/cdktf/python/r/inspector2_enabler.html.markdown index c3dd978ec900..5b686d092abd 100644 --- a/website/docs/cdktf/python/r/inspector2_enabler.html.markdown +++ b/website/docs/cdktf/python/r/inspector2_enabler.html.markdown @@ -81,4 +81,29 @@ This resource exports no additional attributes. * `update` - (Default `5m`) * `delete` - (Default `5m`) - \ No newline at end of file +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Inspector Enabler using `account_ids` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `account_ids` are sorted in ascending order and `resource_types` are sorted in alphabetical order. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.inspector2_enabler import Inspector2Enabler +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Inspector2Enabler.generate_config_for_import(self, "example", "123456789012:234567890123-EC2:ECR") +``` + +Using `terraform import`, import Inspector Enabler using using `account_ids` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `account_ids` are sorted in ascending order and `resource_types` are sorted in alphabetical order. For example: + +```console +% terraform import aws_inspector2_enabler.example 123456789012:234567890123-EC2:ECR +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/inspector2_filter.html.markdown b/website/docs/cdktf/python/r/inspector2_filter.html.markdown index f7b6bdd6be54..dbd52acdddc4 100644 --- a/website/docs/cdktf/python/r/inspector2_filter.html.markdown +++ b/website/docs/cdktf/python/r/inspector2_filter.html.markdown @@ -179,10 +179,10 @@ class MyConvertedCode(TerraformStack): Inspector2Filter.generate_config_for_import(self, "example", "arn:aws:inspector2:us-east-1:111222333444:owner/111222333444/filter/abcdefgh12345678") ``` -Using `terraform import`, import Inspector Filter using the `example_id_arg`. For example: +Using `terraform import`, import Inspector Filter using the `arn`. For example: ```console % terraform import aws_inspector2_filter.example "arn:aws:inspector2:us-east-1:111222333444:owner/111222333444/filter/abcdefgh12345678" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/instance.html.markdown b/website/docs/cdktf/python/r/instance.html.markdown index dbaf6c37ef61..58e5160d703a 100644 --- a/website/docs/cdktf/python/r/instance.html.markdown +++ b/website/docs/cdktf/python/r/instance.html.markdown @@ -287,6 +287,7 @@ This resource supports the following arguments: * `enable_primary_ipv6` - (Optional) Whether to assign a primary IPv6 Global Unicast Address (GUA) to the instance when launched in a dual-stack or IPv6-only subnet. A primary IPv6 address ensures a consistent IPv6 address for the instance and is automatically assigned by AWS to the ENI. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains until the instance is terminated or the ENI is detached. Disabling `enable_primary_ipv6` after it has been enabled forces recreation of the instance. * `enclave_options` - (Optional) Enable Nitro Enclaves on launched instances. See [Enclave Options](#enclave-options) below for more details. * `ephemeral_block_device` - (Optional) One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a set of objects. +* `force_destroy` - (Optional) Destroys instance even if `disable_api_termination` or `disable_api_stop` is set to `true`. Defaults to `false`. Once this parameter is set to `true`, a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the instance or destroying the instance, this flag will not work. Additionally when importing an instance, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation. * `get_password_data` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. * `hibernation` - (Optional) If true, the launched EC2 instance will support hibernation. * `host_id` - (Optional) ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. @@ -558,4 +559,4 @@ Using `terraform import`, import instances using the `id`. For example: % terraform import aws_instance.web i-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lakeformation_data_cells_filter.html.markdown b/website/docs/cdktf/python/r/lakeformation_data_cells_filter.html.markdown index 29eba5ead3f9..ef9fc9253af4 100644 --- a/website/docs/cdktf/python/r/lakeformation_data_cells_filter.html.markdown +++ b/website/docs/cdktf/python/r/lakeformation_data_cells_filter.html.markdown @@ -84,7 +84,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `database_name`, `name`, `table_catalog_id`, and `table_name` separated by `,`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -101,10 +101,10 @@ class MyConvertedCode(TerraformStack): LakeformationDataCellsFilter.generate_config_for_import(self, "example", "database_name,name,table_catalog_id,table_name") ``` -Using `terraform import`, import Lake Formation Data Cells Filter using the `id`. For example: +Using `terraform import`, import Lake Formation Data Cells Filter using the `database_name`, `name`, `table_catalog_id`, and `table_name` separated by `,`. For example: ```console % terraform import aws_lakeformation_data_cells_filter.example database_name,name,table_catalog_id,table_name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/networkfirewall_vpc_endpoint_association.html.markdown b/website/docs/cdktf/python/r/networkfirewall_vpc_endpoint_association.html.markdown new file mode 100644 index 000000000000..e8b928fe5482 --- /dev/null +++ b/website/docs/cdktf/python/r/networkfirewall_vpc_endpoint_association.html.markdown @@ -0,0 +1,112 @@ +--- +subcategory: "Network Firewall" +layout: "aws" +page_title: "AWS: aws_networkfirewall_vpc_endpoint_association" +description: |- + Manages a firewall endpoint for an AWS Network Firewall firewall. +--- + + + +# Resource: aws_networkfirewall_vpc_endpoint_association + +Manages a firewall endpoint for an AWS Network Firewall firewall. + +Use `aws_networkfirewall_vpc_endpoint_association` to establish new firewall endpoints in any Availability Zone where the firewall is already being used. The first use of a firewall in an Availability Zone must be defined by `aws_networkfirewall_firewall` resource and `subnet_mapping` argument. + +## Example Usage + +### Basic Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.networkfirewall_vpc_endpoint_association import NetworkfirewallVpcEndpointAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + NetworkfirewallVpcEndpointAssociation(self, "example", + firewall_arn=Token.as_string(aws_networkfirewall_firewall_example.arn), + subnet_mapping=[NetworkfirewallVpcEndpointAssociationSubnetMapping( + subnet_id=Token.as_string(aws_subnet_example.id) + ), NetworkfirewallVpcEndpointAssociationSubnetMapping( + subnet_id=example_two.id + ) + ], + tags={ + "Name": "example endpoint" + }, + vpc_id=Token.as_string(aws_vpc_example.id) + ) +``` + +## Argument Reference + +This resource supports the following arguments: + +* `description` (Optional) - A description of the VPC endpoint association. +* `firewall_arn` (Required) - The Amazon Resource Name (ARN) that identifies the firewall. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `subnet_mapping` (Required) - The ID for a subnet that's used in an association with a firewall. See [Subnet Mapping](#subnet-mapping) below for details. +* `tags` - (Optional) Map of resource tags to associate with the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `vpc_id` (Required) - The unique identifier of the VPC for the endpoint association. + +### Subnet Mapping + +The `subnet_mapping` block supports the following arguments: + +* `ip_address_type` - (Optional) The subnet's IP address type. Valid values: `"DUALSTACK"`, `"IPV4"`. +* `subnet_id` - (Required) The unique identifier for the subnet. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `vpc_endpoint_association_arn` - ARN of the VPC Endpoint Association. +* `vpc_endpoint_association_id` - The unique identifier of the VPC endpoint association. +* `vpc_endpoint_association_status` - Nested list of information about the current status of the VPC Endpoint Association. + * `association_sync_states` - Set of subnets configured for use by the VPC Endpoint Association. + * `attachment` - Nested list describing the attachment status of the firewall's VPC Endpoint Association with a single VPC subnet. + * `endpoint_id` - The identifier of the VPC endpoint that AWS Network Firewall has instantiated in the subnet. You use this to identify the firewall endpoint in the VPC route tables, when you redirect the VPC traffic through the endpoint. + * `subnet_id` - The unique identifier of the subnet that you've specified to be used for a VPC Endpoint Association endpoint. + * `availability_zone` - The Availability Zone where the subnet is configured. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Network Firewall VPC Endpoint Association using the `vpc_endpoint_association_arn`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.networkfirewall_vpc_endpoint_association import NetworkfirewallVpcEndpointAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + NetworkfirewallVpcEndpointAssociation.generate_config_for_import(self, "example", "arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example") +``` + +Using `terraform import`, import Network Firewall VPC Endpoint Association using the `vpc_endpoint_association_arn`. For example: + +```console +% terraform import aws_networkfirewall_vpc_endpoint_association.example arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/networkmanager_transit_gateway_peering.html.markdown b/website/docs/cdktf/python/r/networkmanager_transit_gateway_peering.html.markdown index 6b6e06843bbc..3c00cef2c8f6 100644 --- a/website/docs/cdktf/python/r/networkmanager_transit_gateway_peering.html.markdown +++ b/website/docs/cdktf/python/r/networkmanager_transit_gateway_peering.html.markdown @@ -28,6 +28,8 @@ class MyConvertedCode(TerraformStack): super().__init__(scope, name) NetworkmanagerTransitGatewayPeering(self, "example", core_network_id=Token.as_string(awscc_networkmanager_core_network_example.id), + depends_on=[aws_ec2_transit_gateway_policy_table_example, aws_networkmanager_core_network_policy_attachment_example + ], transit_gateway_arn=Token.as_string(aws_ec2_transit_gateway_example.arn) ) ``` @@ -89,4 +91,4 @@ Using `terraform import`, import `aws_networkmanager_transit_gateway_peering` us % terraform import aws_networkmanager_transit_gateway_peering.example peering-444555aaabbb11223 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opensearch_authorize_vpc_endpoint_access.html.markdown b/website/docs/cdktf/python/r/opensearch_authorize_vpc_endpoint_access.html.markdown index 1edb23969633..b8cdb5fcd97e 100644 --- a/website/docs/cdktf/python/r/opensearch_authorize_vpc_endpoint_access.html.markdown +++ b/website/docs/cdktf/python/r/opensearch_authorize_vpc_endpoint_access.html.markdown @@ -57,7 +57,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `domain_name`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -74,10 +74,10 @@ class MyConvertedCode(TerraformStack): OpensearchAuthorizeVpcEndpointAccess.generate_config_for_import(self, "example", "authorize_vpc_endpoint_access-id-12345678") ``` -Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `domain_name`. For example: ```console % terraform import aws_opensearch_authorize_vpc_endpoint_access.example authorize_vpc_endpoint_access-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opensearch_domain_policy.html.markdown b/website/docs/cdktf/python/r/opensearch_domain_policy.html.markdown index 67a137d5d4f3..3c1a585ae676 100644 --- a/website/docs/cdktf/python/r/opensearch_domain_policy.html.markdown +++ b/website/docs/cdktf/python/r/opensearch_domain_policy.html.markdown @@ -78,4 +78,29 @@ This resource exports no additional attributes. * `update` - (Default `180m`) * `delete` - (Default `90m`) - \ No newline at end of file +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Domain Policy using `domain_name` prefixed with `esd-policy-`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.opensearch_domain_policy import OpensearchDomainPolicy +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + OpensearchDomainPolicy.generate_config_for_import(self, "example", "esd-policy-tf-test") +``` + +Using `terraform import`, import OpenSearch Domain Policy using `domain_name` prefixed with `esd-policy-`. For example: + +```console +% terraform import aws_opensearch_domain_policy.example esd-policy-tf-test +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_account_settings.html.markdown b/website/docs/cdktf/python/r/quicksight_account_settings.html.markdown index e55a31958322..96b64ff74f5c 100644 --- a/website/docs/cdktf/python/r/quicksight_account_settings.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_account_settings.html.markdown @@ -24,7 +24,7 @@ from cdktf import TerraformStack # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.aws. import QuicksightAccountSettings +from imports.aws.quicksight_account_settings import QuicksightAccountSettings from imports.aws.quicksight_account_subscription import QuicksightAccountSubscription class MyConvertedCode(TerraformStack): def __init__(self, scope, name): @@ -45,14 +45,13 @@ class MyConvertedCode(TerraformStack): This resource supports the following arguments: +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `default_namespace` - (Optional) The default namespace for this Amazon Web Services account. Currently, the default is `default`. * `termination_protection_enabled` - (Optional) A boolean value that determines whether or not an Amazon QuickSight account can be deleted. If `true`, it does not allow the account to be deleted and results in an error message if a user tries to make a DeleteAccountSubscription request. If `false`, it will allow the account to be deleted. ## Attribute Reference -This resource exports the following attributes in addition to the arguments above: - -* `aws_account_id` - The ID for the AWS account that contains the settings. +This resource exports no additional attributes. ## Import @@ -66,7 +65,7 @@ from cdktf import TerraformStack # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.aws. import QuicksightAccountSettings +from imports.aws.quicksight_account_settings import QuicksightAccountSettings class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) @@ -79,4 +78,4 @@ Using `terraform import`, import QuickSight Account Settings using the AWS accou % terraform import aws_quicksight_account_settings.example "012345678901" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_account_subscription.html.markdown b/website/docs/cdktf/python/r/quicksight_account_subscription.html.markdown index 9d39fcf62e23..313be8da5316 100644 --- a/website/docs/cdktf/python/r/quicksight_account_subscription.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_account_subscription.html.markdown @@ -47,11 +47,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `active_directory_name` - (Optional) Name of your Active Directory. This field is required if `ACTIVE_DIRECTORY` is the selected authentication method of the new Amazon QuickSight account. * `admin_group` - (Optional) Admin group associated with your Active Directory or IAM Identity Center account. This field is required if `ACTIVE_DIRECTORY` or `IAM_IDENTITY_CENTER` is the selected authentication method of the new Amazon QuickSight account. * `author_group` - (Optional) Author group associated with your Active Directory or IAM Identity Center account. -* `aws_account_id` - (Optional) AWS account ID hosting the QuickSight account. Default to provider account. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `contact_number` - (Optional) A 10-digit phone number for the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. * `directory_id` - (Optional) Active Directory ID that is associated with your Amazon QuickSight account. * `email_address` - (Optional) Email address of the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. @@ -60,6 +59,7 @@ The following arguments are optional: * `last_name` - (Optional) Last name of the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. * `reader_group` - (Optional) Reader group associated with your Active Directory or IAM Identity Center account. * `realm` - (Optional) Realm of the Active Directory that is associated with your Amazon QuickSight account. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -99,4 +99,4 @@ Using `terraform import`, import a QuickSight Account Subscription using `aws_ac % terraform import aws_quicksight_account_subscription.example "012345678901" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_analysis.html.markdown b/website/docs/cdktf/python/r/quicksight_analysis.html.markdown index a830695b4338..0e88108c0247 100644 --- a/website/docs/cdktf/python/r/quicksight_analysis.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_analysis.html.markdown @@ -123,12 +123,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `definition` - (Optional) A detailed analysis definition. Only one of `definition` or `source_entity` should be configured. See [definition](#definition). * `parameters` - (Optional) The parameters for the creation of the analysis, which you want to use to override the default settings. An analysis can have any type of parameters, and some parameters might accept multiple values. See [parameters](#parameters). * `permissions` - (Optional) A set of resource permissions on the analysis. Maximum of 64 items. See [permissions](#permissions). * `recovery_window_in_days` - (Optional) A value that specifies the number of days that Amazon QuickSight waits before it deletes the analysis. Use `0` to force deletion without recovery. Minimum value of `7`. Maximum value of `30`. Default to `30`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `source_entity` - (Optional) The entity that you are using as a source when you create the analysis (template). Only one of `definition` or `source_entity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `theme_arn` - (Optional) The Amazon Resource Name (ARN) of the theme that is being used for this analysis. The theme ARN must exist in the same AWS account where you create the analysis. @@ -213,4 +213,4 @@ Using `terraform import`, import a QuickSight Analysis using the AWS account ID % terraform import aws_quicksight_analysis.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_custom_permissions.html.markdown b/website/docs/cdktf/python/r/quicksight_custom_permissions.html.markdown new file mode 100644 index 000000000000..9ed22be4c9f8 --- /dev/null +++ b/website/docs/cdktf/python/r/quicksight_custom_permissions.html.markdown @@ -0,0 +1,97 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_custom_permissions" +description: |- + Manages a QuickSight custom permissions profile. +--- + + + +# Resource: aws_quicksight_custom_permissions + +Manages a QuickSight custom permissions profile. + +## Example Usage + +resource "aws_quicksight_custom_permissions" "example" { + custom_permissions_name = "example-permissions" + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } +} + +## Argument Reference + +The following arguments are required: + +* `capabilities` - (Required) Actions to include in the custom permissions profile. See [capabilities](#capabilities). +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### capabilities + +* `add_or_run_anomaly_detection_for_analyses` - (Optional) The ability to add or run anomaly detection. Valid values: `DENY`. +* `create_and_update_dashboard_email_reports` - (Optional) The ability to create and update email reports. Valid values: `DENY`. +* `create_and_update_datasets` - (Optional) The ability to create and update datasets. Valid values: `DENY`. +* `create_and_update_data_sources` - (Optional) The ability to create and update data sources. Valid values: `DENY`. +* `create_and_update_themes` - (Optional) The ability to export to create and update themes. Valid values: `DENY`. +* `create_and_update_threshold_alerts` - (Optional) The ability to create and update threshold alerts. Valid values: `DENY`. +* `create_shared_folders` - (Optional) The ability to create shared folders. Valid values: `DENY`. +* `create_spice_dataset` - (Optional) The ability to create a SPICE dataset. Valid values: `DENY`. +* `export_to_csv` - (Optional) The ability to export to CSV files from the UI. Valid values: `DENY`. +* `export_to_csv_in_scheduled_reports` - (Optional) The ability to export to CSV files in scheduled email reports. Valid values: `DENY`. +* `export_to_excel` - (Optional) The ability to export to Excel files from the UI. Valid values: `DENY`. +* `export_to_excel_in_scheduled_reports` - (Optional) The ability to export to Excel files in scheduled email reports. Valid values: `DENY`. +* `export_to_pdf` - (Optional) The ability to export to PDF files from the UI. Valid values: `DENY`. +* `export_to_pdf_in_scheduled_reports` - (Optional) The ability to export to PDF files in scheduled email reports. Valid values: `DENY`. +* `include_content_in_scheduled_reports_email` - (Optional) The ability to include content in scheduled email reports. Valid values: `DENY`. +* `print_reports` - (Optional) The ability to print reports. Valid values: `DENY`. +* `rename_shared_folders` - (Optional) The ability to rename shared folders. Valid values: `DENY`. +* `share_analyses` - (Optional) The ability to share analyses. Valid values: `DENY`. +* `share_dashboards` - (Optional) The ability to share dashboards. Valid values: `DENY`. +* `share_datasets` - (Optional) The ability to share datasets. Valid values: `DENY`. +* `share_data_sources` - (Optional) The ability to share data sources. Valid values: `DENY`. +* `subscribe_dashboard_email_reports` - (Optional) The ability to subscribe to email reports. Valid values: `DENY`. +* `view_account_spice_capacity` - (Optional) The ability to view account SPICE capacity. Valid values: `DENY`. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `arn` - ARN of the custom permissions profile. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_custom_permissions import QuicksightCustomPermissions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightCustomPermissions.generate_config_for_import(self, "example", "123456789012,example-permissions") +``` + +Using `terraform import`, import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```console +% terraform import aws_quicksight_custom_permissions.example 123456789012,example-permissions +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_dashboard.html.markdown b/website/docs/cdktf/python/r/quicksight_dashboard.html.markdown index de32393ec853..0ea64949e47a 100644 --- a/website/docs/cdktf/python/r/quicksight_dashboard.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_dashboard.html.markdown @@ -126,12 +126,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `dashboard_publish_options` - (Optional) Options for publishing the dashboard. See [dashboard_publish_options](#dashboard_publish_options). * `definition` - (Optional) A detailed dashboard definition. Only one of `definition` or `source_entity` should be configured. See [definition](#definition). * `parameters` - (Optional) The parameters for the creation of the dashboard, which you want to use to override the default settings. A dashboard can have any type of parameters, and some parameters might accept multiple values. See [parameters](#parameters). * `permissions` - (Optional) A set of resource permissions on the dashboard. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `source_entity` - (Optional) The entity that you are using as a source when you create the dashboard (template). Only one of `definition` or `source_entity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `theme_arn` - (Optional) The Amazon Resource Name (ARN) of the theme that is being used for this dashboard. The theme ARN must exist in the same AWS account where you create the dashboard. @@ -271,4 +271,4 @@ Using `terraform import`, import a QuickSight Dashboard using the AWS account ID % terraform import aws_quicksight_dashboard.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_data_set.html.markdown b/website/docs/cdktf/python/r/quicksight_data_set.html.markdown index d81d8230c36f..4e7b255e6772 100644 --- a/website/docs/cdktf/python/r/quicksight_data_set.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_data_set.html.markdown @@ -231,8 +231,7 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `column_groups` - (Optional) Groupings of columns that work together in certain Amazon QuickSight features. Currently, only geospatial hierarchy is supported. See [column_groups](#column_groups). * `column_level_permission_rules` - (Optional) A set of 1 or more definitions of a [ColumnLevelPermissionRule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnLevelPermissionRule.html). See [column_level_permission_rules](#column_level_permission_rules). * `data_set_usage_configuration` - (Optional) The usage configuration to apply to child datasets that reference this dataset as a source. See [data_set_usage_configuration](#data_set_usage_configuration). @@ -240,6 +239,7 @@ The following arguments are optional: * `logical_table_map` - (Optional) Configures the combination and transformation of the data from the physical tables. Maximum of 1 entry. See [logical_table_map](#logical_table_map). * `permissions` - (Optional) A set of resource permissions on the data source. Maximum of 64 items. See [permissions](#permissions). * `physical_table_map` - (Optional) Declares the physical tables that are available in the underlying data sources. See [physical_table_map](#physical_table_map). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `row_level_permission_data_set` - (Optional) The row-level security configuration for the data that you want to create. See [row_level_permission_data_set](#row_level_permission_data_set). * `row_level_permission_tag_configuration` - (Optional) The configuration of tags on a dataset to set row-level security. Row-level security tags are currently supported for anonymous embedding only. See [row_level_permission_tag_configuration](#row_level_permission_tag_configuration). * `refresh_properties` - (Optional) The refresh properties for the data set. **NOTE**: Only valid when `import_mode` is set to `SPICE`. See [refresh_properties](#refresh_properties). @@ -483,4 +483,4 @@ Using `terraform import`, import a QuickSight Data Set using the AWS account ID % terraform import aws_quicksight_data_set.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_data_source.html.markdown b/website/docs/cdktf/python/r/quicksight_data_source.html.markdown index 265b58a29f8a..1e26c37ce24a 100644 --- a/website/docs/cdktf/python/r/quicksight_data_source.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_data_source.html.markdown @@ -170,10 +170,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `credentials` - (Optional) The credentials Amazon QuickSight uses to connect to your underlying source. See [Credentials](#credentials-argument-reference) below for more details. * `permission` - (Optional) A set of resource permissions on the data source. Maximum of 64 items. See [Permission](#permission-argument-reference) below for more details. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `ssl_properties` - (Optional) Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See [SSL Properties](#ssl_properties-argument-reference) below for more details. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_connection_properties`- (Optional) Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See [VPC Connection Properties](#vpc_connection_properties-argument-reference) below for more details. @@ -379,4 +379,4 @@ Using `terraform import`, import a QuickSight data source using the AWS account % terraform import aws_quicksight_data_source.example 123456789123/my-data-source-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_folder.html.markdown b/website/docs/cdktf/python/r/quicksight_folder.html.markdown index 6e866cb24408..9c8ce641b7a3 100644 --- a/website/docs/cdktf/python/r/quicksight_folder.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_folder.html.markdown @@ -94,11 +94,11 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `folder_type` - (Optional) The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`. * `parent_folder_arn` - (Optional) The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder. * `permissions` - (Optional) A set of resource permissions on the folder. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### permissions @@ -151,4 +151,4 @@ Using `terraform import`, import a QuickSight folder using the AWS account ID an % terraform import aws_quicksight_folder.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_folder_membership.html.markdown b/website/docs/cdktf/python/r/quicksight_folder_membership.html.markdown index 937a769ad4ec..dabf195d29b2 100644 --- a/website/docs/cdktf/python/r/quicksight_folder_membership.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_folder_membership.html.markdown @@ -45,8 +45,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. ## Attribute Reference @@ -79,4 +79,4 @@ Using `terraform import`, import QuickSight Folder Membership using the AWS acco % terraform import aws_quicksight_folder_membership.example 123456789012,example-folder,DATASET,example-dataset ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_group.html.markdown b/website/docs/cdktf/python/r/quicksight_group.html.markdown index 71dd92a75f6b..7944a054e65f 100644 --- a/website/docs/cdktf/python/r/quicksight_group.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_group.html.markdown @@ -35,11 +35,11 @@ class MyConvertedCode(TerraformStack): This resource supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `group_name` - (Required) A name for the group. -* `aws_account_id` - (Optional) The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `description` - (Optional) A description for the group. +* `group_name` - (Required) A name for the group. * `namespace` - (Optional) The namespace. Currently, you should set this to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -72,4 +72,4 @@ Using `terraform import`, import QuickSight Group using the aws account id, name % terraform import aws_quicksight_group.example 123456789123/default/tf-example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_group_membership.html.markdown b/website/docs/cdktf/python/r/quicksight_group_membership.html.markdown index ce89457cc235..9eca7dc749e5 100644 --- a/website/docs/cdktf/python/r/quicksight_group_membership.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_group_membership.html.markdown @@ -36,11 +36,11 @@ class MyConvertedCode(TerraformStack): This resource supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `group_name` - (Required) The name of the group in which the member will be added. * `member_name` - (Required) The name of the member to add to the group. -* `aws_account_id` - (Optional) The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. -* `namespace` - (Required) The namespace that you want the user to be a part of. Defaults to `default`. +* `namespace` - (Optional) The namespace that you want the user to be a part of. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -71,4 +71,4 @@ Using `terraform import`, import QuickSight Group membership using the AWS accou % terraform import aws_quicksight_group_membership.example 123456789123/default/all-access-users/john_smith ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_iam_policy_assignment.html.markdown b/website/docs/cdktf/python/r/quicksight_iam_policy_assignment.html.markdown index f1068d089e92..14d1177aa30f 100644 --- a/website/docs/cdktf/python/r/quicksight_iam_policy_assignment.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_iam_policy_assignment.html.markdown @@ -48,11 +48,11 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `identities` - (Optional) Amazon QuickSight users, groups, or both to assign the policy to. See [`identities` block](#identities-block). * `namespace` - (Optional) Namespace that contains the assignment. Defaults to `default`. * `policy_arn` - (Optional) ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ### `identities` block @@ -91,4 +91,4 @@ Using `terraform import`, import QuickSight IAM Policy Assignment using the AWS % terraform import aws_quicksight_iam_policy_assignment.example 123456789012,default,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_ingestion.html.markdown b/website/docs/cdktf/python/r/quicksight_ingestion.html.markdown index cf271f540263..659a03a9d5ca 100644 --- a/website/docs/cdktf/python/r/quicksight_ingestion.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_ingestion.html.markdown @@ -45,8 +45,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. ## Attribute Reference @@ -81,4 +81,4 @@ Using `terraform import`, import QuickSight Ingestion using the AWS account ID, % terraform import aws_quicksight_ingestion.example 123456789012,example-dataset-id,example-ingestion-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_ip_restriction.html.markdown b/website/docs/cdktf/python/r/quicksight_ip_restriction.html.markdown new file mode 100644 index 000000000000..07a3b9f82972 --- /dev/null +++ b/website/docs/cdktf/python/r/quicksight_ip_restriction.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_ip_restriction" +description: |- + Manages the content and status of IP rules. +--- + + + +# Resource: aws_quicksight_ip_restriction + +Manages the content and status of IP rules. + +~> Deletion of this resource clears all IP restrictions from a QuickSight account. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_ip_restriction import QuicksightIpRestriction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightIpRestriction(self, "example", + enabled=True, + ip_restriction_rule_map={ + "108.56.166.202/32": "Allow self" + }, + vpc_id_restriction_rule_map={ + "${(aws_vpc.example.id)}": "Main VPC" + } + ) +``` + +## Argument Reference + +This resource supports the following arguments: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `enabled` - (Required) Whether IP rules are turned on. +* `ip_restriction_rule_map` - (Optional) Map of allowed IPv4 CIDR ranges and descriptions. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `vpc_endpoint_id_restriction_rule_map` - (Optional) Map of allowed VPC endpoint IDs and descriptions. +* `vpc_id_restriction_rule_map` - (Optional) Map of VPC IDs and descriptions. Traffic from all VPC endpoints that are present in the specified VPC is allowed. + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight IP restriction using the AWS account ID. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_ip_restriction import QuicksightIpRestriction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightIpRestriction.generate_config_for_import(self, "example", "012345678901") +``` + +Using `terraform import`, import QuickSight IP restriction using the AWS account ID. For example: + +```console +% terraform import aws_quicksight_ip_restriction.example "012345678901" +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_key_registration.html.markdown b/website/docs/cdktf/python/r/quicksight_key_registration.html.markdown new file mode 100644 index 000000000000..5b5adb8a0fb0 --- /dev/null +++ b/website/docs/cdktf/python/r/quicksight_key_registration.html.markdown @@ -0,0 +1,84 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_key_registration" +description: |- + Registers customer managed keys in a Amazon QuickSight account. +--- + + + +# Resource: aws_quicksight_key_registration + +Registers customer managed keys in a Amazon QuickSight account. + +~> Deletion of this resource clears all CMK registrations from a QuickSight account. QuickSight then uses AWS owned keys to encrypt your resources. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_key_registration import QuicksightKeyRegistration +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightKeyRegistration(self, "example", + key_registration=[QuicksightKeyRegistrationKeyRegistration( + key_arn=example1.arn + ), QuicksightKeyRegistrationKeyRegistration( + default_key=True, + key_arn=example2.arn + ) + ] + ) +``` + +## Argument Reference + +This resource supports the following arguments: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `key_registration` - (Required) Registered keys. See [key_registration](#key_registration). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +### key_registration + +* `default_key` - (Optional) Whether the key is set as the default key for encryption and decryption use. +* `key_arn` - (Required) ARN of the AWS KMS key that is registered for encryption and decryption use. + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight key registration using the AWS account ID. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_key_registration import QuicksightKeyRegistration +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightKeyRegistration.generate_config_for_import(self, "example", "012345678901") +``` + +Using `terraform import`, import QuickSight key registration using the AWS account ID. For example: + +```console +% terraform import aws_quicksight_key_registration.example "012345678901" +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_namespace.html.markdown b/website/docs/cdktf/python/r/quicksight_namespace.html.markdown index 7e8c516ba519..df951990c582 100644 --- a/website/docs/cdktf/python/r/quicksight_namespace.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_namespace.html.markdown @@ -41,9 +41,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `identity_store` - (Optional) User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -88,4 +88,4 @@ Using `terraform import`, import QuickSight Namespace using the AWS account ID a % terraform import aws_quicksight_namespace.example 123456789012,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_refresh_schedule.html.markdown b/website/docs/cdktf/python/r/quicksight_refresh_schedule.html.markdown index bfd473d1d92e..6f15aca1a8ae 100644 --- a/website/docs/cdktf/python/r/quicksight_refresh_schedule.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_refresh_schedule.html.markdown @@ -120,8 +120,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. ### schedule @@ -173,4 +173,4 @@ Using `terraform import`, import a QuickSight Refresh Schedule using the AWS acc % terraform import aws_quicksight_refresh_schedule.example 123456789012,dataset-id,schedule-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_role_custom_permission.html.markdown b/website/docs/cdktf/python/r/quicksight_role_custom_permission.html.markdown new file mode 100644 index 000000000000..d390fd77d247 --- /dev/null +++ b/website/docs/cdktf/python/r/quicksight_role_custom_permission.html.markdown @@ -0,0 +1,77 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_role_custom_permission" +description: |- + Manages the custom permissions that are associated with a role. +--- + + + +# Resource: aws_quicksight_role_custom_permission + +Manages the custom permissions that are associated with a role. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_role_custom_permission import QuicksightRoleCustomPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightRoleCustomPermission(self, "example", + custom_permissions_name=Token.as_string(aws_quicksight_custom_permissions_example.custom_permissions_name), + role="READER" + ) +``` + +## Argument Reference + +The following arguments are required: + +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. +* `role` - (Required, Forces new resource) Role. Valid values are `ADMIN`, `AUTHOR`, `READER`, `ADMIN_PRO`, `AUTHOR_PRO`, and `READER_PRO`. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace containing the role. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight role custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace` and `role`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_role_custom_permission import QuicksightRoleCustomPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightRoleCustomPermission.generate_config_for_import(self, "example", "012345678901,default,READER") +``` + +Using `terraform import`, import QuickSight role custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace`, and `role`. For example: + +```console +% terraform import aws_quicksight_role_custom_permission.example 012345678901,default,READER +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_role_membership.html.markdown b/website/docs/cdktf/python/r/quicksight_role_membership.html.markdown index 6da86ccca5a5..5b65d264d0f7 100644 --- a/website/docs/cdktf/python/r/quicksight_role_membership.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_role_membership.html.markdown @@ -44,9 +44,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. Defaults to the account of the caller identity if not configured. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) Name of the namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -77,4 +77,4 @@ Using `terraform import`, import QuickSight Role Membership using a comma-delimi % terraform import aws_quicksight_role_membership.example 012345678901,default,READER,example-group ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_template.html.markdown b/website/docs/cdktf/python/r/quicksight_template.html.markdown index d90fdf9b2cea..cc07d9577ae9 100644 --- a/website/docs/cdktf/python/r/quicksight_template.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_template.html.markdown @@ -127,10 +127,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `definition` - (Optional) A detailed template definition. Only one of `definition` or `source_entity` should be configured. See [definition](#definition). * `permissions` - (Optional) A set of resource permissions on the template. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `source_entity` - (Optional) The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `source_entity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -214,4 +214,4 @@ Using `terraform import`, import a QuickSight Template using the AWS account ID % terraform import aws_quicksight_template.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_template_alias.html.markdown b/website/docs/cdktf/python/r/quicksight_template_alias.html.markdown index 85c56c93b0ef..6da15ab2cb54 100644 --- a/website/docs/cdktf/python/r/quicksight_template_alias.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_template_alias.html.markdown @@ -45,8 +45,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. ## Attribute Reference @@ -80,4 +80,4 @@ Using `terraform import`, import QuickSight Template Alias using the AWS account % terraform import aws_quicksight_template_alias.example 123456789012,example-id,example-alias ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_theme.html.markdown b/website/docs/cdktf/python/r/quicksight_theme.html.markdown index 77bbefec20b4..8e7b214825a4 100644 --- a/website/docs/cdktf/python/r/quicksight_theme.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_theme.html.markdown @@ -47,16 +47,16 @@ class MyConvertedCode(TerraformStack): The following arguments are required: -* `theme_id` - (Required, Forces new resource) Identifier of the theme. * `base_theme_id` - (Required) The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis. -* `name` - (Required) Display name of the theme. * `configuration` - (Required) The theme configuration, which contains the theme display properties. See [configuration](#configuration). +* `name` - (Required) Display name of the theme. +* `theme_id` - (Required, Forces new resource) Identifier of the theme. The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional, Forces new resource) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `permissions` - (Optional) A set of resource permissions on the theme. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `version_description` - (Optional) A description of the current theme version being created/updated. @@ -176,4 +176,4 @@ Using `terraform import`, import a QuickSight Theme using the AWS account ID and % terraform import aws_quicksight_theme.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_user.html.markdown b/website/docs/cdktf/python/r/quicksight_user.html.markdown index 5e2edea69722..26d3f61a1eb7 100644 --- a/website/docs/cdktf/python/r/quicksight_user.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_user.html.markdown @@ -87,15 +87,15 @@ class MyConvertedCode(TerraformStack): The following arguments are required: * `email` - (Required) Email address of the user that you want to register. -* `identity_type` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`. -* `user_role` - (Required) Amazon QuickSight role for the user. Value values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`. +* `identity_type` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`, `IAM_IDENTITY_CENTER`. +* `user_role` - (Required) Amazon QuickSight role for the user. Valid values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`, `RESTRICTED_AUTHOR`, `RESTRICTED_READER`. The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) ID for the AWS account that the user is in. Use the ID for the AWS account that contains your Amazon QuickSight account. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `iam_arn` - (Optional) ARN of the IAM user or role that you are registering with Amazon QuickSight. Required only for users with an identity type of `IAM`. * `namespace` - (Optional) The Amazon Quicksight namespace to create the user in. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `session_name` - (Optional) Name of the IAM session to use when assuming roles that can embed QuickSight dashboards. Only valid for registering users using an assumed IAM role. Additionally, if registering multiple users using the same IAM role, each user needs to have a unique session name. * `user_name` - (Optional) Amazon QuickSight user name that you want to create for the user you are registering. Required only for users with an identity type of `QUICKSIGHT`. @@ -111,4 +111,4 @@ This resource exports the following attributes in addition to the arguments abov You cannot import this resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_user_custom_permission.html.markdown b/website/docs/cdktf/python/r/quicksight_user_custom_permission.html.markdown new file mode 100644 index 000000000000..06d134ee8c3e --- /dev/null +++ b/website/docs/cdktf/python/r/quicksight_user_custom_permission.html.markdown @@ -0,0 +1,77 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_user_custom_permission" +description: |- + Manages the custom permissions profile for a user. +--- + + + +# Resource: aws_quicksight_user_custom_permission + +Manages the custom permissions profile for a user. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_user_custom_permission import QuicksightUserCustomPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightUserCustomPermission(self, "example", + custom_permissions_name=Token.as_string(aws_quicksight_custom_permissions_example.custom_permissions_name), + user_name=Token.as_string(aws_quicksight_user_example.user_name) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. +* `user_name` - (Required, Forces new resource) Username of the user. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace that the user belongs to. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight user custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace` and `user_name`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.quicksight_user_custom_permission import QuicksightUserCustomPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + QuicksightUserCustomPermission.generate_config_for_import(self, "example", "012345678901,default,user1") +``` + +Using `terraform import`, import QuickSight user custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace`, and `user_name`. For example: + +```console +% terraform import aws_quicksight_user_custom_permission.example 012345678901,default,user1 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/quicksight_vpc_connection.html.markdown b/website/docs/cdktf/python/r/quicksight_vpc_connection.html.markdown index 768e69d94e1b..735ecb4c90bb 100644 --- a/website/docs/cdktf/python/r/quicksight_vpc_connection.html.markdown +++ b/website/docs/cdktf/python/r/quicksight_vpc_connection.html.markdown @@ -79,9 +79,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `dns_resolvers` - (Optional) A list of IP addresses of DNS resolver endpoints for the VPC connection. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -126,4 +126,4 @@ Using `terraform import`, import QuickSight VPC connection using the AWS account % terraform import aws_quicksight_vpc_connection.example 123456789012,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/rds_instance_state.html.markdown b/website/docs/cdktf/python/r/rds_instance_state.html.markdown index e32a54a52dc0..d43e47dfeace 100644 --- a/website/docs/cdktf/python/r/rds_instance_state.html.markdown +++ b/website/docs/cdktf/python/r/rds_instance_state.html.markdown @@ -46,9 +46,7 @@ This resource supports the following arguments: ## Attribute Reference -This resource exports the following attributes in addition to the arguments above: - -* `identifier` - DB Instance Identifier +This resource exports no additional attributes. ## Timeouts @@ -59,7 +57,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -76,10 +74,10 @@ class MyConvertedCode(TerraformStack): RdsInstanceState.generate_config_for_import(self, "example", "db-L72FUFBZX2RRXT3HOJSIUQVOKE") ``` -Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```console % terraform import aws_rds_instance_state.example rds_instance_state-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/rekognition_collection.html.markdown b/website/docs/cdktf/python/r/rekognition_collection.html.markdown index ae51dc5b2ed8..4f69883b9775 100644 --- a/website/docs/cdktf/python/r/rekognition_collection.html.markdown +++ b/website/docs/cdktf/python/r/rekognition_collection.html.markdown @@ -61,7 +61,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `collection_id`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -78,10 +78,10 @@ class MyConvertedCode(TerraformStack): RekognitionCollection.generate_config_for_import(self, "example", "collection-id-12345678") ``` -Using `terraform import`, import Rekognition Collection using the `example_id_arg`. For example: +Using `terraform import`, import Rekognition Collection using the `collection_id`. For example: ```console % terraform import aws_rekognition_collection.example collection-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/rekognition_project.html.markdown b/website/docs/cdktf/python/r/rekognition_project.html.markdown index 4f2f09b960c6..2b65556f292f 100644 --- a/website/docs/cdktf/python/r/rekognition_project.html.markdown +++ b/website/docs/cdktf/python/r/rekognition_project.html.markdown @@ -84,7 +84,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `name`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -107,4 +107,4 @@ Using `terraform import`, import Rekognition Project using the `name`. For examp % terraform import aws_rekognition_project.example project-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/route53profiles_association.html.markdown b/website/docs/cdktf/python/r/route53profiles_association.html.markdown index 74fbb1479cd8..21c96be48f07 100644 --- a/website/docs/cdktf/python/r/route53profiles_association.html.markdown +++ b/website/docs/cdktf/python/r/route53profiles_association.html.markdown @@ -96,10 +96,10 @@ class MyConvertedCode(TerraformStack): Route53ProfilesAssociation.generate_config_for_import(self, "example", "rpa-id-12345678") ``` -Using `terraform import`, import Route 53 Profiles Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Association using the `id`. For example: ```console % terraform import aws_route53profiles_association.example rpa-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/route53profiles_profile.html.markdown b/website/docs/cdktf/python/r/route53profiles_profile.html.markdown index 25949ce6b94b..b4b594e80304 100644 --- a/website/docs/cdktf/python/r/route53profiles_profile.html.markdown +++ b/website/docs/cdktf/python/r/route53profiles_profile.html.markdown @@ -67,7 +67,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `id`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -84,10 +84,10 @@ class MyConvertedCode(TerraformStack): Route53ProfilesProfile.generate_config_for_import(self, "example", "rp-12345678") ``` -Using `terraform import`, import Route 53 Profiles Profile using the `example`. For example: +Using `terraform import`, import Route 53 Profiles Profile using the `id`. For example: ```console % terraform import aws_route53profiles_profile.example rp-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/route53profiles_resource_association.html.markdown b/website/docs/cdktf/python/r/route53profiles_resource_association.html.markdown index a09a8a3eeb1f..c48027791bad 100644 --- a/website/docs/cdktf/python/r/route53profiles_resource_association.html.markdown +++ b/website/docs/cdktf/python/r/route53profiles_resource_association.html.markdown @@ -105,10 +105,10 @@ class MyConvertedCode(TerraformStack): Route53ProfilesResourceAssociation.generate_config_for_import(self, "example", "rpa-id-12345678") ``` -Using `terraform import`, import Route 53 Profiles Resource Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Resource Association using the `id`. For example: ```console % terraform import aws_route53profiles_resource_association.example rpa-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/s3_access_point.html.markdown b/website/docs/cdktf/python/r/s3_access_point.html.markdown index 189bae6e9cec..bb02d3c099f8 100644 --- a/website/docs/cdktf/python/r/s3_access_point.html.markdown +++ b/website/docs/cdktf/python/r/s3_access_point.html.markdown @@ -125,11 +125,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `account_id` - (Optional) AWS account ID for the owner of the bucket for which you want to create an access point. Defaults to automatically determined account ID of the Terraform AWS provider. * `bucket_account_id` - (Optional) AWS account ID associated with the S3 bucket associated with this access point. * `policy` - (Optional) Valid JSON document that specifies the policy that you want to apply to this access point. Removing `policy` from your configuration or setting `policy` to null or an empty string (i.e., `policy = ""`) _will not_ delete the policy since it could have been set by `aws_s3control_access_point_policy`. To remove the `policy`, set it to `"{}"` (an empty JSON document). * `public_access_block_configuration` - (Optional) Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Map of tags to assign to the bucket. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_configuration` - (Optional) Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Required for S3 on Outposts. Detailed below. ### public_access_block_configuration Configuration Block @@ -165,6 +166,7 @@ Note: S3 access points only support secure access by HTTPS. HTTP isn't supported * `has_public_access_policy` - Indicates whether this access point currently has a policy that allows public access. * `id` - For Access Point of an AWS Partition S3 Bucket, the AWS account ID and access point name separated by a colon (`:`). For S3 on Outposts Bucket, the ARN of the Access Point. * `network_origin` - Indicates whether this access point allows access from the public Internet. Values are `VPC` (the access point doesn't allow access from the public Internet) and `Internet` (the access point allows access from the public Internet, subject to the access point and bucket access policies). +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Import @@ -218,4 +220,4 @@ Import using the ARN for Access Points associated with an S3 on Outposts Bucket: % terraform import aws_s3_access_point.example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-1234567890123456/accesspoint/example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/securityhub_standards_subscription.html.markdown b/website/docs/cdktf/python/r/securityhub_standards_subscription.html.markdown index 2daec28ad335..0ed47a76ee2b 100644 --- a/website/docs/cdktf/python/r/securityhub_standards_subscription.html.markdown +++ b/website/docs/cdktf/python/r/securityhub_standards_subscription.html.markdown @@ -57,7 +57,9 @@ Currently available standards (remember to replace `${var.partition}` and `${var | CIS AWS Foundations Benchmark v1.4.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/1.4.0` | | CIS AWS Foundations Benchmark v3.0.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/3.0.0` | | NIST SP 800-53 Rev. 5 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-53/v/5.0.0` | -| PCI DSS | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| NIST SP 800-171 Rev. 2 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-171/v/2.0.0` | +| PCI DSS v3.2.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| PCI DSS v4.0.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/4.0.1` | ## Attribute Reference @@ -135,4 +137,4 @@ Using `terraform import`, import Security Hub standards subscriptions using the % terraform import aws_securityhub_standards_subscription.nist_800_53_rev_5 arn:aws:securityhub:eu-west-1:123456789012:subscription/nist-800-53/v/5.0.0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sesv2_email_identity_policy.html.markdown b/website/docs/cdktf/python/r/sesv2_email_identity_policy.html.markdown index 8238f2bb3a2e..f5efc0286042 100644 --- a/website/docs/cdktf/python/r/sesv2_email_identity_policy.html.markdown +++ b/website/docs/cdktf/python/r/sesv2_email_identity_policy.html.markdown @@ -55,7 +55,7 @@ This resource exports no additional attributes. ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `id` (`email_identity|policy_name`). For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `email_identity` and `policy_name` separated by `|`. For example: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -72,10 +72,10 @@ class MyConvertedCode(TerraformStack): Sesv2EmailIdentityPolicy.generate_config_for_import(self, "example", "example_email_identity|example_policy_name") ``` -Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `example_id_arg`. For example: +Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `email_identity` and `policy_name` separated by `|`. For example: ```console % terraform import aws_sesv2_email_identity_policy.example example_email_identity|example_policy_name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssm_patch_baseline.html.markdown b/website/docs/cdktf/python/r/ssm_patch_baseline.html.markdown index 3066310edbd5..7d237443c7fa 100644 --- a/website/docs/cdktf/python/r/ssm_patch_baseline.html.markdown +++ b/website/docs/cdktf/python/r/ssm_patch_baseline.html.markdown @@ -183,6 +183,7 @@ The following arguments are optional: * `approved_patches_compliance_level` - (Optional) Compliance level for approved patches. This means that if an approved patch is reported as missing, this is the severity of the compliance violation. Valid values are `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, `INFORMATIONAL`, `UNSPECIFIED`. The default value is `UNSPECIFIED`. * `approved_patches_enable_non_security` - (Optional) Whether the list of approved patches includes non-security updates that should be applied to the instances. Applies to Linux instances only. * `approved_patches` - (Optional) List of explicitly approved patches for the baseline. Cannot be specified with `approval_rule`. +* `available_security_updates_compliance_status` - (Optional) Indicates the compliance status of managed nodes for which security-related patches are available but were not approved. Supported for Windows Server managed nodes only. Valid values are `COMPLIANT`, `NON_COMPLIANT`. * `description` - (Optional) Description of the patch baseline. * `global_filter` - (Optional) Set of global filters used to exclude patches from the baseline. Up to 4 global filters can be specified using Key/Value pairs. Valid Keys are `PRODUCT`, `CLASSIFICATION`, `MSRC_SEVERITY`, and `PATCH_ID`. * `operating_system` - (Optional) Operating system the patch baseline applies to. Valid values are `ALMA_LINUX`, `AMAZON_LINUX`, `AMAZON_LINUX_2`, `AMAZON_LINUX_2022`, `AMAZON_LINUX_2023`, `CENTOS`, `DEBIAN`, `MACOS`, `ORACLE_LINUX`, `RASPBIAN`, `REDHAT_ENTERPRISE_LINUX`, `ROCKY_LINUX`, `SUSE`, `UBUNTU`, and `WINDOWS`. The default value is `WINDOWS`. @@ -243,4 +244,4 @@ Using `terraform import`, import SSM Patch Baselines using their baseline ID. Fo % terraform import aws_ssm_patch_baseline.example pb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssm_service_setting.html.markdown b/website/docs/cdktf/python/r/ssm_service_setting.html.markdown index 37f62b0cb5cd..bc41a89934f7 100644 --- a/website/docs/cdktf/python/r/ssm_service_setting.html.markdown +++ b/website/docs/cdktf/python/r/ssm_service_setting.html.markdown @@ -37,7 +37,7 @@ class MyConvertedCode(TerraformStack): This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `setting_id` - (Required) ID of the service setting. +* `setting_id` - (Required) ID of the service setting. Valid values are shown in the [AWS documentation](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_GetServiceSetting.html#API_GetServiceSetting_RequestSyntax). * `setting_value` - (Required) Value of the service setting. ## Attribute Reference @@ -72,4 +72,4 @@ Using `terraform import`, import AWS SSM Service Setting using the `setting_id`. % terraform import aws_ssm_service_setting.example arn:aws:ssm:us-east-1:123456789012:servicesetting/ssm/parameter-store/high-throughput-enabled ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/transcribe_vocabulary.html.markdown b/website/docs/cdktf/python/r/transcribe_vocabulary.html.markdown index 2082e8126417..a94284b3a491 100644 --- a/website/docs/cdktf/python/r/transcribe_vocabulary.html.markdown +++ b/website/docs/cdktf/python/r/transcribe_vocabulary.html.markdown @@ -58,7 +58,6 @@ class MyConvertedCode(TerraformStack): The following arguments are required: * `language_code` - (Required) The language code you selected for your vocabulary. -* `vocabulary_file_uri` - (Required) The Amazon S3 location (URI) of the text file that contains your custom vocabulary. * `vocabulary_name` - (Required) The name of the Vocabulary. The following arguments are optional: @@ -109,4 +108,4 @@ Using `terraform import`, import Transcribe Vocabulary using the `vocabulary_nam % terraform import aws_transcribe_vocabulary.example example-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/verifiedpermissions_policy_store.html.markdown b/website/docs/cdktf/python/r/verifiedpermissions_policy_store.html.markdown index d6798817772d..a0796fe741fb 100644 --- a/website/docs/cdktf/python/r/verifiedpermissions_policy_store.html.markdown +++ b/website/docs/cdktf/python/r/verifiedpermissions_policy_store.html.markdown @@ -46,6 +46,7 @@ The following arguments are required: The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `deletion_protection` - (Optional) Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. Valid Values: `ENABLED`, `DISABLED`. Default value: `DISABLED`. * `description` - (Optional) A description of the Policy Store. * `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -82,4 +83,4 @@ Using `terraform import`, import Verified Permissions Policy Store using the `po % terraform import aws_verifiedpermissions_policy_store.example DxQg2j8xvXJQ1tQCYNWj9T ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/wafv2_regex_pattern_set.html.markdown b/website/docs/cdktf/python/r/wafv2_regex_pattern_set.html.markdown index a11445a25b7c..87757331a268 100644 --- a/website/docs/cdktf/python/r/wafv2_regex_pattern_set.html.markdown +++ b/website/docs/cdktf/python/r/wafv2_regex_pattern_set.html.markdown @@ -52,7 +52,7 @@ This resource supports the following arguments: * `name_prefix` - (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `name`. * `description` - (Optional) A friendly description of the regular expression pattern set. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. -* `regular_expression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. A maximum of 10 `regular_expression` blocks may be specified. +* `regular_expression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. * `tags` - (Optional) An array of key:value pairs to associate with the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### Regular Expression @@ -92,4 +92,4 @@ Using `terraform import`, import WAFv2 Regex Pattern Sets using `ID/name/scope`. % terraform import aws_wafv2_regex_pattern_set.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/wafv2_web_acl.html.markdown b/website/docs/cdktf/python/r/wafv2_web_acl.html.markdown index ac13e80cc171..9ed6dcda4dcb 100644 --- a/website/docs/cdktf/python/r/wafv2_web_acl.html.markdown +++ b/website/docs/cdktf/python/r/wafv2_web_acl.html.markdown @@ -14,6 +14,8 @@ Creates a WAFv2 Web ACL resource. ~> **Note** In `field_to_match` blocks, _e.g._, in `byte_match_statement`, the `body` block includes an optional argument `oversize_handling`. AWS indicates this argument will be required starting February 2023. To avoid configurations breaking when that change happens, treat the `oversize_handling` argument as **required** as soon as possible. +!> **Warning:** If you use the `aws_wafv2_web_acl_rule_group_association` resource to associate rule groups with this Web ACL, you must add `lifecycle { ignore_changes = [rule] }` to this resource to prevent configuration drift. The association resource modifies the Web ACL's rules outside of this resource's direct management. + ## Example Usage This resource is based on `aws_wafv2_rule_group`, check the documentation of the `aws_wafv2_rule_group` resource to see examples of the various available statements. @@ -1263,4 +1265,4 @@ Using `terraform import`, import WAFv2 Web ACLs using `ID/Name/Scope`. For examp % terraform import aws_wafv2_web_acl.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/wafv2_web_acl_rule_group_association.html.markdown b/website/docs/cdktf/python/r/wafv2_web_acl_rule_group_association.html.markdown new file mode 100644 index 000000000000..676c41ab3e94 --- /dev/null +++ b/website/docs/cdktf/python/r/wafv2_web_acl_rule_group_association.html.markdown @@ -0,0 +1,598 @@ +--- +subcategory: "WAF" +layout: "aws" +page_title: "AWS: aws_wafv2_web_acl_rule_group_association" +description: |- + Associates a WAFv2 Rule Group with a Web ACL by adding a rule that references the Rule Group. +--- + + + +# Resource: aws_wafv2_web_acl_rule_group_association + +Associates a WAFv2 Rule Group (custom or managed) with a Web ACL by adding a rule that references the Rule Group. Use this resource to apply the rules defined in a Rule Group to a Web ACL without duplicating rule definitions. + +This resource supports both: + +- **Custom Rule Groups**: User-created rule groups that you manage within your AWS account +- **Managed Rule Groups**: Pre-configured rule groups provided by AWS or third-party vendors + +!> **Warning:** Verify the rule names in your `rule_action_override`s carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. + +!> **Warning:** Using this resource will cause the associated Web ACL resource to show configuration drift in the `rule` argument unless you add `lifecycle { ignore_changes = [rule] }` to the Web ACL resource configuration. This is because this resource modifies the Web ACL's rules outside of the Web ACL resource's direct management. + +~> **Note:** This resource creates a rule within the Web ACL that references the entire Rule Group. The rule group's individual rules are evaluated as a unit when requests are processed by the Web ACL. + +## Example Usage + +### Custom Rule Group - Basic Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_rule_group import Wafv2RuleGroup +from imports.aws.wafv2_web_acl import Wafv2WebAcl +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Wafv2RuleGroup(self, "example", + capacity=10, + name="example-rule-group", + rule=[Wafv2RuleGroupRule( + action=Wafv2RuleGroupRuleAction( + block=Wafv2RuleGroupRuleActionBlock() + ), + name="block-suspicious-requests", + priority=1, + statement={ + "geo_match_statement": { + "country_codes": ["CN", "RU"] + } + }, + visibility_config=Wafv2RuleGroupRuleVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="block-suspicious-requests", + sampled_requests_enabled=True + ) + ) + ], + scope="REGIONAL", + visibility_config=Wafv2RuleGroupVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="example-rule-group", + sampled_requests_enabled=True + ) + ) + aws_wafv2_web_acl_example = Wafv2WebAcl(self, "example_1", + default_action=Wafv2WebAclDefaultAction( + allow=Wafv2WebAclDefaultActionAllow() + ), + lifecycle=TerraformResourceLifecycle( + ignore_changes=[rule] + ), + name="example-web-acl", + scope="REGIONAL", + visibility_config=Wafv2WebAclVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="example-web-acl", + sampled_requests_enabled=True + ) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_example.override_logical_id("example") + aws_wafv2_web_acl_rule_group_association_example = + Wafv2WebAclRuleGroupAssociation(self, "example_2", + priority=100, + rule_group_reference=[Wafv2WebAclRuleGroupAssociationRuleGroupReference( + arn=example.arn + ) + ], + rule_name="example-rule-group-rule", + web_acl_arn=Token.as_string(aws_wafv2_web_acl_example.arn) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_rule_group_association_example.override_logical_id("example") +``` + +### Managed Rule Group - Basic Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl import Wafv2WebAcl +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Wafv2WebAcl(self, "example", + default_action=Wafv2WebAclDefaultAction( + allow=Wafv2WebAclDefaultActionAllow() + ), + lifecycle=TerraformResourceLifecycle( + ignore_changes=[rule] + ), + name="example-web-acl", + scope="REGIONAL", + visibility_config=Wafv2WebAclVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="example-web-acl", + sampled_requests_enabled=True + ) + ) + Wafv2WebAclRuleGroupAssociation(self, "managed_example", + managed_rule_group=[Wafv2WebAclRuleGroupAssociationManagedRuleGroup( + name="AWSManagedRulesCommonRuleSet", + vendor_name="AWS" + ) + ], + priority=50, + rule_name="aws-common-rule-set", + web_acl_arn=example.arn + ) +``` + +### Managed Rule Group - With Version + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Wafv2WebAclRuleGroupAssociation(self, "managed_versioned", + managed_rule_group=[Wafv2WebAclRuleGroupAssociationManagedRuleGroup( + name="AWSManagedRulesCommonRuleSet", + vendor_name="AWS", + version="Version_1.0" + ) + ], + priority=60, + rule_name="aws-common-rule-set-versioned", + web_acl_arn=example.arn + ) +``` + +### Managed Rule Group - With Rule Action Overrides + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Wafv2WebAclRuleGroupAssociation(self, "managed_with_overrides", + managed_rule_group=[Wafv2WebAclRuleGroupAssociationManagedRuleGroup( + name="AWSManagedRulesCommonRuleSet", + rule_action_override=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverride( + action_to_use=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUse( + count=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUseCount( + custom_request_handling=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUseCountCustomRequestHandling( + insert_header=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUseCountCustomRequestHandlingInsertHeader( + name="X-RFI-Override", + value="counted" + ) + ] + ) + ] + ) + ] + ) + ], + name="GenericRFI_BODY" + ), Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverride( + action_to_use=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUse( + captcha=[Wafv2WebAclRuleGroupAssociationManagedRuleGroupRuleActionOverrideActionToUseCaptcha()] + ) + ], + name="SizeRestrictions_BODY" + ) + ], + vendor_name="AWS" + ) + ], + priority=70, + rule_name="aws-common-rule-set-with-overrides", + web_acl_arn=example.arn + ) +``` + +### Custom Rule Group - With Override Action + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Wafv2WebAclRuleGroupAssociation(self, "example", + override_action="count", + priority=100, + rule_group_reference=[Wafv2WebAclRuleGroupAssociationRuleGroupReference( + arn=Token.as_string(aws_wafv2_rule_group_example.arn) + ) + ], + rule_name="example-rule-group-rule", + web_acl_arn=Token.as_string(aws_wafv2_web_acl_example.arn) + ) +``` + +### Custom Rule Group - With Rule Action Overrides + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_rule_group import Wafv2RuleGroup +from imports.aws.wafv2_web_acl import Wafv2WebAcl +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Wafv2RuleGroup(self, "example", + capacity=10, + name="example-rule-group", + rule=[Wafv2RuleGroupRule( + action=Wafv2RuleGroupRuleAction( + block=Wafv2RuleGroupRuleActionBlock() + ), + name="geo-block-rule", + priority=1, + statement={ + "geo_match_statement": { + "country_codes": ["CN", "RU"] + } + }, + visibility_config=Wafv2RuleGroupRuleVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="geo-block-rule", + sampled_requests_enabled=True + ) + ), Wafv2RuleGroupRule( + action=Wafv2RuleGroupRuleAction( + block=Wafv2RuleGroupRuleActionBlock() + ), + name="rate-limit-rule", + priority=2, + statement={ + "rate_based_statement": { + "aggregate_key_type": "IP", + "limit": 1000 + } + }, + visibility_config=Wafv2RuleGroupRuleVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="rate-limit-rule", + sampled_requests_enabled=True + ) + ) + ], + scope="REGIONAL", + visibility_config=Wafv2RuleGroupVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="example-rule-group", + sampled_requests_enabled=True + ) + ) + aws_wafv2_web_acl_example = Wafv2WebAcl(self, "example_1", + default_action=Wafv2WebAclDefaultAction( + allow=Wafv2WebAclDefaultActionAllow() + ), + lifecycle=TerraformResourceLifecycle( + ignore_changes=[rule] + ), + name="example-web-acl", + scope="REGIONAL", + visibility_config=Wafv2WebAclVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="example-web-acl", + sampled_requests_enabled=True + ) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_example.override_logical_id("example") + aws_wafv2_web_acl_rule_group_association_example = + Wafv2WebAclRuleGroupAssociation(self, "example_2", + priority=100, + rule_group_reference=[Wafv2WebAclRuleGroupAssociationRuleGroupReference( + arn=example.arn, + rule_action_override=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverride( + action_to_use=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUse( + count=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCount( + custom_request_handling=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCountCustomRequestHandling( + insert_header=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCountCustomRequestHandlingInsertHeader( + name="X-Geo-Block-Override", + value="counted" + ) + ] + ) + ] + ) + ] + ) + ], + name="geo-block-rule" + ), Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverride( + action_to_use=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUse( + captcha=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCaptcha( + custom_request_handling=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCaptchaCustomRequestHandling( + insert_header=[Wafv2WebAclRuleGroupAssociationRuleGroupReferenceRuleActionOverrideActionToUseCaptchaCustomRequestHandlingInsertHeader( + name="X-Rate-Limit-Override", + value="captcha-required" + ) + ] + ) + ] + ) + ] + ) + ], + name="rate-limit-rule" + ) + ] + ) + ], + rule_name="example-rule-group-rule", + web_acl_arn=Token.as_string(aws_wafv2_web_acl_example.arn) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_rule_group_association_example.override_logical_id("example") +``` + +### Custom Rule Group - CloudFront Web ACL + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_rule_group import Wafv2RuleGroup +from imports.aws.wafv2_web_acl import Wafv2WebAcl +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + cloudfront_example = Wafv2RuleGroup(self, "cloudfront_example", + capacity=10, + name="cloudfront-rule-group", + rule=[Wafv2RuleGroupRule( + action=Wafv2RuleGroupRuleAction( + block=Wafv2RuleGroupRuleActionBlock() + ), + name="rate-limit", + priority=1, + statement={ + "rate_based_statement": { + "aggregate_key_type": "IP", + "limit": 2000 + } + }, + visibility_config=Wafv2RuleGroupRuleVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="rate-limit", + sampled_requests_enabled=True + ) + ) + ], + scope="CLOUDFRONT", + visibility_config=Wafv2RuleGroupVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="cloudfront-rule-group", + sampled_requests_enabled=True + ) + ) + aws_wafv2_web_acl_cloudfront_example = Wafv2WebAcl(self, "cloudfront_example_1", + default_action=Wafv2WebAclDefaultAction( + allow=Wafv2WebAclDefaultActionAllow() + ), + lifecycle=TerraformResourceLifecycle( + ignore_changes=[rule] + ), + name="cloudfront-web-acl", + scope="CLOUDFRONT", + visibility_config=Wafv2WebAclVisibilityConfig( + cloudwatch_metrics_enabled=True, + metric_name="cloudfront-web-acl", + sampled_requests_enabled=True + ) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_cloudfront_example.override_logical_id("cloudfront_example") + aws_wafv2_web_acl_rule_group_association_cloudfront_example = + Wafv2WebAclRuleGroupAssociation(self, "cloudfront_example_2", + priority=50, + rule_group_reference=[Wafv2WebAclRuleGroupAssociationRuleGroupReference( + arn=cloudfront_example.arn + ) + ], + rule_name="cloudfront-rule-group-rule", + web_acl_arn=Token.as_string(aws_wafv2_web_acl_cloudfront_example.arn) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_wafv2_web_acl_rule_group_association_cloudfront_example.override_logical_id("cloudfront_example") +``` + +## Argument Reference + +The following arguments are required: + +* `rule_name` - (Required) Name of the rule to create in the Web ACL that references the rule group. Must be between 1 and 128 characters. +* `priority` - (Required) Priority of the rule within the Web ACL. Rules are evaluated in order of priority, with lower numbers evaluated first. +* `web_acl_arn` - (Required) ARN of the Web ACL to associate the Rule Group with. + +The following arguments are optional: + +* `managed_rule_group` - (Optional) Managed Rule Group configuration. One of `rule_group_reference` or `managed_rule_group` is required. Conflicts with `rule_group_reference`. [See below](#managed_rule_group). +* `override_action` - (Optional) Override action for the rule group. Valid values are `none` and `count`. Defaults to `none`. When set to `count`, the actions defined in the rule group rules are overridden to count matches instead of blocking or allowing requests. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `rule_group_reference` - (Optional) Custom Rule Group reference configuration. One of `rule_group_reference` or `managed_rule_group` is required. Conflicts with `managed_rule_group`. [See below](#rule_group_reference). + +### rule_group_reference + +* `arn` - (Required) ARN of the Rule Group to associate with the Web ACL. +* `rule_action_override` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### managed_rule_group + +* `name` - (Required) Name of the managed rule group. +* `vendor_name` - (Required) Name of the managed rule group vendor. For AWS managed rule groups, this is `AWS`. +* `version` - (Optional) Version of the managed rule group. If not specified, the default version is used. +* `rule_action_override` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### rule_action_override + +* `name` - (Required) Name of the rule to override within the rule group. Verify the name carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. +* `action_to_use` - (Required) Action to use instead of the rule's original action. [See below](#action_to_use). + +### action_to_use + +Exactly one of the following action blocks must be specified: + +* `allow` - (Optional) Allow the request. [See below](#allow). +* `block` - (Optional) Block the request. [See below](#block). +* `captcha` - (Optional) Require CAPTCHA verification. [See below](#captcha). +* `challenge` - (Optional) Require challenge verification. [See below](#challenge). +* `count` - (Optional) Count the request without taking action. [See below](#count). + +### allow + +* `custom_request_handling` - (Optional) Custom handling for allowed requests. [See below](#custom_request_handling). + +### block + +* `custom_response` - (Optional) Custom response for blocked requests. [See below](#custom_response). + +### captcha + +* `custom_request_handling` - (Optional) Custom handling for CAPTCHA requests. [See below](#custom_request_handling). + +### challenge + +* `custom_request_handling` - (Optional) Custom handling for challenge requests. [See below](#custom_request_handling). + +### count + +* `custom_request_handling` - (Optional) Custom handling for counted requests. [See below](#custom_request_handling). + +### custom_request_handling + +* `insert_header` - (Required) Headers to insert into the request. [See below](#insert_header). + +### custom_response + +* `custom_response_body_key` - (Optional) Key of a custom response body to use. +* `response_code` - (Required) HTTP response code to return (200-599). +* `response_header` - (Optional) Headers to include in the response. [See below](#response_header). + +### insert_header + +* `name` - (Required) Name of the header to insert. +* `value` - (Required) Value of the header to insert. + +### response_header + +* `name` - (Required) Name of the response header. +* `value` - (Required) Value of the response header. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +None. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `update` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Wafv2WebAclRuleGroupAssociation.generate_config_for_import(self, "example", "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule") +``` + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.wafv2_web_acl_rule_group_association import Wafv2WebAclRuleGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Wafv2WebAclRuleGroupAssociation.generate_config_for_import(self, "managedExample", "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set") +``` + +Using `terraform import`, import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule" +``` + +Using `terraform import`, import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.managed_example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set" +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/cloudwatch_event_bus.html.markdown b/website/docs/cdktf/typescript/d/cloudwatch_event_bus.html.markdown index 3a34a6957da4..8d57edbf8ac0 100644 --- a/website/docs/cdktf/typescript/d/cloudwatch_event_bus.html.markdown +++ b/website/docs/cdktf/typescript/d/cloudwatch_event_bus.html.markdown @@ -53,5 +53,8 @@ This data source exports the following attributes in addition to the arguments a * `description` - Event bus description. * `id` - Name of the event bus. * `kmsKeyIdentifier` - Identifier of the AWS KMS customer managed key for EventBridge to use to encrypt events on this event bus, if one has been specified. +* `logConfig` - Block for logging configuration settings for the event bus. + * `includeDetail` - Whether EventBridge include detailed event information in the records it generates. + * `level` - Level of logging detail to include. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/codebuild_fleet.html.markdown b/website/docs/cdktf/typescript/d/codebuild_fleet.html.markdown index 4dcf8ae8c5da..349fc8d82fcc 100644 --- a/website/docs/cdktf/typescript/d/codebuild_fleet.html.markdown +++ b/website/docs/cdktf/typescript/d/codebuild_fleet.html.markdown @@ -95,6 +95,7 @@ This data source exports the following attributes in addition to the arguments a * `baseCapacity` - Number of machines allocated to the fleet. * `computeConfiguration` - Compute configuration of the compute fleet. * `disk` - Amount of disk space of the instance type included in the fleet. + * `instanceType` - EC2 instance type in the fleet. * `machineType` - Machine type of the instance type included in the fleet. * `memory` - Amount of memory of the instance type included in the fleet. * `vcpu` - Number of vCPUs of the instance type included in the fleet. @@ -123,4 +124,4 @@ This data source exports the following attributes in addition to the arguments a * `subnets` - A list of one or more subnet IDs in your Amazon VPC. * `vpcId` - The ID of the Amazon VPC. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ebs_volume.html.markdown b/website/docs/cdktf/typescript/d/ebs_volume.html.markdown index 13d0aec51359..1af981dd7185 100644 --- a/website/docs/cdktf/typescript/d/ebs_volume.html.markdown +++ b/website/docs/cdktf/typescript/d/ebs_volume.html.markdown @@ -75,6 +75,7 @@ This data source exports the following attributes in addition to the arguments a * `throughput` - Throughput that the volume supports, in MiB/s. * `volumeId` - Volume ID (e.g., vol-59fcb34e). * `volumeType` - Type of EBS volume. +* `volumeInitializationRate` - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. ## Timeouts @@ -84,4 +85,4 @@ This data source exports the following attributes in addition to the arguments a [1]: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-volumes.html - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ecs_service.html.markdown b/website/docs/cdktf/typescript/d/ecs_service.html.markdown index 0afc45b48ef1..9634f745331f 100644 --- a/website/docs/cdktf/typescript/d/ecs_service.html.markdown +++ b/website/docs/cdktf/typescript/d/ecs_service.html.markdown @@ -51,8 +51,28 @@ This data source exports the following attributes in addition to the arguments a * `arn` - ARN of the ECS Service * `desiredCount` - Number of tasks for the ECS Service * `launchType` - Launch type for the ECS Service +* `loadBalancer` - Load balancers for the ECS Service. See [`loadBalancer` Block](#load_balancer-block) for details. * `schedulingStrategy` - Scheduling strategy for the ECS Service * `taskDefinition` - Family for the latest ACTIVE revision or full ARN of the task definition. * `tags` - Resource tags. - \ No newline at end of file +### `loadBalancer` Block + +The `loadBalancer` block exports the following attributes: + +* `advancedConfiguration` - Settings for Blue/Green deployment. See [`advancedConfiguration` Block](#advanced_configuration-block) for details. +* `containerName` - Name of the container to associate with the load balancer. +* `containerPort` - Port on the container to associate with the load balancer. +* `elbName` - Name of the load balancer. +* `targetGroupArn` - ARN of the target group to associate with the load balancer. + +### `advancedConfiguration` Block + +The `advancedConfiguration` block exports the following attributes: + +* `alternateTargetGroupArn` - ARN of the alternate target group to use for Blue/Green deployments. +* `productionListenerRule` - ARN of the listener rule that routes production traffic. +* `roleArn` - ARN of the IAM role that allows ECS to manage the target groups. +* `testListenerRule` - ARN of the listener rule that routes test traffic. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_cluster_versions.html.markdown b/website/docs/cdktf/typescript/d/eks_cluster_versions.html.markdown index d9d371bc03f0..c6e8f043daa4 100644 --- a/website/docs/cdktf/typescript/d/eks_cluster_versions.html.markdown +++ b/website/docs/cdktf/typescript/d/eks_cluster_versions.html.markdown @@ -19,7 +19,7 @@ Terraform data source for managing AWS EKS (Elastic Kubernetes) Cluster Versions ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; +import { TerraformOutput, TerraformStack } from "cdktf"; /* * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. @@ -28,7 +28,22 @@ import { DataAwsEksClusterVersions } from "./.gen/providers/aws/data-aws-eks-clu class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); - new DataAwsEksClusterVersions(this, "example", {}); + const example = new DataAwsEksClusterVersions(this, "example", {}); + new TerraformOutput(this, "eks_cluster_version_filtered", { + value: + "${[ for version in ${" + + example.clusterVersions + + '} : version if version.cluster_version == "1.33"]}', + }); + new TerraformOutput(this, "eks_cluster_version_list", { + value: + "${[ for version in ${" + + example.clusterVersions + + "} : version.cluster_version]}", + }); + new TerraformOutput(this, "eks_cluster_versions", { + value: example.clusterVersions, + }); } } @@ -85,7 +100,6 @@ The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `clusterType` - (Optional) Type of clusters to filter by. Currently, the only valid value is `eks`. -* `clusterVersions` - (Optional) A list of Kubernetes versions that you can use to check if EKS supports it. * `defaultOnly` - (Optional) Whether to show only the default versions of Kubernetes supported by EKS. * `includeAll` - (Optional) Whether to include all kubernetes versions in the response. * `versionStatus` - (Optional) Status of the EKS cluster versions to list. @@ -95,14 +109,15 @@ Valid values are `STANDARD_SUPPORT` or `UNSUPPORTED` or `EXTENDED_SUPPORT`. This data source exports the following attributes in addition to the arguments above: -* `clusterType` - Type of cluster that the version belongs to. -* `clusterVersion` - Kubernetes version supported by EKS. -* `default_platform_version` - Default eks platform version for the cluster version. -* `defaultVersion` - Default Kubernetes version for the cluster version. -* `end_of_extended_support_date` - End of extended support date for the cluster version. -* `end_of_standard_support_date` - End of standard support date for the cluster version. -* `kubernetes_patch_version` - Kubernetes patch version for the cluster version. -* `releaseDate` - Release date of the cluster version. -* `versionStatus` - Status of the EKS cluster version. - - \ No newline at end of file +* `clusterVersions` - A list of Kubernetes version information. + * `clusterType` - Type of cluster that the version belongs to. + * `clusterVersion` - Kubernetes version supported by EKS. + * `default_platform_version` - Default eks platform version for the cluster version. + * `defaultVersion` - Default Kubernetes version for the cluster version. + * `end_of_extended_support_date` - End of extended support date for the cluster version. + * `end_of_standard_support_date` - End of standard support date for the cluster version. + * `kubernetes_patch_version` - Kubernetes patch version for the cluster version. + * `releaseDate` - Release date of the cluster version. + * `versionStatus` - Status of the EKS cluster version. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/quicksight_analysis.html.markdown b/website/docs/cdktf/typescript/d/quicksight_analysis.html.markdown index 379e3353e902..9ad535a35a9b 100644 --- a/website/docs/cdktf/typescript/d/quicksight_analysis.html.markdown +++ b/website/docs/cdktf/typescript/d/quicksight_analysis.html.markdown @@ -40,9 +40,9 @@ class MyConvertedCode extends TerraformStack { This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `analysisId` - (Required) Identifier for the analysis. -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -51,4 +51,4 @@ This data source exports the following attributes in addition to the arguments a See the [Analysis Resource](/docs/providers/aws/r/quicksight_analysis.html) for details on the returned attributes - they are identical. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/quicksight_data_set.html.markdown b/website/docs/cdktf/typescript/d/quicksight_data_set.html.markdown index 87bae5a813c1..9d747dfff658 100644 --- a/website/docs/cdktf/typescript/d/quicksight_data_set.html.markdown +++ b/website/docs/cdktf/typescript/d/quicksight_data_set.html.markdown @@ -40,9 +40,9 @@ class MyConvertedCode extends TerraformStack { This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `awsAccountId` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `dataSetId` - (Required) Identifier for the data set. -* `awsAccountId` - (Optional) AWS account ID. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -51,4 +51,4 @@ This data source exports the following attributes in addition to the arguments a See the [Data Set Resource](/docs/providers/aws/r/quicksight_data_set.html) for details on the returned attributes - they are identical. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/quicksight_group.html.markdown b/website/docs/cdktf/typescript/d/quicksight_group.html.markdown index d4eb9e1b44ab..0b1ec60aa7d6 100644 --- a/website/docs/cdktf/typescript/d/quicksight_group.html.markdown +++ b/website/docs/cdktf/typescript/d/quicksight_group.html.markdown @@ -46,9 +46,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -58,4 +58,4 @@ This data source exports the following attributes in addition to the arguments a * `description` - The group description. * `principalId` - The principal ID of the group. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/quicksight_theme.html.markdown b/website/docs/cdktf/typescript/d/quicksight_theme.html.markdown index 1d725338b2d3..ddb1d4f36688 100644 --- a/website/docs/cdktf/typescript/d/quicksight_theme.html.markdown +++ b/website/docs/cdktf/typescript/d/quicksight_theme.html.markdown @@ -44,8 +44,8 @@ The following arguments are required: The following arguments are optional: +* `awsAccountId` - AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - AWS account ID. ## Attribute Reference @@ -135,4 +135,4 @@ This data source exports the following attributes in addition to the arguments a * `warning` - Color (hexadecimal) that applies to warning and informational messages. * `warningForeground` - Color (hexadecimal) that applies to any text or other elements that appear over the warning color. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/quicksight_user.html.markdown b/website/docs/cdktf/typescript/d/quicksight_user.html.markdown index 8a697d6e5590..e1339f352f15 100644 --- a/website/docs/cdktf/typescript/d/quicksight_user.html.markdown +++ b/website/docs/cdktf/typescript/d/quicksight_user.html.markdown @@ -46,9 +46,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -56,6 +56,7 @@ This data source exports the following attributes in addition to the arguments a * `active` - The active status of user. When you create an Amazon QuickSight user that’s not an IAM user or an Active Directory user, that user is inactive until they sign in and provide a password. * `arn` - The Amazon Resource Name (ARN) for the user. +* `customPermissionsName` - The custom permissions profile associated with this user. * `email` - The user's email address. * `identityType` - The type of identity authentication used by the user. * `principalId` - The principal ID of the user. @@ -64,4 +65,4 @@ This data source exports the following attributes in addition to the arguments a - `AUTHOR`: A user who can create data sources, datasets, analyzes, and dashboards. - `ADMIN`: A user who is an author, who can also manage Amazon QuickSight settings. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/s3_access_point.html.markdown b/website/docs/cdktf/typescript/d/s3_access_point.html.markdown index 9750202bbd02..73e4220023f1 100644 --- a/website/docs/cdktf/typescript/d/s3_access_point.html.markdown +++ b/website/docs/cdktf/typescript/d/s3_access_point.html.markdown @@ -59,7 +59,8 @@ This data source exports the following attributes in addition to the arguments a * `blockPublicPolicy` - Whether Amazon S3 blocks public bucket policies for buckets in this account. * `ignorePublicAcls` - Whether Amazon S3 ignores public ACLs for buckets in this account. * `restrictPublicBuckets` - Whether Amazon S3 restricts public bucket policies for buckets in this account. +* `tags` - Tags assigned to the access point. * `vpcConfiguration` - VPC configuration for the access point. * `vpcId` - Access point will only allow connections from this VPC. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssm_patch_baseline.html.markdown b/website/docs/cdktf/typescript/d/ssm_patch_baseline.html.markdown index 9d9cb62c05b9..3e8fb7c70127 100644 --- a/website/docs/cdktf/typescript/d/ssm_patch_baseline.html.markdown +++ b/website/docs/cdktf/typescript/d/ssm_patch_baseline.html.markdown @@ -91,6 +91,7 @@ This data source exports the following attributes in addition to the arguments a * `patchFilter` - Patch filter group that defines the criteria for the rule. * `key` - Key for the filter. * `values` - Value for the filter. +* `availableSecurityUpdatesComplianceStatus` - Indicates the compliance status of managed nodes for which security-related patches are available but were not approved. Supported for Windows Server managed nodes only. * `globalFilter` - Set of global filters used to exclude patches from the baseline. * `key` - Key for the filter. * `values` - Value for the filter. @@ -105,4 +106,4 @@ This data source exports the following attributes in addition to the arguments a * `name` - Name specified to identify the patch source. * `products` - Specific operating system versions a patch repository applies to. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/verifiedpermissions_policy_store.html.markdown b/website/docs/cdktf/typescript/d/verifiedpermissions_policy_store.html.markdown index 3615a7fd1e77..e4af2bb74c23 100644 --- a/website/docs/cdktf/typescript/d/verifiedpermissions_policy_store.html.markdown +++ b/website/docs/cdktf/typescript/d/verifiedpermissions_policy_store.html.markdown @@ -49,8 +49,9 @@ This data source exports the following attributes in addition to the arguments a * `arn` - The ARN of the Policy Store. * `createdDate` - The date the Policy Store was created. +* `deletionProtection` - Whether the policy store can be deleted. * `lastUpdatedDate` - The date the Policy Store was last updated. * `tags` - Map of key-value pairs associated with the policy store. * `validationSettings` - Validation settings for the policy store. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/wafv2_web_acl.html.markdown b/website/docs/cdktf/typescript/d/wafv2_web_acl.html.markdown index 5be94cd42446..703146782b4d 100644 --- a/website/docs/cdktf/typescript/d/wafv2_web_acl.html.markdown +++ b/website/docs/cdktf/typescript/d/wafv2_web_acl.html.markdown @@ -14,6 +14,8 @@ Retrieves the summary of a WAFv2 Web ACL. ## Example Usage +### Lookup by name + ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; @@ -35,12 +37,41 @@ class MyConvertedCode extends TerraformStack { ``` +### Lookup by associated resource + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsWafv2WebAcl } from "./.gen/providers/aws/data-aws-wafv2-web-acl"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsWafv2WebAcl(this, "alb_example", { + resourceArn: + "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx", + scope: "REGIONAL", + }); + new DataAwsWafv2WebAcl(this, "cloudfront_example", { + resourceArn: "arn:aws:cloudfront::123456789012:distribution/XXX", + scope: "CLOUDFRONT", + }); + } +} + +``` + ## Argument Reference This data source supports the following arguments: +* `name` - (Optional) Name of the WAFv2 Web ACL. Exactly one of `name` or `resourceArn` must be specified. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `name` - (Required) Name of the WAFv2 Web ACL. +* `resourceArn` - (Optional) ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of `name` or `resourceArn` must be specified. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. ## Attribute Reference @@ -51,4 +82,4 @@ This data source exports the following attributes in addition to the arguments a * `description` - Description of the WebACL that helps with identification. * `id` - Unique identifier of the WebACL. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/guides/custom-service-endpoints.html.markdown b/website/docs/cdktf/typescript/guides/custom-service-endpoints.html.markdown index 588b4f41e8f0..b479b433300d 100644 --- a/website/docs/cdktf/typescript/guides/custom-service-endpoints.html.markdown +++ b/website/docs/cdktf/typescript/guides/custom-service-endpoints.html.markdown @@ -143,6 +143,7 @@ class MyConvertedCode extends TerraformStack { |BCM Data Exports|`bcmdataexports`|`AWS_ENDPOINT_URL_BCM_DATA_EXPORTS`|`bcm_data_exports`| |Bedrock|`bedrock`|`AWS_ENDPOINT_URL_BEDROCK`|`bedrock`| |Bedrock Agents|`bedrockagent`|`AWS_ENDPOINT_URL_BEDROCK_AGENT`|`bedrock_agent`| +|Bedrock AgentCore|`bedrockagentcore`|`AWS_ENDPOINT_URL_BEDROCK_AGENTCORE_CONTROL`|`bedrock_agentcore_control`| |Billing|`billing`|`AWS_ENDPOINT_URL_BILLING`|`billing`| |Web Services Budgets|`budgets`|`AWS_ENDPOINT_URL_BUDGETS`|`budgets`| |CE (Cost Explorer)|`ce`(or `costexplorer`)|`AWS_ENDPOINT_URL_COST_EXPLORER`|`cost_explorer`| @@ -282,6 +283,7 @@ class MyConvertedCode extends TerraformStack { |User Notifications|`notifications`|`AWS_ENDPOINT_URL_NOTIFICATIONS`|`notifications`| |User Notifications Contacts|`notificationscontacts`|`AWS_ENDPOINT_URL_NOTIFICATIONSCONTACTS`|`notificationscontacts`| |CloudWatch Observability Access Manager|`oam`(or `cloudwatchobservabilityaccessmanager`)|`AWS_ENDPOINT_URL_OAM`|`oam`| +|Oracle Database@AWS|`odb`|`AWS_ENDPOINT_URL_ODB`|`odb`| |OpenSearch|`opensearch`(or `opensearchservice`)|`AWS_ENDPOINT_URL_OPENSEARCH`|`opensearch`| |OpenSearch Serverless|`opensearchserverless`|`AWS_ENDPOINT_URL_OPENSEARCHSERVERLESS`|`opensearchserverless`| |Organizations|`organizations`|`AWS_ENDPOINT_URL_ORGANIZATIONS`|`organizations`| @@ -321,6 +323,7 @@ class MyConvertedCode extends TerraformStack { |S3 Control|`s3Control`|`AWS_ENDPOINT_URL_S3_CONTROL`|`s3_control`| |S3 on Outposts|`s3Outposts`|`AWS_ENDPOINT_URL_S3OUTPOSTS`|`s3Outposts`| |S3 Tables|`s3Tables`|`AWS_ENDPOINT_URL_S3TABLES`|`s3Tables`| +|S3 Vectors|`s3Vectors`|`AWS_ENDPOINT_URL_S3VECTORS`|`s3Vectors`| |SageMaker AI|`sagemaker`|`AWS_ENDPOINT_URL_SAGEMAKER`|`sagemaker`| |EventBridge Scheduler|`scheduler`|`AWS_ENDPOINT_URL_SCHEDULER`|`scheduler`| |EventBridge Schemas|`schemas`|`AWS_ENDPOINT_URL_SCHEMAS`|`schemas`| @@ -472,4 +475,4 @@ class MyConvertedCode extends TerraformStack { ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 4e115c717ea9..14a08ac429cc 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -13,7 +13,7 @@ Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. You must configure the provider with the proper credentials before you can use it. -Use the navigation to the left to read about the available resources. There are currently 1509 resources and 608 data sources available in the provider. +Use the navigation to the left to read about the available resources. There are currently 1516 resources and 609 data sources available in the provider. To learn the basics of Terraform using this provider, follow the hands-on [get started tutorials](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code?in=terraform/aws-get-started&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). Interact with AWS services, @@ -953,4 +953,4 @@ Approaches differ per authentication providers: There used to be no better way to get account ID out of the API when using the federated account until `sts:GetCallerIdentity` was introduced. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/appsync_source_api_association.html.markdown b/website/docs/cdktf/typescript/r/appsync_source_api_association.html.markdown index 8c6cbaed73e4..7f93065888c8 100644 --- a/website/docs/cdktf/typescript/r/appsync_source_api_association.html.markdown +++ b/website/docs/cdktf/typescript/r/appsync_source_api_association.html.markdown @@ -3,13 +3,13 @@ subcategory: "AppSync" layout: "aws" page_title: "AWS: aws_appsync_source_api_association" description: |- - Terraform resource for managing an AWS AppSync Source Api Association. + Terraform resource for managing an AWS AppSync Source API Association. --- # Resource: aws_appsync_source_api_association -Terraform resource for managing an AWS AppSync Source Api Association. +Terraform resource for managing an AWS AppSync Source API Association. ## Example Usage @@ -58,9 +58,9 @@ The `sourceApiAssociationConfig` configuration block supports the following argu This resource exports the following attributes in addition to the arguments above: -* `arn` - ARN of the Source Api Association. -* `associationId` - ID of the Source Api Association. -* `id` - Combined ID of the Source Api Association and Merge Api. +* `arn` - ARN of the Source API Association. +* `associationId` - ID of the Source API Association. +* `id` - Combined ID of the Source API Association and Merge API. ## Timeouts @@ -72,7 +72,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source Api Association using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source API Association using the `associationId` and `mergedApiId` separated by `,`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -96,10 +96,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import AppSync Source Api Association using the `gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31`. For example: +Using `terraform import`, import AppSync Source API Association using the `associationId` and `mergedApiId` separated by `,`. For example: ```console % terraform import aws_appsync_source_api_association.example gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/athena_database.html.markdown b/website/docs/cdktf/typescript/r/athena_database.html.markdown index 188845f2875c..f6fca9701af7 100644 --- a/website/docs/cdktf/typescript/r/athena_database.html.markdown +++ b/website/docs/cdktf/typescript/r/athena_database.html.markdown @@ -54,6 +54,7 @@ This resource supports the following arguments: * `expectedBucketOwner` - (Optional) AWS account ID that you expect to be the owner of the Amazon S3 bucket. * `forceDestroy` - (Optional, Default: false) Boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are *not* recoverable. * `properties` - (Optional) Key-value map of custom metadata properties for the database definition. +* `workgroup` - (Optional) Name of the workgroup. ### ACL Configuration @@ -126,4 +127,4 @@ class MyConvertedCode extends TerraformStack { ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/athena_workgroup.html.markdown b/website/docs/cdktf/typescript/r/athena_workgroup.html.markdown index c91f0edce939..ff18399bab0e 100644 --- a/website/docs/cdktf/typescript/r/athena_workgroup.html.markdown +++ b/website/docs/cdktf/typescript/r/athena_workgroup.html.markdown @@ -62,19 +62,25 @@ This resource supports the following arguments: * `bytesScannedCutoffPerQuery` - (Optional) Integer for the upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. Must be at least `10485760`. * `enforceWorkgroupConfiguration` - (Optional) Boolean whether the settings for the workgroup override client-side settings. For more information, see [Workgroup Settings Override Client-Side Settings](https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). Defaults to `true`. * `engineVersion` - (Optional) Configuration block for the Athena Engine Versioning. For more information, see [Athena Engine Versioning](https://docs.aws.amazon.com/athena/latest/ug/engine-versions.html). See [Engine Version](#engine-version) below. -* `executionRole` - (Optional) Role used in a notebook session for accessing the user's resources. +* `executionRole` - (Optional) Role used to access user resources in notebook sessions and IAM Identity Center enabled workgroups. The property is required for IAM Identity Center enabled workgroups. +* `identityCenterConfiguration` - (Optional) Configuration block to set up an IAM Identity Center enabled workgroup. See [Identity Center Configuration](#identity-center-configuration) below. * `publishCloudwatchMetricsEnabled` - (Optional) Boolean whether Amazon CloudWatch metrics are enabled for the workgroup. Defaults to `true`. -* `resultConfiguration` - (Optional) Configuration block with result settings. See [Result Configuration](#result-configuration) below. * `requesterPaysEnabled` - (Optional) If set to true , allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false , workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false . For more information about Requester Pays buckets, see [Requester Pays Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) in the Amazon Simple Storage Service Developer Guide. +* `resultConfiguration` - (Optional) Configuration block with result settings. See [Result Configuration](#result-configuration) below. #### Engine Version * `selectedEngineVersion` - (Optional) Requested engine version. Defaults to `AUTO`. +#### Identity Center Configuration + +* `enableIdentityCenter` - (Optional) Specifies whether the workgroup is IAM Identity Center supported. +* `identityCenterInstanceArn` - (Optional) The IAM Identity Center instance ARN that the workgroup associates to. + #### Result Configuration -* `encryptionConfiguration` - (Optional) Configuration block with encryption settings. See [Encryption Configuration](#encryption-configuration) below. * `aclConfiguration` - (Optional) That an Amazon S3 canned ACL should be set to control ownership of stored query results. See [ACL Configuration](#acl-configuration) below. +* `encryptionConfiguration` - (Optional) Configuration block with encryption settings. See [Encryption Configuration](#encryption-configuration) below. * `expectedBucketOwner` - (Optional) AWS account ID that you expect to be the owner of the Amazon S3 bucket. * `outputLocation` - (Optional) Location in Amazon S3 where your query results are stored, such as `s3://path/to/query/bucket/`. For more information, see [Queries and Query Result Files](https://docs.aws.amazon.com/athena/latest/ug/querying.html). @@ -126,4 +132,4 @@ Using `terraform import`, import Athena Workgroups using their name. For example % terraform import aws_athena_workgroup.example example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/bedrock_guardrail.html.markdown b/website/docs/cdktf/typescript/r/bedrock_guardrail.html.markdown index a3d297a01b7f..38b17396d62d 100644 --- a/website/docs/cdktf/typescript/r/bedrock_guardrail.html.markdown +++ b/website/docs/cdktf/typescript/r/bedrock_guardrail.html.markdown @@ -36,15 +36,23 @@ resource "aws_bedrock_guardrail" "example" { sensitive_information_policy_config { pii_entities_config { - action = "BLOCK" - type = "NAME" + action = "BLOCK" + input_action = "BLOCK" + output_action = "ANONYMIZE" + input_enabled = true + output_enabled = true + type = "NAME" } regexes_config { - action = "BLOCK" - description = "example regex" - name = "regex_example" - pattern = "^\\d{3}-\\d{2}-\\d{4}$" + action = "BLOCK" + input_action = "BLOCK" + output_action = "BLOCK" + input_enabled = true + output_enabled = false + description = "example regex" + name = "regex_example" + pattern = "^\\d{3}-\\d{2}-\\d{4}$" } } @@ -97,7 +105,7 @@ The `contentPolicyConfig` configuration block supports the following arguments: * `filtersConfig` - (Optional) Set of content filter configs in content policy. See [Filters Config](#content-filters-config) for more information. -* `tier_config` - (Optional) Configuration block for the content policy tier. See [Tier Config](#content-tier-config) for more information. +* `tierConfig` - (Optional) Configuration block for the content policy tier. See [Tier Config](#content-tier-config) for more information. #### Content Filters Config @@ -109,7 +117,7 @@ The `filtersConfig` configuration block supports the following arguments: #### Content Tier Config -The `tier_config` configuration block supports the following arguments: +The `tierConfig` configuration block supports the following arguments: * `tier_name` - (Required) The name of the content policy tier. Valid values include STANDARD or CLASSIC. @@ -126,15 +134,15 @@ The `filtersConfig` configuration block supports the following arguments: ### Cross Region Inference -* `cross_region_config` (Optional) Configuration block to enable cross-region routing for bedrock guardrails. See [Cross Region Config](#cross-region-config for more information. Note see [available regions](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html) here. +* `crossRegionConfig` (Optional) Configuration block to enable cross-region routing for bedrock guardrails. See [Cross Region Config](#cross-region-config for more information. Note see [available regions](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html) here. #### Cross Region Config -* `guardrail_profile_identifier` (Required) Guardrail profile ARN. +* `guardrailProfileIdentifier` (Required) Guardrail profile ARN. ### Topic Policy Config -* `tier_config` - (Optional) Configuration block for the topic policy tier. See [Tier Config](#topics-tier-config) for more information. +* `tierConfig` - (Optional) Configuration block for the topic policy tier. See [Tier Config](#topics-tier-config) for more information. * `topicsConfig` (Required) List of topic configs in topic policy. See [Topics Config](#topics-config) for more information. #### Topics Config @@ -146,7 +154,7 @@ The `filtersConfig` configuration block supports the following arguments: #### Topics Tier Config -The `tier_config` configuration block supports the following arguments: +The `tierConfig` configuration block supports the following arguments: * `tier_name` - (Required) The name of the content policy tier. Valid values include STANDARD or CLASSIC. @@ -157,13 +165,21 @@ The `tier_config` configuration block supports the following arguments: #### PII Entities Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `inputAction` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `inputEnabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. +* `outputAction` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `outputEnabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `type` (Required) The currently supported PII entities. #### Regexes Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `inputAction` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `inputEnabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. * `name` (Required) The regex name. +* `outputAction` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `outputEnabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `pattern` (Required) The regex pattern. * `description` (Optional) The regex description. @@ -230,4 +246,4 @@ Using `terraform import`, import Amazon Bedrock Guardrail using using a comma-de % terraform import aws_bedrock_guardrail.example guardrail-id-12345678,DRAFT ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/bedrock_inference_profile.html.markdown b/website/docs/cdktf/typescript/r/bedrock_inference_profile.html.markdown index 9090bdef51fa..6afdc4b4b5dc 100644 --- a/website/docs/cdktf/typescript/r/bedrock_inference_profile.html.markdown +++ b/website/docs/cdktf/typescript/r/bedrock_inference_profile.html.markdown @@ -93,7 +93,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `name`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -117,10 +117,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Bedrock Inference Profile using the `example_id_arg`. For example: +Using `terraform import`, import Bedrock Inference Profile using the `name`. For example: ```console % terraform import aws_bedrock_inference_profile.example inference_profile-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/cleanrooms_collaboration.html.markdown b/website/docs/cdktf/typescript/r/cleanrooms_collaboration.html.markdown index 97ce7dbed6f1..e2e0a5eca833 100644 --- a/website/docs/cdktf/typescript/r/cleanrooms_collaboration.html.markdown +++ b/website/docs/cdktf/typescript/r/cleanrooms_collaboration.html.markdown @@ -10,13 +10,11 @@ description: |- # Resource: aws_cleanrooms_collaboration -Provides a AWS Clean Rooms collaboration. All members included in the definition will be invited to -join the collaboration and can create memberships. +Provides a AWS Clean Rooms collaboration. +All members included in the definition will be invited to join the collaboration and can create memberships. ## Example Usage -### Collaboration with tags - ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; @@ -33,6 +31,7 @@ class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string, config: MyConfig) { super(scope, name); new CleanroomsCollaboration(this, "test_collaboration", { + analyticsEngine: "SPARK", creatorDisplayName: "Creator ", creatorMemberAbilities: ["CAN_QUERY", "CAN_RECEIVE_RESULTS"], dataEncryptionMetadata: { @@ -62,15 +61,18 @@ class MyConvertedCode extends TerraformStack { ## Argument Reference -This resource supports the following arguments: +The following arguments are required: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `name` - (Required) - The name of the collaboration. Collaboration names do not need to be unique. * `description` - (Required) - A description for a collaboration. * `creatorMemberAbilities` - (Required - Forces new resource) - The list of member abilities for the creator of the collaboration. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-creatorMemberAbilities). * `creatorDisplayName` - (Required - Forces new resource) - The name for the member record for the collaboration creator. * `queryLogStatus` - (Required - Forces new resource) - Determines if members of the collaboration can enable query logs within their own. emberships. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-queryLogStatus). + +The following arguments are optional: + +* `analyticsEngine` - (Optional) Analytics engine used by the collaboration. Valid values are `CLEAN_ROOMS_SQL` (deprecated) and `SPARK`. * `dataEncryptionMetadata` - (Required - Forces new resource) - a collection of settings which determine how the [c3r client](https://docs.aws.amazon.com/clean-rooms/latest/userguide/crypto-computing.html) will encrypt data for use within this collaboration. * `data_encryption_metadata.allow_clear_text` - (Required - Forces new resource) - Indicates whether encrypted tables can contain cleartext data. This is a boolea field. @@ -84,17 +86,18 @@ or cryptographically processed (false). * `member.account_id` - (Required - Forces new resource) - The account id for the invited member. * `member.display_name` - (Required - Forces new resource) - The display name for the invited member. * `member.member_abilities` - (Required - Forces new resource) - The list of abilities for the invited member. Valid values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_CreateCollaboration.html#API-CreateCollaboration-request-creatorMemberAbilities). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) - Key value pairs which tag the collaboration. ## Attribute Reference This resource exports the following attributes in addition to the arguments above: -* `arn` - The arn of the collaboration. -* `id` - The id of the collaboration. -* `createTime` - The date and time the collaboration was created. +* `arn` - ARN of the collaboration. +* `id` - ID of the collaboration. +* `createTime` - Date and time the collaboration was created. * `member status` - For each member included in the collaboration an additional computed attribute of status is added. These values [may be found here](https://docs.aws.amazon.com/clean-rooms/latest/apireference/API_MemberSummary.html#API-Type-MemberSummary-status). -* `updatedTime` - The date and time the collaboration was last updated. +* `updatedTime` - Date and time the collaboration was last updated. ## Timeouts @@ -136,4 +139,4 @@ Using `terraform import`, import `aws_cleanrooms_collaboration` using the `id`. % terraform import aws_cleanrooms_collaboration.collaboration 1234abcd-12ab-34cd-56ef-1234567890ab ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/cloudfront_function.html.markdown b/website/docs/cdktf/typescript/r/cloudfront_function.html.markdown index 979e1a52db00..e96ce8a680bb 100644 --- a/website/docs/cdktf/typescript/r/cloudfront_function.html.markdown +++ b/website/docs/cdktf/typescript/r/cloudfront_function.html.markdown @@ -56,7 +56,7 @@ The following arguments are optional: * `comment` - (Optional) Comment. * `publish` - (Optional) Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`. -* `keyValueStoreAssociations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to on key value store per function. +* `keyValueStoreAssociations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to one key value store per function. ## Attribute Reference @@ -99,4 +99,4 @@ Using `terraform import`, import CloudFront Functions using the `name`. For exam % terraform import aws_cloudfront_function.test my_test_function ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/cloudfrontkeyvaluestore_key.html.markdown b/website/docs/cdktf/typescript/r/cloudfrontkeyvaluestore_key.html.markdown index eb30a9dc2bbb..138ba52e9a08 100644 --- a/website/docs/cdktf/typescript/r/cloudfrontkeyvaluestore_key.html.markdown +++ b/website/docs/cdktf/typescript/r/cloudfrontkeyvaluestore_key.html.markdown @@ -68,7 +68,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `keyValueStoreArn` and 'key' separated by `,`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -92,10 +92,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import CloudFront KeyValueStore Key using the `id`. For example: +Using `terraform import`, import CloudFront KeyValueStore Key using the `keyValueStoreArn` and 'key' separated by `,`. For example: ```console % terraform import aws_cloudfrontkeyvaluestore_key.example arn:aws:cloudfront::111111111111:key-value-store/8562g61f-caba-2845-9d99-b97diwae5d3c,someKey ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/cloudwatch_event_bus.html.markdown b/website/docs/cdktf/typescript/r/cloudwatch_event_bus.html.markdown index cefe65741b03..a6bdb5f9b11b 100644 --- a/website/docs/cdktf/typescript/r/cloudwatch_event_bus.html.markdown +++ b/website/docs/cdktf/typescript/r/cloudwatch_event_bus.html.markdown @@ -16,6 +16,8 @@ Provides an EventBridge event bus resource. ## Example Usage +### Basic Usages + ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; @@ -72,6 +74,279 @@ class MyConvertedCode extends TerraformStack { ``` +### Logging to CloudWatch Logs, S3, and Data Firehose + +See [Configuring logs for Amazon EventBridge event buses](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus-logs.html) for more details. + +#### Required Resources + +* EventBridge Event Bus with `logConfig` configured +* Log destinations: + + * CloudWatch Logs log group + * S3 bucket + * Data Firehose delivery stream + +* Resource-based policy or tagging for the service-linked role: + + * CloudWatch Logs log group - `aws_cloudwatch_log_resource_policy` to allow `delivery.logs.amazonaws.com` to put logs into the log group + * S3 bucket - `aws_s3_bucket_policy` to allow `delivery.logs.amazonaws.com` to put logs into the bucket + * Data Firehose delivery stream - tagging the delivery stream with `LogDeliveryEnabled = "true"` to allow the service-linked role `AWSServiceRoleForLogDelivery` to deliver logs + +* CloudWatch Logs Delivery: + + * `aws_cloudwatch_log_delivery_source` for each log type (INFO, ERROR, TRACE) + * `aws_cloudwatch_log_delivery_destination` for the log destination (S3 bucket, CloudWatch Logs log group, or Data Firehose delivery stream) + * `aws_cloudwatch_log_delivery` to link each log type’s delivery source to the delivery destination + +#### Example Usage + +The following example demonstrates how to set up logging for an EventBridge event bus to all three destinations: CloudWatch Logs, S3, and Data Firehose. + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { CloudwatchEventBus } from "./.gen/providers/aws/cloudwatch-event-bus"; +import { CloudwatchLogDelivery } from "./.gen/providers/aws/cloudwatch-log-delivery"; +import { CloudwatchLogDeliveryDestination } from "./.gen/providers/aws/cloudwatch-log-delivery-destination"; +import { CloudwatchLogDeliverySource } from "./.gen/providers/aws/cloudwatch-log-delivery-source"; +import { CloudwatchLogGroup } from "./.gen/providers/aws/cloudwatch-log-group"; +import { CloudwatchLogResourcePolicy } from "./.gen/providers/aws/cloudwatch-log-resource-policy"; +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { KinesisFirehoseDeliveryStream } from "./.gen/providers/aws/kinesis-firehose-delivery-stream"; +import { S3Bucket } from "./.gen/providers/aws/s3-bucket"; +import { S3BucketPolicy } from "./.gen/providers/aws/s3-bucket-policy"; +interface MyConfig { + destination: any; + name: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + const example = new CloudwatchEventBus(this, "example", { + logConfig: { + includeDetail: "FULL", + level: "TRACE", + }, + name: "example-event-bus", + }); + const errorLogs = new CloudwatchLogDeliverySource(this, "error_logs", { + logType: "ERROR_LOGS", + name: "EventBusSource-${" + example.name + "}-ERROR_LOGS", + resourceArn: example.arn, + }); + const infoLogs = new CloudwatchLogDeliverySource(this, "info_logs", { + logType: "INFO_LOGS", + name: "EventBusSource-${" + example.name + "}-INFO_LOGS", + resourceArn: example.arn, + }); + const traceLogs = new CloudwatchLogDeliverySource(this, "trace_logs", { + logType: "TRACE_LOGS", + name: "EventBusSource-${" + example.name + "}-TRACE_LOGS", + resourceArn: example.arn, + }); + const eventBusLogs = new CloudwatchLogGroup(this, "event_bus_logs", { + name: "/aws/vendedlogs/events/event-bus/${" + example.name + "}", + }); + const cloudfrontLogs = new KinesisFirehoseDeliveryStream( + this, + "cloudfront_logs", + { + tags: { + LogDeliveryEnabled: "true", + }, + destination: config.destination, + name: config.name, + } + ); + const awsS3BucketExample = new S3Bucket(this, "example_6", { + bucket: "example-event-bus-logs", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsS3BucketExample.overrideLogicalId("example"); + const current = new DataAwsCallerIdentity(this, "current", {}); + const bucket = new DataAwsIamPolicyDocument(this, "bucket", { + statement: [ + { + actions: ["s3:PutObject"], + condition: [ + { + test: "StringEquals", + values: ["bucket-owner-full-control"], + variable: "s3:x-amz-acl", + }, + { + test: "StringEquals", + values: [Token.asString(current.accountId)], + variable: "aws:SourceAccount", + }, + { + test: "ArnLike", + values: [infoLogs.arn, errorLogs.arn, traceLogs.arn], + variable: "aws:SourceArn", + }, + ], + effect: "Allow", + principals: [ + { + identifiers: ["delivery.logs.amazonaws.com"], + type: "Service", + }, + ], + resources: [ + "${" + + awsS3BucketExample.arn + + "}/AWSLogs/${" + + current.accountId + + "}/EventBusLogs/*", + ], + }, + ], + }); + const cwlogs = new DataAwsIamPolicyDocument(this, "cwlogs", { + statement: [ + { + actions: ["logs:CreateLogStream", "logs:PutLogEvents"], + condition: [ + { + test: "StringEquals", + values: [Token.asString(current.accountId)], + variable: "aws:SourceAccount", + }, + { + test: "ArnLike", + values: [infoLogs.arn, errorLogs.arn, traceLogs.arn], + variable: "aws:SourceArn", + }, + ], + effect: "Allow", + principals: [ + { + identifiers: ["delivery.logs.amazonaws.com"], + type: "Service", + }, + ], + resources: ["${" + eventBusLogs.arn + "}:log-stream:*"], + }, + ], + }); + const awsCloudwatchLogDeliveryDestinationCwlogs = + new CloudwatchLogDeliveryDestination(this, "cwlogs_10", { + deliveryDestinationConfiguration: [ + { + destinationResourceArn: eventBusLogs.arn, + }, + ], + name: "EventsDeliveryDestination-${" + example.name + "}-CWLogs", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsCloudwatchLogDeliveryDestinationCwlogs.overrideLogicalId("cwlogs"); + const firehose = new CloudwatchLogDeliveryDestination(this, "firehose", { + deliveryDestinationConfiguration: [ + { + destinationResourceArn: cloudfrontLogs.arn, + }, + ], + name: "EventsDeliveryDestination-${" + example.name + "}-Firehose", + }); + const s3 = new CloudwatchLogDeliveryDestination(this, "s3", { + deliveryDestinationConfiguration: [ + { + destinationResourceArn: Token.asString(awsS3BucketExample.arn), + }, + ], + name: "EventsDeliveryDestination-${" + example.name + "}-S3", + }); + const awsCloudwatchLogResourcePolicyExample = + new CloudwatchLogResourcePolicy(this, "example_13", { + policyDocument: Token.asString(cwlogs.json), + policyName: "AWSLogDeliveryWrite-${" + example.name + "}", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsCloudwatchLogResourcePolicyExample.overrideLogicalId("example"); + const awsS3BucketPolicyExample = new S3BucketPolicy(this, "example_14", { + bucket: Token.asString(awsS3BucketExample.bucket), + policy: Token.asString(bucket.json), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsS3BucketPolicyExample.overrideLogicalId("example"); + const s3InfoLogs = new CloudwatchLogDelivery(this, "s3_info_logs", { + deliveryDestinationArn: s3.arn, + deliverySourceName: infoLogs.name, + }); + const cwlogsInfoLogs = new CloudwatchLogDelivery(this, "cwlogs_info_logs", { + deliveryDestinationArn: Token.asString( + awsCloudwatchLogDeliveryDestinationCwlogs.arn + ), + deliverySourceName: infoLogs.name, + dependsOn: [s3InfoLogs], + }); + const firehoseInfoLogs = new CloudwatchLogDelivery( + this, + "firehose_info_logs", + { + deliveryDestinationArn: firehose.arn, + deliverySourceName: infoLogs.name, + dependsOn: [cwlogsInfoLogs], + } + ); + const s3ErrorLogs = new CloudwatchLogDelivery(this, "s3_error_logs", { + deliveryDestinationArn: s3.arn, + deliverySourceName: errorLogs.name, + dependsOn: [s3InfoLogs], + }); + const s3TraceLogs = new CloudwatchLogDelivery(this, "s3_trace_logs", { + deliveryDestinationArn: s3.arn, + deliverySourceName: traceLogs.name, + dependsOn: [s3ErrorLogs], + }); + const cwlogsErrorLogs = new CloudwatchLogDelivery( + this, + "cwlogs_error_logs", + { + deliveryDestinationArn: Token.asString( + awsCloudwatchLogDeliveryDestinationCwlogs.arn + ), + deliverySourceName: errorLogs.name, + dependsOn: [s3ErrorLogs, cwlogsInfoLogs], + } + ); + const cwlogsTraceLogs = new CloudwatchLogDelivery( + this, + "cwlogs_trace_logs", + { + deliveryDestinationArn: Token.asString( + awsCloudwatchLogDeliveryDestinationCwlogs.arn + ), + deliverySourceName: traceLogs.name, + dependsOn: [s3TraceLogs, cwlogsErrorLogs], + } + ); + const firehoseErrorLogs = new CloudwatchLogDelivery( + this, + "firehose_error_logs", + { + deliveryDestinationArn: firehose.arn, + deliverySourceName: errorLogs.name, + dependsOn: [cwlogsErrorLogs, firehoseInfoLogs], + } + ); + new CloudwatchLogDelivery(this, "firehose_trace_logs", { + deliveryDestinationArn: firehose.arn, + deliverySourceName: traceLogs.name, + dependsOn: [cwlogsTraceLogs, firehoseErrorLogs], + }); + } +} + +``` + ## Argument Reference This resource supports the following arguments: @@ -89,6 +364,9 @@ The following arguments are optional: * `description` - (Optional) Event bus description. * `eventSourceName` - (Optional) Partner event source that the new event bus will be matched with. Must match `name`. * `kmsKeyIdentifier` - (Optional) Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN. +* `logConfig` - (Optional) Block for logging configuration settings for the event bus. + * `includeDetail` - (Optional) Whether EventBridge include detailed event information in the records it generates. Valid values are `NONE` and `FULL`. + * `level` - (Optional) Level of logging detail to include. Valid values are `OFF`, `ERROR`, `INFO`, and `TRACE`. * `tags` - (Optional) Map of tags assigned to the resource. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -131,4 +409,4 @@ Using `terraform import`, import EventBridge event buses using the name of the e % terraform import aws_cloudwatch_event_bus.messenger chat-messages ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/cloudwatch_log_anomaly_detector.html.markdown b/website/docs/cdktf/typescript/r/cloudwatch_log_anomaly_detector.html.markdown index 8c018be45802..89f3466589b9 100644 --- a/website/docs/cdktf/typescript/r/cloudwatch_log_anomaly_detector.html.markdown +++ b/website/docs/cdktf/typescript/r/cloudwatch_log_anomaly_detector.html.markdown @@ -105,10 +105,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import CloudWatch Log Anomaly Detector using the `example_id_arg`. For example: +Using `terraform import`, import CloudWatch Log Anomaly Detector using the `arn`. For example: ```console % terraform import aws_cloudwatch_log_anomaly_detector.example log_anomaly_detector-arn-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/codebuild_fleet.html.markdown b/website/docs/cdktf/typescript/r/codebuild_fleet.html.markdown index 0dcac1f7e0a1..ac12e9a69968 100644 --- a/website/docs/cdktf/typescript/r/codebuild_fleet.html.markdown +++ b/website/docs/cdktf/typescript/r/codebuild_fleet.html.markdown @@ -90,7 +90,7 @@ The following arguments are required: The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `computeConfiguration` - (Optional) The compute configuration of the compute fleet. This is only required if `computeType` is set to `ATTRIBUTE_BASED_COMPUTE`. See [`computeConfiguration`](#compute_configuration) below. +* `computeConfiguration` - (Optional) The compute configuration of the compute fleet. This is only required if `computeType` is set to `ATTRIBUTE_BASED_COMPUTE` or `CUSTOM_INSTANCE_TYPE`. See [`computeConfiguration`](#compute_configuration) below. * `fleetServiceRole` - (Optional) The service role associated with the compute fleet. * `imageId` - (Optional) The Amazon Machine Image (AMI) of the compute fleet. * `overflowBehavior` - (Optional) Overflow behavior for compute fleet. Valid values: `ON_DEMAND`, `QUEUE`. @@ -101,9 +101,10 @@ The following arguments are optional: ### compute_configuration * `disk` - (Optional) Amount of disk space of the instance type included in the fleet. -* `machineType` - (Optional) Machine type of the instance type included in the fleet. Valid values: `GENERAL`, `NVME`. -* `memory` - (Optional) Amount of memory of the instance type included in the fleet. -* `vcpu` - (Optional) Number of vCPUs of the instance type included in the fleet. +* `instanceType` - (Optional) EC2 instance type to be launched in the fleet. Specify only if `computeType` is set to `CUSTOM_INSTANCE_TYPE`. See [Supported instance families](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.instance-types). +* `machineType` - (Optional) Machine type of the instance type included in the fleet. Valid values: `GENERAL`, `NVME`. Specify only if `computeType` is set to `ATTRIBUTE_BASED_COMPUTE`. +* `memory` - (Optional) Amount of memory of the instance type included in the fleet. Specify only if `computeType` is set to `ATTRIBUTE_BASED_COMPUTE`. +* `vcpu` - (Optional) Number of vCPUs of the instance type included in the fleet. Specify only if `computeType` is set to `ATTRIBUTE_BASED_COMPUTE`. ### scaling_configuration @@ -163,4 +164,4 @@ Using `terraform import`, import CodeBuild Fleet using the `name`. For example: % terraform import aws_codebuild_fleet.name fleet-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/computeoptimizer_recommendation_preferences.html.markdown b/website/docs/cdktf/typescript/r/computeoptimizer_recommendation_preferences.html.markdown index 78e92c21272a..51300541a3f7 100644 --- a/website/docs/cdktf/typescript/r/computeoptimizer_recommendation_preferences.html.markdown +++ b/website/docs/cdktf/typescript/r/computeoptimizer_recommendation_preferences.html.markdown @@ -93,7 +93,7 @@ This resource supports the following arguments: * `inferredWorkloadTypes` - (Optional) The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`. * `lookBackPeriod` - (Optional) The preference to control the number of days the utilization metrics of the AWS resource are analyzed. Valid values: `DAYS_14`, `DAYS_32`, `DAYS_93`. * `preferredResource` - (Optional) The preference to control which resource type values are considered when generating rightsizing recommendations. See [Preferred Resources](#preferred-resources) below. -* `resourceType` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`. +* `resourceType` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`, `AuroraDBClusterStorage`. * `savingsEstimationMode` - (Optional) The status of the savings estimation mode preference. Valid values: `AfterDiscounts`, `BeforeDiscounts`. * `scope` - (Required) The scope of the recommendation preferences. See [Scope](#scope) below. * `utilizationPreference` - (Optional) The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. See [Utilization Preferences](#utilization-preferences) below. @@ -159,4 +159,4 @@ Using `terraform import`, import recommendation preferences using the resource t % terraform import aws_computeoptimizer_recommendation_preferences.example Ec2Instance,AccountId,123456789012 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/datazone_glossary.html.markdown b/website/docs/cdktf/typescript/r/datazone_glossary.html.markdown index e5009a966b44..bedf5850cc69 100644 --- a/website/docs/cdktf/typescript/r/datazone_glossary.html.markdown +++ b/website/docs/cdktf/typescript/r/datazone_glossary.html.markdown @@ -149,7 +149,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using a comma-delimited string combining the domain id, glossary id, and the id of the project it's under. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -179,4 +179,4 @@ Using `terraform import`, import DataZone Glossary using the import Datazone Glo % terraform import aws_datazone_glossary.example domain-id,glossary-id,owning-project-identifier ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/dlm_lifecycle_policy.html.markdown b/website/docs/cdktf/typescript/r/dlm_lifecycle_policy.html.markdown index 425139f910d0..6f068c316e12 100644 --- a/website/docs/cdktf/typescript/r/dlm_lifecycle_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/dlm_lifecycle_policy.html.markdown @@ -289,7 +289,7 @@ This resource supports the following arguments: * `action` - (Optional) The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`action` configuration](#action-arguments) block. * `eventSource` - (Optional) The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`eventSource` configuration](#event-source-arguments) block. * `resourceTypes` - (Optional) A list of resource types that should be targeted by the lifecycle policy. Valid values are `VOLUME` and `INSTANCE`. -* `resourceLocations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If you specify `OUTPOST`, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values are `CLOUD` and `OUTPOST`. +* `resourceLocations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If the source resources are located in a Local Zone, specify `LOCAL_ZONE`. Valid values are `CLOUD`, `LOCAL_ZONE`, and `OUTPOST`. * `policyType` - (Optional) The valid target resource types and actions a policy can manage. Specify `EBS_SNAPSHOT_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify `IMAGE_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify `EVENT_BASED_POLICY` to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value is `EBS_SNAPSHOT_MANAGEMENT`. * `parameters` - (Optional) A set of optional parameters for snapshot and AMI lifecycle policies. See the [`parameters` configuration](#parameters-arguments) block. * `schedule` - (Optional) See the [`schedule` configuration](#schedule-arguments) block. @@ -434,4 +434,4 @@ Using `terraform import`, import DLM lifecycle policies using their policy ID. F % terraform import aws_dlm_lifecycle_policy.example policy-abcdef12345678901 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/docdb_cluster.html.markdown b/website/docs/cdktf/typescript/r/docdb_cluster.html.markdown index 82be10fd453e..08c1131f1d47 100644 --- a/website/docs/cdktf/typescript/r/docdb_cluster.html.markdown +++ b/website/docs/cdktf/typescript/r/docdb_cluster.html.markdown @@ -91,6 +91,7 @@ This resource supports the following arguments: Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 * `preferredMaintenanceWindow` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `restoreToPointInTime` - (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. +* `serverlessV2ScalingConfiguration` - (Optional) Scaling configuration of an Amazon DocumentDB Serverless cluster. See [Serverless V2 Scaling Configuration](#serverless-v2-scaling-configuration) below for details. * `skipFinalSnapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`. * `snapshotIdentifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. * `storageEncrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false`. @@ -111,6 +112,14 @@ The `restoreToPointInTime` block supports the following arguments: * `sourceClusterIdentifier` - (Required) The identifier of the source DB cluster from which to restore. Must match the identifier of an existing DB cluster. * `useLatestRestorableTime` - (Optional) A boolean value that indicates whether the DB cluster is restored from the latest backup time. Defaults to `false`. Cannot be specified with `restoreToTime`. +### Serverless V2 Scaling Configuration + +The `serverlessV2ScalingConfiguration` block supports the following arguments. +Adding this block (i.e. switching to serverless) or removing it (i.e. switching from serverless) will trigger cluster replacement. + +* `maxCapacity` - (Required) Maximum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 1 and 256. +* `minCapacity` - (Required) Minimum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 0.5 and 256. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: @@ -165,4 +174,4 @@ Using `terraform import`, import DocumentDB Clusters using the `clusterIdentifie % terraform import aws_docdb_cluster.docdb_cluster docdb-prod-cluster ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/dynamodb_resource_policy.html.markdown b/website/docs/cdktf/typescript/r/dynamodb_resource_policy.html.markdown index ba42a8ced8df..f27949bf952b 100644 --- a/website/docs/cdktf/typescript/r/dynamodb_resource_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/dynamodb_resource_policy.html.markdown @@ -58,7 +58,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `resourceArn`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -82,10 +82,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import DynamoDB Resource Policy using the `example_id_arg`. For example: +Using `terraform import`, import DynamoDB Resource Policy using the `resourceArn`. For example: ```console % terraform import aws_dynamodb_resource_policy.example arn:aws:dynamodb:us-east-1:1234567890:table/my-table ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/dynamodb_table.html.markdown b/website/docs/cdktf/typescript/r/dynamodb_table.html.markdown index 4b2edcfe92b7..cf3df1807859 100644 --- a/website/docs/cdktf/typescript/r/dynamodb_table.html.markdown +++ b/website/docs/cdktf/typescript/r/dynamodb_table.html.markdown @@ -363,6 +363,7 @@ The following arguments are optional: **Note:** This attribute will _not_ be populated with the ARN of _default_ keys. **Note:** Changing this value will recreate the replica. * `pointInTimeRecovery` - (Optional) Whether to enable Point In Time Recovery for the replica. Default is `false`. +* `deletionProtectionEnabled` - (Optional) Whether deletion protection is enabled (true) or disabled (false) on the replica. Default is `false`. * `propagateTags` - (Optional) Whether to propagate the global table's tags to a replica. Default is `false`. Changes to tags only move in one direction: from global (source) to replica. @@ -439,4 +440,4 @@ Using `terraform import`, import DynamoDB tables using the `name`. For example: % terraform import aws_dynamodb_table.basic-dynamodb-table GameScores ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ebs_fast_snapshot_restore.html.markdown b/website/docs/cdktf/typescript/r/ebs_fast_snapshot_restore.html.markdown index 5ec26d13c819..e01fa6b5d6b1 100644 --- a/website/docs/cdktf/typescript/r/ebs_fast_snapshot_restore.html.markdown +++ b/website/docs/cdktf/typescript/r/ebs_fast_snapshot_restore.html.markdown @@ -61,7 +61,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availabilityZone` and `snapshotId` separated by `,`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -85,10 +85,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `id`. For example: +Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availabilityZone` and `snapshotId` separated by `,`. For example: ```console % terraform import aws_ebs_fast_snapshot_restore.example us-west-2a,snap-abcdef123456 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ebs_volume.html.markdown b/website/docs/cdktf/typescript/r/ebs_volume.html.markdown index d341ad470cac..344111e51c60 100644 --- a/website/docs/cdktf/typescript/r/ebs_volume.html.markdown +++ b/website/docs/cdktf/typescript/r/ebs_volume.html.markdown @@ -55,6 +55,7 @@ This resource supports the following arguments: * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `throughput` - (Optional) Throughput that the volume supports, in MiB/s. Only valid for `type` of `gp3`. * `type` - (Optional) Type of EBS volume. Can be `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1` or `st1` (Default: `gp2`). +* `volumeInitializationRate` - (Optional) EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This argument can only be set if `snapshotId` is specified. ~> **NOTE:** At least one of `size` or `snapshotId` is required. @@ -105,4 +106,4 @@ Using `terraform import`, import EBS Volumes using the `id`. For example: % terraform import aws_ebs_volume.id vol-049df61146c4d7901 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ecr_repository.html.markdown b/website/docs/cdktf/typescript/r/ecr_repository.html.markdown index 5ee2ff05e51b..e3d2e147fdca 100644 --- a/website/docs/cdktf/typescript/r/ecr_repository.html.markdown +++ b/website/docs/cdktf/typescript/r/ecr_repository.html.markdown @@ -38,6 +38,39 @@ class MyConvertedCode extends TerraformStack { ``` +### With Image Tag Mutability Exclusion + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EcrRepository } from "./.gen/providers/aws/ecr-repository"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EcrRepository(this, "example", { + imageTagMutability: "IMMUTABLE_WITH_EXCLUSION", + imageTagMutabilityExclusionFilter: [ + { + filter: "latest*", + filterType: "WILDCARD", + }, + { + filter: "dev-*", + filterType: "WILDCARD", + }, + ], + name: "example-repo", + }); + } +} + +``` + ## Argument Reference This resource supports the following arguments: @@ -47,7 +80,8 @@ This resource supports the following arguments: * `encryptionConfiguration` - (Optional) Encryption configuration for the repository. See [below for schema](#encryption_configuration). * `forceDelete` - (Optional) If `true`, will delete the repository even if it contains images. Defaults to `false`. -* `imageTagMutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE`. Defaults to `MUTABLE`. +* `imageTagMutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE`, `IMMUTABLE`, `IMMUTABLE_WITH_EXCLUSION`, or `MUTABLE_WITH_EXCLUSION`. Defaults to `MUTABLE`. +* `imageTagMutabilityExclusionFilter` - (Optional) Configuration block that defines filters to specify which image tags can override the default tag mutability setting. Only applicable when `imageTagMutability` is set to `IMMUTABLE_WITH_EXCLUSION` or `MUTABLE_WITH_EXCLUSION`. See [below for schema](#image_tag_mutability_exclusion_filter). * `imageScanningConfiguration` - (Optional) Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the [ECR User Guide](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) for more information about image scanning. * `scanOnPush` - (Required) Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -57,6 +91,11 @@ This resource supports the following arguments: * `encryptionType` - (Optional) The encryption type to use for the repository. Valid values are `AES256` or `KMS`. Defaults to `AES256`. * `kmsKey` - (Optional) The ARN of the KMS key to use when `encryptionType` is `KMS`. If not specified, uses the default AWS managed key for ECR. +### image_tag_mutability_exclusion_filter + +* `filter` - (Required) The filter pattern to use for excluding image tags from the mutability setting. Must contain only letters, numbers, and special characters (._*-). Each filter can be up to 128 characters long and can contain a maximum of 2 wildcards (*). +* `filterType` - (Required) The type of filter to use. Must be `WILDCARD`. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: @@ -100,4 +139,4 @@ Using `terraform import`, import ECR Repositories using the `name`. For example: % terraform import aws_ecr_repository.service test-service ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/emr_cluster.html.markdown b/website/docs/cdktf/typescript/r/emr_cluster.html.markdown index d3a4a20cc748..8d2f6b575035 100644 --- a/website/docs/cdktf/typescript/r/emr_cluster.html.markdown +++ b/website/docs/cdktf/typescript/r/emr_cluster.html.markdown @@ -691,6 +691,8 @@ class MyConvertedCode extends TerraformStack { * `unhealthyNodeReplacement` - (Optional) Whether whether Amazon EMR should gracefully replace core nodes that have degraded within the cluster. Default value is `false`. * `visibleToAllUsers` - (Optional) Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true`. + **NOTE:** As per the [Amazon EMR API Reference](https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html#EMR-RunJobFlow-request-VisibleToAllUsers), this argument is no longer supported. Do not set this argument, particularly to `false`, as it would lead to perpetual differences. + ### bootstrap_action * `args` - (Optional) List of command line arguments to pass to the bootstrap action script. @@ -857,7 +859,6 @@ This resource exports the following attributes in addition to the arguments abov * `releaseLabel` - Release label for the Amazon EMR release. * `serviceRole` - IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf. * `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). -* `visibleToAllUsers` - Indicates whether the job flow is visible to all IAM users of the AWS account associated with the job flow. ## Import @@ -919,4 +920,4 @@ class MyConvertedCode extends TerraformStack { ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/globalaccelerator_cross_account_attachment.html.markdown b/website/docs/cdktf/typescript/r/globalaccelerator_cross_account_attachment.html.markdown index ebadc0919943..364c05cf0186 100644 --- a/website/docs/cdktf/typescript/r/globalaccelerator_cross_account_attachment.html.markdown +++ b/website/docs/cdktf/typescript/r/globalaccelerator_cross_account_attachment.html.markdown @@ -101,7 +101,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `arn`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -125,10 +125,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +Using `terraform import`, import Global Accelerator Cross Account Attachment using the `arn`. For example: ```console % terraform import aws_globalaccelerator_cross_account_attachment.example arn:aws:globalaccelerator::012345678910:attachment/01234567-abcd-8910-efgh-123456789012 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/imagebuilder_workflow.html.markdown b/website/docs/cdktf/typescript/r/imagebuilder_workflow.html.markdown index fd24d4197ffd..1b988d299b2a 100644 --- a/website/docs/cdktf/typescript/r/imagebuilder_workflow.html.markdown +++ b/website/docs/cdktf/typescript/r/imagebuilder_workflow.html.markdown @@ -68,7 +68,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `arn`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -92,7 +92,7 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import EC2 Image Builder Workflow using the `example_id_arg`. For example: +Using `terraform import`, import EC2 Image Builder Workflow using the `arn`. For example: ```console % terraform import aws_imagebuilder_workflow.example arn:aws:imagebuilder:us-east-1:aws:workflow/test/example/1.0.1/1 @@ -100,4 +100,4 @@ Using `terraform import`, import EC2 Image Builder Workflow using the `example_i Certain resource arguments, such as `uri`, cannot be read via the API and imported into Terraform. Terraform will display a difference for these arguments the first run after import if declared in the Terraform configuration for an imported resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/inspector2_enabler.html.markdown b/website/docs/cdktf/typescript/r/inspector2_enabler.html.markdown index 055fe09097a3..878f5f489e87 100644 --- a/website/docs/cdktf/typescript/r/inspector2_enabler.html.markdown +++ b/website/docs/cdktf/typescript/r/inspector2_enabler.html.markdown @@ -87,4 +87,36 @@ This resource exports no additional attributes. * `update` - (Default `5m`) * `delete` - (Default `5m`) - \ No newline at end of file +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Inspector Enabler using `accountIds` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `accountIds` are sorted in ascending order and `resourceTypes` are sorted in alphabetical order. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Inspector2Enabler } from "./.gen/providers/aws/inspector2-enabler"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + Inspector2Enabler.generateConfigForImport( + this, + "example", + "123456789012:234567890123-EC2:ECR" + ); + } +} + +``` + +Using `terraform import`, import Inspector Enabler using using `accountIds` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `accountIds` are sorted in ascending order and `resourceTypes` are sorted in alphabetical order. For example: + +```console +% terraform import aws_inspector2_enabler.example 123456789012:234567890123-EC2:ECR +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/inspector2_filter.html.markdown b/website/docs/cdktf/typescript/r/inspector2_filter.html.markdown index adb28e4c13fb..423c9c9d7374 100644 --- a/website/docs/cdktf/typescript/r/inspector2_filter.html.markdown +++ b/website/docs/cdktf/typescript/r/inspector2_filter.html.markdown @@ -191,10 +191,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Inspector Filter using the `example_id_arg`. For example: +Using `terraform import`, import Inspector Filter using the `arn`. For example: ```console % terraform import aws_inspector2_filter.example "arn:aws:inspector2:us-east-1:111222333444:owner/111222333444/filter/abcdefgh12345678" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/instance.html.markdown b/website/docs/cdktf/typescript/r/instance.html.markdown index 502d78d836d8..21e786c61e5a 100644 --- a/website/docs/cdktf/typescript/r/instance.html.markdown +++ b/website/docs/cdktf/typescript/r/instance.html.markdown @@ -312,6 +312,7 @@ This resource supports the following arguments: * `enablePrimaryIpv6` - (Optional) Whether to assign a primary IPv6 Global Unicast Address (GUA) to the instance when launched in a dual-stack or IPv6-only subnet. A primary IPv6 address ensures a consistent IPv6 address for the instance and is automatically assigned by AWS to the ENI. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains until the instance is terminated or the ENI is detached. Disabling `enablePrimaryIpv6` after it has been enabled forces recreation of the instance. * `enclaveOptions` - (Optional) Enable Nitro Enclaves on launched instances. See [Enclave Options](#enclave-options) below for more details. * `ephemeralBlockDevice` - (Optional) One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a set of objects. +* `forceDestroy` - (Optional) Destroys instance even if `disableApiTermination` or `disableApiStop` is set to `true`. Defaults to `false`. Once this parameter is set to `true`, a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the instance or destroying the instance, this flag will not work. Additionally when importing an instance, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation. * `getPasswordData` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. * `hibernation` - (Optional) If true, the launched EC2 instance will support hibernation. * `hostId` - (Optional) ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. @@ -586,4 +587,4 @@ Using `terraform import`, import instances using the `id`. For example: % terraform import aws_instance.web i-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lakeformation_data_cells_filter.html.markdown b/website/docs/cdktf/typescript/r/lakeformation_data_cells_filter.html.markdown index 83ce3392d788..b810a6c61b5e 100644 --- a/website/docs/cdktf/typescript/r/lakeformation_data_cells_filter.html.markdown +++ b/website/docs/cdktf/typescript/r/lakeformation_data_cells_filter.html.markdown @@ -89,7 +89,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `databaseName`, `name`, `tableCatalogId`, and `tableName` separated by `,`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -113,10 +113,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Lake Formation Data Cells Filter using the `id`. For example: +Using `terraform import`, import Lake Formation Data Cells Filter using the `databaseName`, `name`, `tableCatalogId`, and `tableName` separated by `,`. For example: ```console % terraform import aws_lakeformation_data_cells_filter.example database_name,name,table_catalog_id,table_name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/networkfirewall_vpc_endpoint_association.html.markdown b/website/docs/cdktf/typescript/r/networkfirewall_vpc_endpoint_association.html.markdown new file mode 100644 index 000000000000..1daf95a944a7 --- /dev/null +++ b/website/docs/cdktf/typescript/r/networkfirewall_vpc_endpoint_association.html.markdown @@ -0,0 +1,124 @@ +--- +subcategory: "Network Firewall" +layout: "aws" +page_title: "AWS: aws_networkfirewall_vpc_endpoint_association" +description: |- + Manages a firewall endpoint for an AWS Network Firewall firewall. +--- + + + +# Resource: aws_networkfirewall_vpc_endpoint_association + +Manages a firewall endpoint for an AWS Network Firewall firewall. + +Use `aws_networkfirewall_vpc_endpoint_association` to establish new firewall endpoints in any Availability Zone where the firewall is already being used. The first use of a firewall in an Availability Zone must be defined by `aws_networkfirewall_firewall` resource and `subnetMapping` argument. + +## Example Usage + +### Basic Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NetworkfirewallVpcEndpointAssociation } from "./.gen/providers/aws/networkfirewall-vpc-endpoint-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new NetworkfirewallVpcEndpointAssociation(this, "example", { + firewallArn: Token.asString(awsNetworkfirewallFirewallExample.arn), + subnetMapping: [ + { + subnetId: Token.asString(awsSubnetExample.id), + }, + { + subnetId: exampleTwo.id, + }, + ], + tags: { + Name: "example endpoint", + }, + vpcId: Token.asString(awsVpcExample.id), + }); + } +} + +``` + +## Argument Reference + +This resource supports the following arguments: + +* `description` (Optional) - A description of the VPC endpoint association. +* `firewallArn` (Required) - The Amazon Resource Name (ARN) that identifies the firewall. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `subnetMapping` (Required) - The ID for a subnet that's used in an association with a firewall. See [Subnet Mapping](#subnet-mapping) below for details. +* `tags` - (Optional) Map of resource tags to associate with the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `vpcId` (Required) - The unique identifier of the VPC for the endpoint association. + +### Subnet Mapping + +The `subnetMapping` block supports the following arguments: + +* `ipAddressType` - (Optional) The subnet's IP address type. Valid values: `"DUALSTACK"`, `"IPV4"`. +* `subnetId` - (Required) The unique identifier for the subnet. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `vpcEndpointAssociationArn` - ARN of the VPC Endpoint Association. +* `vpcEndpointAssociationId` - The unique identifier of the VPC endpoint association. +* `vpcEndpointAssociationStatus` - Nested list of information about the current status of the VPC Endpoint Association. + * `association_sync_states` - Set of subnets configured for use by the VPC Endpoint Association. + * `attachment` - Nested list describing the attachment status of the firewall's VPC Endpoint Association with a single VPC subnet. + * `endpointId` - The identifier of the VPC endpoint that AWS Network Firewall has instantiated in the subnet. You use this to identify the firewall endpoint in the VPC route tables, when you redirect the VPC traffic through the endpoint. + * `subnetId` - The unique identifier of the subnet that you've specified to be used for a VPC Endpoint Association endpoint. + * `availabilityZone` - The Availability Zone where the subnet is configured. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Network Firewall VPC Endpoint Association using the `vpcEndpointAssociationArn`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NetworkfirewallVpcEndpointAssociation } from "./.gen/providers/aws/networkfirewall-vpc-endpoint-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + NetworkfirewallVpcEndpointAssociation.generateConfigForImport( + this, + "example", + "arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example" + ); + } +} + +``` + +Using `terraform import`, import Network Firewall VPC Endpoint Association using the `vpcEndpointAssociationArn`. For example: + +```console +% terraform import aws_networkfirewall_vpc_endpoint_association.example arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/networkmanager_transit_gateway_peering.html.markdown b/website/docs/cdktf/typescript/r/networkmanager_transit_gateway_peering.html.markdown index 9b1d216c0bc1..b59e967f898f 100644 --- a/website/docs/cdktf/typescript/r/networkmanager_transit_gateway_peering.html.markdown +++ b/website/docs/cdktf/typescript/r/networkmanager_transit_gateway_peering.html.markdown @@ -28,6 +28,10 @@ class MyConvertedCode extends TerraformStack { super(scope, name); new NetworkmanagerTransitGatewayPeering(this, "example", { coreNetworkId: Token.asString(awsccNetworkmanagerCoreNetworkExample.id), + dependsOn: [ + awsEc2TransitGatewayPolicyTableExample, + awsNetworkmanagerCoreNetworkPolicyAttachmentExample, + ], transitGatewayArn: Token.asString(awsEc2TransitGatewayExample.arn), }); } @@ -99,4 +103,4 @@ Using `terraform import`, import `aws_networkmanager_transit_gateway_peering` us % terraform import aws_networkmanager_transit_gateway_peering.example peering-444555aaabbb11223 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opensearch_authorize_vpc_endpoint_access.html.markdown b/website/docs/cdktf/typescript/r/opensearch_authorize_vpc_endpoint_access.html.markdown index 9676f4493829..8820d6c36761 100644 --- a/website/docs/cdktf/typescript/r/opensearch_authorize_vpc_endpoint_access.html.markdown +++ b/website/docs/cdktf/typescript/r/opensearch_authorize_vpc_endpoint_access.html.markdown @@ -60,7 +60,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `domainName`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -84,10 +84,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `domainName`. For example: ```console % terraform import aws_opensearch_authorize_vpc_endpoint_access.example authorize_vpc_endpoint_access-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opensearch_domain_policy.html.markdown b/website/docs/cdktf/typescript/r/opensearch_domain_policy.html.markdown index cf2bde0837b7..ee4addad1e42 100644 --- a/website/docs/cdktf/typescript/r/opensearch_domain_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/opensearch_domain_policy.html.markdown @@ -88,4 +88,36 @@ This resource exports no additional attributes. * `update` - (Default `180m`) * `delete` - (Default `90m`) - \ No newline at end of file +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Domain Policy using `domainName` prefixed with `esd-policy-`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OpensearchDomainPolicy } from "./.gen/providers/aws/opensearch-domain-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + OpensearchDomainPolicy.generateConfigForImport( + this, + "example", + "esd-policy-tf-test" + ); + } +} + +``` + +Using `terraform import`, import OpenSearch Domain Policy using `domainName` prefixed with `esd-policy-`. For example: + +```console +% terraform import aws_opensearch_domain_policy.example esd-policy-tf-test +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_account_settings.html.markdown b/website/docs/cdktf/typescript/r/quicksight_account_settings.html.markdown index 9625e1ebd5c7..d4ea70bd8518 100644 --- a/website/docs/cdktf/typescript/r/quicksight_account_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_account_settings.html.markdown @@ -24,7 +24,7 @@ import { TerraformStack } from "cdktf"; * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { QuicksightAccountSettings } from "./.gen/providers/aws/"; +import { QuicksightAccountSettings } from "./.gen/providers/aws/quicksight-account-settings"; import { QuicksightAccountSubscription } from "./.gen/providers/aws/quicksight-account-subscription"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { @@ -41,7 +41,7 @@ class MyConvertedCode extends TerraformStack { ); new QuicksightAccountSettings(this, "example", { dependsOn: [subscription], - termination_protection_enabled: false, + terminationProtectionEnabled: false, }); } } @@ -52,14 +52,13 @@ class MyConvertedCode extends TerraformStack { This resource supports the following arguments: -* `default_namespace` - (Optional) The default namespace for this Amazon Web Services account. Currently, the default is `default`. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `defaultNamespace` - (Optional) The default namespace for this Amazon Web Services account. Currently, the default is `default`. * `terminationProtectionEnabled` - (Optional) A boolean value that determines whether or not an Amazon QuickSight account can be deleted. If `true`, it does not allow the account to be deleted and results in an error message if a user tries to make a DeleteAccountSubscription request. If `false`, it will allow the account to be deleted. ## Attribute Reference -This resource exports the following attributes in addition to the arguments above: - -* `awsAccountId` - The ID for the AWS account that contains the settings. +This resource exports no additional attributes. ## Import @@ -73,7 +72,7 @@ import { TerraformStack } from "cdktf"; * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { QuicksightAccountSettings } from "./.gen/providers/aws/"; +import { QuicksightAccountSettings } from "./.gen/providers/aws/quicksight-account-settings"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); @@ -93,4 +92,4 @@ Using `terraform import`, import QuickSight Account Settings using the AWS accou % terraform import aws_quicksight_account_settings.example "012345678901" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_account_subscription.html.markdown b/website/docs/cdktf/typescript/r/quicksight_account_subscription.html.markdown index 9ffb34005743..352ca8d2935c 100644 --- a/website/docs/cdktf/typescript/r/quicksight_account_subscription.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_account_subscription.html.markdown @@ -50,11 +50,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `activeDirectoryName` - (Optional) Name of your Active Directory. This field is required if `ACTIVE_DIRECTORY` is the selected authentication method of the new Amazon QuickSight account. * `adminGroup` - (Optional) Admin group associated with your Active Directory or IAM Identity Center account. This field is required if `ACTIVE_DIRECTORY` or `IAM_IDENTITY_CENTER` is the selected authentication method of the new Amazon QuickSight account. * `authorGroup` - (Optional) Author group associated with your Active Directory or IAM Identity Center account. -* `awsAccountId` - (Optional) AWS account ID hosting the QuickSight account. Default to provider account. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `contactNumber` - (Optional) A 10-digit phone number for the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. * `directoryId` - (Optional) Active Directory ID that is associated with your Amazon QuickSight account. * `emailAddress` - (Optional) Email address of the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. @@ -63,6 +62,7 @@ The following arguments are optional: * `lastName` - (Optional) Last name of the author of the Amazon QuickSight account to use for future communications. This field is required if `ENTERPPRISE_AND_Q` is the selected edition of the new Amazon QuickSight account. * `readerGroup` - (Optional) Reader group associated with your Active Directory or IAM Identity Center account. * `realm` - (Optional) Realm of the Active Directory that is associated with your Amazon QuickSight account. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -109,4 +109,4 @@ Using `terraform import`, import a QuickSight Account Subscription using `awsAcc % terraform import aws_quicksight_account_subscription.example "012345678901" ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_analysis.html.markdown b/website/docs/cdktf/typescript/r/quicksight_analysis.html.markdown index 7690587b119b..e078145c6ee2 100644 --- a/website/docs/cdktf/typescript/r/quicksight_analysis.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_analysis.html.markdown @@ -135,12 +135,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `definition` - (Optional) A detailed analysis definition. Only one of `definition` or `sourceEntity` should be configured. See [definition](#definition). * `parameters` - (Optional) The parameters for the creation of the analysis, which you want to use to override the default settings. An analysis can have any type of parameters, and some parameters might accept multiple values. See [parameters](#parameters). * `permissions` - (Optional) A set of resource permissions on the analysis. Maximum of 64 items. See [permissions](#permissions). * `recoveryWindowInDays` - (Optional) A value that specifies the number of days that Amazon QuickSight waits before it deletes the analysis. Use `0` to force deletion without recovery. Minimum value of `7`. Maximum value of `30`. Default to `30`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `sourceEntity` - (Optional) The entity that you are using as a source when you create the analysis (template). Only one of `definition` or `sourceEntity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `themeArn` - (Optional) The Amazon Resource Name (ARN) of the theme that is being used for this analysis. The theme ARN must exist in the same AWS account where you create the analysis. @@ -232,4 +232,4 @@ Using `terraform import`, import a QuickSight Analysis using the AWS account ID % terraform import aws_quicksight_analysis.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_custom_permissions.html.markdown b/website/docs/cdktf/typescript/r/quicksight_custom_permissions.html.markdown new file mode 100644 index 000000000000..e69a0bcfd91e --- /dev/null +++ b/website/docs/cdktf/typescript/r/quicksight_custom_permissions.html.markdown @@ -0,0 +1,104 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_custom_permissions" +description: |- + Manages a QuickSight custom permissions profile. +--- + + + +# Resource: aws_quicksight_custom_permissions + +Manages a QuickSight custom permissions profile. + +## Example Usage + +resource "aws_quicksight_custom_permissions" "example" { + custom_permissions_name = "example-permissions" + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } +} + +## Argument Reference + +The following arguments are required: + +* `capabilities` - (Required) Actions to include in the custom permissions profile. See [capabilities](#capabilities). +* `customPermissionsName` - (Required, Forces new resource) Custom permissions profile name. + +The following arguments are optional: + +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### capabilities + +* `addOrRunAnomalyDetectionForAnalyses` - (Optional) The ability to add or run anomaly detection. Valid values: `DENY`. +* `createAndUpdateDashboardEmailReports` - (Optional) The ability to create and update email reports. Valid values: `DENY`. +* `createAndUpdateDatasets` - (Optional) The ability to create and update datasets. Valid values: `DENY`. +* `createAndUpdateDataSources` - (Optional) The ability to create and update data sources. Valid values: `DENY`. +* `createAndUpdateThemes` - (Optional) The ability to export to create and update themes. Valid values: `DENY`. +* `createAndUpdateThresholdAlerts` - (Optional) The ability to create and update threshold alerts. Valid values: `DENY`. +* `createSharedFolders` - (Optional) The ability to create shared folders. Valid values: `DENY`. +* `createSpiceDataset` - (Optional) The ability to create a SPICE dataset. Valid values: `DENY`. +* `exportToCsv` - (Optional) The ability to export to CSV files from the UI. Valid values: `DENY`. +* `exportToCsvInScheduledReports` - (Optional) The ability to export to CSV files in scheduled email reports. Valid values: `DENY`. +* `exportToExcel` - (Optional) The ability to export to Excel files from the UI. Valid values: `DENY`. +* `exportToExcelInScheduledReports` - (Optional) The ability to export to Excel files in scheduled email reports. Valid values: `DENY`. +* `exportToPdf` - (Optional) The ability to export to PDF files from the UI. Valid values: `DENY`. +* `exportToPdfInScheduledReports` - (Optional) The ability to export to PDF files in scheduled email reports. Valid values: `DENY`. +* `includeContentInScheduledReportsEmail` - (Optional) The ability to include content in scheduled email reports. Valid values: `DENY`. +* `printReports` - (Optional) The ability to print reports. Valid values: `DENY`. +* `renameSharedFolders` - (Optional) The ability to rename shared folders. Valid values: `DENY`. +* `shareAnalyses` - (Optional) The ability to share analyses. Valid values: `DENY`. +* `shareDashboards` - (Optional) The ability to share dashboards. Valid values: `DENY`. +* `shareDatasets` - (Optional) The ability to share datasets. Valid values: `DENY`. +* `shareDataSources` - (Optional) The ability to share data sources. Valid values: `DENY`. +* `subscribeDashboardEmailReports` - (Optional) The ability to subscribe to email reports. Valid values: `DENY`. +* `viewAccountSpiceCapacity` - (Optional) The ability to view account SPICE capacity. Valid values: `DENY`. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `arn` - ARN of the custom permissions profile. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightCustomPermissions } from "./.gen/providers/aws/quicksight-custom-permissions"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + QuicksightCustomPermissions.generateConfigForImport( + this, + "example", + "123456789012,example-permissions" + ); + } +} + +``` + +Using `terraform import`, import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```console +% terraform import aws_quicksight_custom_permissions.example 123456789012,example-permissions +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_dashboard.html.markdown b/website/docs/cdktf/typescript/r/quicksight_dashboard.html.markdown index 44d689abfe00..6acb55a676c2 100644 --- a/website/docs/cdktf/typescript/r/quicksight_dashboard.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_dashboard.html.markdown @@ -138,12 +138,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `dashboardPublishOptions` - (Optional) Options for publishing the dashboard. See [dashboard_publish_options](#dashboard_publish_options). * `definition` - (Optional) A detailed dashboard definition. Only one of `definition` or `sourceEntity` should be configured. See [definition](#definition). * `parameters` - (Optional) The parameters for the creation of the dashboard, which you want to use to override the default settings. A dashboard can have any type of parameters, and some parameters might accept multiple values. See [parameters](#parameters). * `permissions` - (Optional) A set of resource permissions on the dashboard. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `sourceEntity` - (Optional) The entity that you are using as a source when you create the dashboard (template). Only one of `definition` or `sourceEntity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `themeArn` - (Optional) The Amazon Resource Name (ARN) of the theme that is being used for this dashboard. The theme ARN must exist in the same AWS account where you create the dashboard. @@ -290,4 +290,4 @@ Using `terraform import`, import a QuickSight Dashboard using the AWS account ID % terraform import aws_quicksight_dashboard.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_data_set.html.markdown b/website/docs/cdktf/typescript/r/quicksight_data_set.html.markdown index e1a673efce09..84f201d13cec 100644 --- a/website/docs/cdktf/typescript/r/quicksight_data_set.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_data_set.html.markdown @@ -265,8 +265,7 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `columnGroups` - (Optional) Groupings of columns that work together in certain Amazon QuickSight features. Currently, only geospatial hierarchy is supported. See [column_groups](#column_groups). * `columnLevelPermissionRules` - (Optional) A set of 1 or more definitions of a [ColumnLevelPermissionRule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnLevelPermissionRule.html). See [column_level_permission_rules](#column_level_permission_rules). * `dataSetUsageConfiguration` - (Optional) The usage configuration to apply to child datasets that reference this dataset as a source. See [data_set_usage_configuration](#data_set_usage_configuration). @@ -274,6 +273,7 @@ The following arguments are optional: * `logicalTableMap` - (Optional) Configures the combination and transformation of the data from the physical tables. Maximum of 1 entry. See [logical_table_map](#logical_table_map). * `permissions` - (Optional) A set of resource permissions on the data source. Maximum of 64 items. See [permissions](#permissions). * `physicalTableMap` - (Optional) Declares the physical tables that are available in the underlying data sources. See [physical_table_map](#physical_table_map). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `rowLevelPermissionDataSet` - (Optional) The row-level security configuration for the data that you want to create. See [row_level_permission_data_set](#row_level_permission_data_set). * `rowLevelPermissionTagConfiguration` - (Optional) The configuration of tags on a dataset to set row-level security. Row-level security tags are currently supported for anonymous embedding only. See [row_level_permission_tag_configuration](#row_level_permission_tag_configuration). * `refreshProperties` - (Optional) The refresh properties for the data set. **NOTE**: Only valid when `importMode` is set to `SPICE`. See [refresh_properties](#refresh_properties). @@ -524,4 +524,4 @@ Using `terraform import`, import a QuickSight Data Set using the AWS account ID % terraform import aws_quicksight_data_set.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_data_source.html.markdown b/website/docs/cdktf/typescript/r/quicksight_data_source.html.markdown index 8882ed699bd1..0382e2c84f84 100644 --- a/website/docs/cdktf/typescript/r/quicksight_data_source.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_data_source.html.markdown @@ -199,10 +199,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `credentials` - (Optional) The credentials Amazon QuickSight uses to connect to your underlying source. See [Credentials](#credentials-argument-reference) below for more details. * `permission` - (Optional) A set of resource permissions on the data source. Maximum of 64 items. See [Permission](#permission-argument-reference) below for more details. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `sslProperties` - (Optional) Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See [SSL Properties](#ssl_properties-argument-reference) below for more details. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpcConnectionProperties`- (Optional) Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See [VPC Connection Properties](#vpc_connection_properties-argument-reference) below for more details. @@ -415,4 +415,4 @@ Using `terraform import`, import a QuickSight data source using the AWS account % terraform import aws_quicksight_data_source.example 123456789123/my-data-source-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_folder.html.markdown b/website/docs/cdktf/typescript/r/quicksight_folder.html.markdown index ff9d03dc1f11..c815d9044e9c 100644 --- a/website/docs/cdktf/typescript/r/quicksight_folder.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_folder.html.markdown @@ -112,11 +112,11 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `folderType` - (Optional) The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`. * `parentFolderArn` - (Optional) The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder. * `permissions` - (Optional) A set of resource permissions on the folder. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### permissions @@ -176,4 +176,4 @@ Using `terraform import`, import a QuickSight folder using the AWS account ID an % terraform import aws_quicksight_folder.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_folder_membership.html.markdown b/website/docs/cdktf/typescript/r/quicksight_folder_membership.html.markdown index 39856775f044..611d7891138a 100644 --- a/website/docs/cdktf/typescript/r/quicksight_folder_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_folder_membership.html.markdown @@ -48,8 +48,8 @@ The following arguments are required: The following arguments are optional: +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. ## Attribute Reference @@ -89,4 +89,4 @@ Using `terraform import`, import QuickSight Folder Membership using the AWS acco % terraform import aws_quicksight_folder_membership.example 123456789012,example-folder,DATASET,example-dataset ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_group.html.markdown b/website/docs/cdktf/typescript/r/quicksight_group.html.markdown index c075e8c6c0c1..b45cdf4d9dc0 100644 --- a/website/docs/cdktf/typescript/r/quicksight_group.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_group.html.markdown @@ -38,11 +38,11 @@ class MyConvertedCode extends TerraformStack { This resource supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `groupName` - (Required) A name for the group. -* `awsAccountId` - (Optional) The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `description` - (Optional) A description for the group. +* `groupName` - (Required) A name for the group. * `namespace` - (Optional) The namespace. Currently, you should set this to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -82,4 +82,4 @@ Using `terraform import`, import QuickSight Group using the aws account id, name % terraform import aws_quicksight_group.example 123456789123/default/tf-example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_group_membership.html.markdown b/website/docs/cdktf/typescript/r/quicksight_group_membership.html.markdown index 7e9b98099f9d..d1345e38d438 100644 --- a/website/docs/cdktf/typescript/r/quicksight_group_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_group_membership.html.markdown @@ -39,11 +39,11 @@ class MyConvertedCode extends TerraformStack { This resource supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `groupName` - (Required) The name of the group in which the member will be added. * `memberName` - (Required) The name of the member to add to the group. -* `awsAccountId` - (Optional) The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account. -* `namespace` - (Required) The namespace that you want the user to be a part of. Defaults to `default`. +* `namespace` - (Optional) The namespace that you want the user to be a part of. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -81,4 +81,4 @@ Using `terraform import`, import QuickSight Group membership using the AWS accou % terraform import aws_quicksight_group_membership.example 123456789123/default/all-access-users/john_smith ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_iam_policy_assignment.html.markdown b/website/docs/cdktf/typescript/r/quicksight_iam_policy_assignment.html.markdown index 75004213df0b..79c76a1551a6 100644 --- a/website/docs/cdktf/typescript/r/quicksight_iam_policy_assignment.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_iam_policy_assignment.html.markdown @@ -52,11 +52,11 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `identities` - (Optional) Amazon QuickSight users, groups, or both to assign the policy to. See [`identities` block](#identities-block). * `namespace` - (Optional) Namespace that contains the assignment. Defaults to `default`. * `policyArn` - (Optional) ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ### `identities` block @@ -102,4 +102,4 @@ Using `terraform import`, import QuickSight IAM Policy Assignment using the AWS % terraform import aws_quicksight_iam_policy_assignment.example 123456789012,default,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_ingestion.html.markdown b/website/docs/cdktf/typescript/r/quicksight_ingestion.html.markdown index 2823fc201be9..f652375979f4 100644 --- a/website/docs/cdktf/typescript/r/quicksight_ingestion.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_ingestion.html.markdown @@ -48,8 +48,8 @@ The following arguments are required: The following arguments are optional: +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. ## Attribute Reference @@ -91,4 +91,4 @@ Using `terraform import`, import QuickSight Ingestion using the AWS account ID, % terraform import aws_quicksight_ingestion.example 123456789012,example-dataset-id,example-ingestion-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_ip_restriction.html.markdown b/website/docs/cdktf/typescript/r/quicksight_ip_restriction.html.markdown new file mode 100644 index 000000000000..01016f088299 --- /dev/null +++ b/website/docs/cdktf/typescript/r/quicksight_ip_restriction.html.markdown @@ -0,0 +1,92 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_ip_restriction" +description: |- + Manages the content and status of IP rules. +--- + + + +# Resource: aws_quicksight_ip_restriction + +Manages the content and status of IP rules. + +~> Deletion of this resource clears all IP restrictions from a QuickSight account. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightIpRestriction } from "./.gen/providers/aws/quicksight-ip-restriction"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new QuicksightIpRestriction(this, "example", { + enabled: true, + ipRestrictionRuleMap: { + "108.56.166.202/32": "Allow self", + }, + vpcIdRestrictionRuleMap: { + "${(aws_vpc.example.id)}": "Main VPC", + }, + }); + } +} + +``` + +## Argument Reference + +This resource supports the following arguments: + +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `enabled` - (Required) Whether IP rules are turned on. +* `ipRestrictionRuleMap` - (Optional) Map of allowed IPv4 CIDR ranges and descriptions. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `vpcEndpointIdRestrictionRuleMap` - (Optional) Map of allowed VPC endpoint IDs and descriptions. +* `vpcIdRestrictionRuleMap` - (Optional) Map of VPC IDs and descriptions. Traffic from all VPC endpoints that are present in the specified VPC is allowed. + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight IP restriction using the AWS account ID. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightIpRestriction } from "./.gen/providers/aws/quicksight-ip-restriction"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + QuicksightIpRestriction.generateConfigForImport( + this, + "example", + "012345678901" + ); + } +} + +``` + +Using `terraform import`, import QuickSight IP restriction using the AWS account ID. For example: + +```console +% terraform import aws_quicksight_ip_restriction.example "012345678901" +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_key_registration.html.markdown b/website/docs/cdktf/typescript/r/quicksight_key_registration.html.markdown new file mode 100644 index 000000000000..592b4aa3ec0d --- /dev/null +++ b/website/docs/cdktf/typescript/r/quicksight_key_registration.html.markdown @@ -0,0 +1,96 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_key_registration" +description: |- + Registers customer managed keys in a Amazon QuickSight account. +--- + + + +# Resource: aws_quicksight_key_registration + +Registers customer managed keys in a Amazon QuickSight account. + +~> Deletion of this resource clears all CMK registrations from a QuickSight account. QuickSight then uses AWS owned keys to encrypt your resources. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightKeyRegistration } from "./.gen/providers/aws/quicksight-key-registration"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new QuicksightKeyRegistration(this, "example", { + keyRegistration: [ + { + keyArn: example1.arn, + }, + { + defaultKey: true, + keyArn: example2.arn, + }, + ], + }); + } +} + +``` + +## Argument Reference + +This resource supports the following arguments: + +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `keyRegistration` - (Required) Registered keys. See [key_registration](#key_registration). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +### key_registration + +* `defaultKey` - (Optional) Whether the key is set as the default key for encryption and decryption use. +* `keyArn` - (Required) ARN of the AWS KMS key that is registered for encryption and decryption use. + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight key registration using the AWS account ID. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightKeyRegistration } from "./.gen/providers/aws/quicksight-key-registration"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + QuicksightKeyRegistration.generateConfigForImport( + this, + "example", + "012345678901" + ); + } +} + +``` + +Using `terraform import`, import QuickSight key registration using the AWS account ID. For example: + +```console +% terraform import aws_quicksight_key_registration.example "012345678901" +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_namespace.html.markdown b/website/docs/cdktf/typescript/r/quicksight_namespace.html.markdown index 99f2169d2053..c46712570be9 100644 --- a/website/docs/cdktf/typescript/r/quicksight_namespace.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_namespace.html.markdown @@ -44,9 +44,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `identityStore` - (Optional) User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -98,4 +98,4 @@ Using `terraform import`, import QuickSight Namespace using the AWS account ID a % terraform import aws_quicksight_namespace.example 123456789012,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_refresh_schedule.html.markdown b/website/docs/cdktf/typescript/r/quicksight_refresh_schedule.html.markdown index 22db7e48bbc1..101f64f2b465 100644 --- a/website/docs/cdktf/typescript/r/quicksight_refresh_schedule.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_refresh_schedule.html.markdown @@ -137,8 +137,8 @@ The following arguments are required: The following arguments are optional: +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. ### schedule @@ -197,4 +197,4 @@ Using `terraform import`, import a QuickSight Refresh Schedule using the AWS acc % terraform import aws_quicksight_refresh_schedule.example 123456789012,dataset-id,schedule-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_role_custom_permission.html.markdown b/website/docs/cdktf/typescript/r/quicksight_role_custom_permission.html.markdown new file mode 100644 index 000000000000..d729bdd4aef2 --- /dev/null +++ b/website/docs/cdktf/typescript/r/quicksight_role_custom_permission.html.markdown @@ -0,0 +1,89 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_role_custom_permission" +description: |- + Manages the custom permissions that are associated with a role. +--- + + + +# Resource: aws_quicksight_role_custom_permission + +Manages the custom permissions that are associated with a role. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightRoleCustomPermission } from "./.gen/providers/aws/quicksight-role-custom-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new QuicksightRoleCustomPermission(this, "example", { + customPermissionsName: Token.asString( + awsQuicksightCustomPermissionsExample.customPermissionsName + ), + role: "READER", + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `customPermissionsName` - (Required, Forces new resource) Custom permissions profile name. +* `role` - (Required, Forces new resource) Role. Valid values are `ADMIN`, `AUTHOR`, `READER`, `ADMIN_PRO`, `AUTHOR_PRO`, and `READER_PRO`. + +The following arguments are optional: + +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace containing the role. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight role custom permissions using a comma-delimited string combining the `awsAccountId`, `namespace` and `role`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightRoleCustomPermission } from "./.gen/providers/aws/quicksight-role-custom-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + QuicksightRoleCustomPermission.generateConfigForImport( + this, + "example", + "012345678901,default,READER" + ); + } +} + +``` + +Using `terraform import`, import QuickSight role custom permissions using a comma-delimited string combining the `awsAccountId`, `namespace`, and `role`. For example: + +```console +% terraform import aws_quicksight_role_custom_permission.example 012345678901,default,READER +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_role_membership.html.markdown b/website/docs/cdktf/typescript/r/quicksight_role_membership.html.markdown index a5a3194485b4..b64639de339e 100644 --- a/website/docs/cdktf/typescript/r/quicksight_role_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_role_membership.html.markdown @@ -47,9 +47,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. Defaults to the account of the caller identity if not configured. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) Name of the namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -87,4 +87,4 @@ Using `terraform import`, import QuickSight Role Membership using a comma-delimi % terraform import aws_quicksight_role_membership.example 012345678901,default,READER,example-group ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_template.html.markdown b/website/docs/cdktf/typescript/r/quicksight_template.html.markdown index cad7ddb88e02..844b887971b6 100644 --- a/website/docs/cdktf/typescript/r/quicksight_template.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_template.html.markdown @@ -140,10 +140,10 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `definition` - (Optional) A detailed template definition. Only one of `definition` or `sourceEntity` should be configured. See [definition](#definition). * `permissions` - (Optional) A set of resource permissions on the template. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `sourceEntity` - (Optional) The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See [source_entity](#source_entity). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -234,4 +234,4 @@ Using `terraform import`, import a QuickSight Template using the AWS account ID % terraform import aws_quicksight_template.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_template_alias.html.markdown b/website/docs/cdktf/typescript/r/quicksight_template_alias.html.markdown index 2ec8e5d86318..93f9c98525b7 100644 --- a/website/docs/cdktf/typescript/r/quicksight_template_alias.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_template_alias.html.markdown @@ -48,8 +48,8 @@ The following arguments are required: The following arguments are optional: +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. ## Attribute Reference @@ -90,4 +90,4 @@ Using `terraform import`, import QuickSight Template Alias using the AWS account % terraform import aws_quicksight_template_alias.example 123456789012,example-id,example-alias ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_theme.html.markdown b/website/docs/cdktf/typescript/r/quicksight_theme.html.markdown index 6fd05b7753aa..4cf6cb64315b 100644 --- a/website/docs/cdktf/typescript/r/quicksight_theme.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_theme.html.markdown @@ -60,16 +60,16 @@ class MyConvertedCode extends TerraformStack { The following arguments are required: -* `themeId` - (Required, Forces new resource) Identifier of the theme. * `baseThemeId` - (Required) The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis. -* `name` - (Required) Display name of the theme. * `configuration` - (Required) The theme configuration, which contains the theme display properties. See [configuration](#configuration). +* `name` - (Required) Display name of the theme. +* `themeId` - (Required, Forces new resource) Identifier of the theme. The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional, Forces new resource) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `permissions` - (Optional) A set of resource permissions on the theme. Maximum of 64 items. See [permissions](#permissions). +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `versionDescription` - (Optional) A description of the current theme version being created/updated. @@ -196,4 +196,4 @@ Using `terraform import`, import a QuickSight Theme using the AWS account ID and % terraform import aws_quicksight_theme.example 123456789012,example-id ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_user.html.markdown b/website/docs/cdktf/typescript/r/quicksight_user.html.markdown index 7cb7af8581a7..347e44e774e3 100644 --- a/website/docs/cdktf/typescript/r/quicksight_user.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_user.html.markdown @@ -96,15 +96,15 @@ class MyConvertedCode extends TerraformStack { The following arguments are required: * `email` - (Required) Email address of the user that you want to register. -* `identityType` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`. -* `userRole` - (Required) Amazon QuickSight role for the user. Value values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`. +* `identityType` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`, `IAM_IDENTITY_CENTER`. +* `userRole` - (Required) Amazon QuickSight role for the user. Valid values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`, `RESTRICTED_AUTHOR`, `RESTRICTED_READER`. The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) ID for the AWS account that the user is in. Use the ID for the AWS account that contains your Amazon QuickSight account. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `iamArn` - (Optional) ARN of the IAM user or role that you are registering with Amazon QuickSight. Required only for users with an identity type of `IAM`. * `namespace` - (Optional) The Amazon Quicksight namespace to create the user in. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `sessionName` - (Optional) Name of the IAM session to use when assuming roles that can embed QuickSight dashboards. Only valid for registering users using an assumed IAM role. Additionally, if registering multiple users using the same IAM role, each user needs to have a unique session name. * `userName` - (Optional) Amazon QuickSight user name that you want to create for the user you are registering. Required only for users with an identity type of `QUICKSIGHT`. @@ -120,4 +120,4 @@ This resource exports the following attributes in addition to the arguments abov You cannot import this resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_user_custom_permission.html.markdown b/website/docs/cdktf/typescript/r/quicksight_user_custom_permission.html.markdown new file mode 100644 index 000000000000..938f502a9957 --- /dev/null +++ b/website/docs/cdktf/typescript/r/quicksight_user_custom_permission.html.markdown @@ -0,0 +1,89 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_user_custom_permission" +description: |- + Manages the custom permissions profile for a user. +--- + + + +# Resource: aws_quicksight_user_custom_permission + +Manages the custom permissions profile for a user. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightUserCustomPermission } from "./.gen/providers/aws/quicksight-user-custom-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new QuicksightUserCustomPermission(this, "example", { + customPermissionsName: Token.asString( + awsQuicksightCustomPermissionsExample.customPermissionsName + ), + userName: Token.asString(awsQuicksightUserExample.userName), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `customPermissionsName` - (Required, Forces new resource) Custom permissions profile name. +* `userName` - (Required, Forces new resource) Username of the user. + +The following arguments are optional: + +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace that the user belongs to. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight user custom permissions using a comma-delimited string combining the `awsAccountId`, `namespace` and `userName`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { QuicksightUserCustomPermission } from "./.gen/providers/aws/quicksight-user-custom-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + QuicksightUserCustomPermission.generateConfigForImport( + this, + "example", + "012345678901,default,user1" + ); + } +} + +``` + +Using `terraform import`, import QuickSight user custom permissions using a comma-delimited string combining the `awsAccountId`, `namespace`, and `userName`. For example: + +```console +% terraform import aws_quicksight_user_custom_permission.example 012345678901,default,user1 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/quicksight_vpc_connection.html.markdown b/website/docs/cdktf/typescript/r/quicksight_vpc_connection.html.markdown index 4a0ca9fcef10..7b97708ab26a 100644 --- a/website/docs/cdktf/typescript/r/quicksight_vpc_connection.html.markdown +++ b/website/docs/cdktf/typescript/r/quicksight_vpc_connection.html.markdown @@ -92,9 +92,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `awsAccountId` - (Optional) AWS account ID. +* `awsAccountId` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `dnsResolvers` - (Optional) A list of IP addresses of DNS resolver endpoints for the VPC connection. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference @@ -146,4 +146,4 @@ Using `terraform import`, import QuickSight VPC connection using the AWS account % terraform import aws_quicksight_vpc_connection.example 123456789012,example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/rds_instance_state.html.markdown b/website/docs/cdktf/typescript/r/rds_instance_state.html.markdown index 229b6f7c0565..2bd7f59cc907 100644 --- a/website/docs/cdktf/typescript/r/rds_instance_state.html.markdown +++ b/website/docs/cdktf/typescript/r/rds_instance_state.html.markdown @@ -49,9 +49,7 @@ This resource supports the following arguments: ## Attribute Reference -This resource exports the following attributes in addition to the arguments above: - -* `identifier` - DB Instance Identifier +This resource exports no additional attributes. ## Timeouts @@ -62,7 +60,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -86,10 +84,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```console % terraform import aws_rds_instance_state.example rds_instance_state-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/rekognition_collection.html.markdown b/website/docs/cdktf/typescript/r/rekognition_collection.html.markdown index bc3973f4ca50..88d7c8b4883a 100644 --- a/website/docs/cdktf/typescript/r/rekognition_collection.html.markdown +++ b/website/docs/cdktf/typescript/r/rekognition_collection.html.markdown @@ -64,7 +64,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `collectionId`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -88,10 +88,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Rekognition Collection using the `example_id_arg`. For example: +Using `terraform import`, import Rekognition Collection using the `collectionId`. For example: ```console % terraform import aws_rekognition_collection.example collection-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/rekognition_project.html.markdown b/website/docs/cdktf/typescript/r/rekognition_project.html.markdown index 169f908dec73..701b068462d5 100644 --- a/website/docs/cdktf/typescript/r/rekognition_project.html.markdown +++ b/website/docs/cdktf/typescript/r/rekognition_project.html.markdown @@ -90,7 +90,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `name`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -120,4 +120,4 @@ Using `terraform import`, import Rekognition Project using the `name`. For examp % terraform import aws_rekognition_project.example project-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/route53profiles_association.html.markdown b/website/docs/cdktf/typescript/r/route53profiles_association.html.markdown index 67a57754534b..c18dd50d261e 100644 --- a/website/docs/cdktf/typescript/r/route53profiles_association.html.markdown +++ b/website/docs/cdktf/typescript/r/route53profiles_association.html.markdown @@ -110,10 +110,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Route 53 Profiles Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Association using the `id`. For example: ```console % terraform import aws_route53profiles_association.example rpa-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/route53profiles_profile.html.markdown b/website/docs/cdktf/typescript/r/route53profiles_profile.html.markdown index b696adfe8063..49fe3fcd54a1 100644 --- a/website/docs/cdktf/typescript/r/route53profiles_profile.html.markdown +++ b/website/docs/cdktf/typescript/r/route53profiles_profile.html.markdown @@ -70,7 +70,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `id`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -94,10 +94,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Route 53 Profiles Profile using the `example`. For example: +Using `terraform import`, import Route 53 Profiles Profile using the `id`. For example: ```console % terraform import aws_route53profiles_profile.example rp-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/route53profiles_resource_association.html.markdown b/website/docs/cdktf/typescript/r/route53profiles_resource_association.html.markdown index 22db8fab2902..c84bd2282851 100644 --- a/website/docs/cdktf/typescript/r/route53profiles_resource_association.html.markdown +++ b/website/docs/cdktf/typescript/r/route53profiles_resource_association.html.markdown @@ -116,10 +116,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import Route 53 Profiles Resource Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Resource Association using the `id`. For example: ```console % terraform import aws_route53profiles_resource_association.example rpa-id-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/s3_access_point.html.markdown b/website/docs/cdktf/typescript/r/s3_access_point.html.markdown index 5be85f90244f..69dedafdebf9 100644 --- a/website/docs/cdktf/typescript/r/s3_access_point.html.markdown +++ b/website/docs/cdktf/typescript/r/s3_access_point.html.markdown @@ -142,11 +142,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `accountId` - (Optional) AWS account ID for the owner of the bucket for which you want to create an access point. Defaults to automatically determined account ID of the Terraform AWS provider. * `bucketAccountId` - (Optional) AWS account ID associated with the S3 bucket associated with this access point. * `policy` - (Optional) Valid JSON document that specifies the policy that you want to apply to this access point. Removing `policy` from your configuration or setting `policy` to null or an empty string (i.e., `policy = ""`) _will not_ delete the policy since it could have been set by `aws_s3control_access_point_policy`. To remove the `policy`, set it to `"{}"` (an empty JSON document). * `publicAccessBlockConfiguration` - (Optional) Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Map of tags to assign to the bucket. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpcConfiguration` - (Optional) Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Required for S3 on Outposts. Detailed below. ### public_access_block_configuration Configuration Block @@ -182,6 +183,7 @@ Note: S3 access points only support secure access by HTTPS. HTTP isn't supported * `hasPublicAccessPolicy` - Indicates whether this access point currently has a policy that allows public access. * `id` - For Access Point of an AWS Partition S3 Bucket, the AWS account ID and access point name separated by a colon (`:`). For S3 on Outposts Bucket, the ARN of the Access Point. * `networkOrigin` - Indicates whether this access point allows access from the public Internet. Values are `VPC` (the access point doesn't allow access from the public Internet) and `Internet` (the access point allows access from the public Internet, subject to the access point and bucket access policies). +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Import @@ -249,4 +251,4 @@ Import using the ARN for Access Points associated with an S3 on Outposts Bucket: % terraform import aws_s3_access_point.example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-1234567890123456/accesspoint/example ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/securityhub_standards_subscription.html.markdown b/website/docs/cdktf/typescript/r/securityhub_standards_subscription.html.markdown index dd21d03aa064..3ec8f533dcfe 100644 --- a/website/docs/cdktf/typescript/r/securityhub_standards_subscription.html.markdown +++ b/website/docs/cdktf/typescript/r/securityhub_standards_subscription.html.markdown @@ -64,7 +64,9 @@ Currently available standards (remember to replace `${var.partition}` and `${var | CIS AWS Foundations Benchmark v1.4.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/1.4.0` | | CIS AWS Foundations Benchmark v3.0.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/3.0.0` | | NIST SP 800-53 Rev. 5 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-53/v/5.0.0` | -| PCI DSS | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| NIST SP 800-171 Rev. 2 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-171/v/2.0.0` | +| PCI DSS v3.2.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| PCI DSS v4.0.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/4.0.1` | ## Attribute Reference @@ -163,4 +165,4 @@ Using `terraform import`, import Security Hub standards subscriptions using the % terraform import aws_securityhub_standards_subscription.nist_800_53_rev_5 arn:aws:securityhub:eu-west-1:123456789012:subscription/nist-800-53/v/5.0.0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sesv2_email_identity_policy.html.markdown b/website/docs/cdktf/typescript/r/sesv2_email_identity_policy.html.markdown index 6c4522889976..85a90970c88a 100644 --- a/website/docs/cdktf/typescript/r/sesv2_email_identity_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sesv2_email_identity_policy.html.markdown @@ -65,7 +65,7 @@ This resource exports no additional attributes. ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `id` (`email_identity|policy_name`). For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `emailIdentity` and `policyName` separated by `|`. For example: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -89,10 +89,10 @@ class MyConvertedCode extends TerraformStack { ``` -Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `example_id_arg`. For example: +Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `emailIdentity` and `policyName` separated by `|`. For example: ```console % terraform import aws_sesv2_email_identity_policy.example example_email_identity|example_policy_name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssm_patch_baseline.html.markdown b/website/docs/cdktf/typescript/r/ssm_patch_baseline.html.markdown index 469e38de5fde..7346512c9a8f 100644 --- a/website/docs/cdktf/typescript/r/ssm_patch_baseline.html.markdown +++ b/website/docs/cdktf/typescript/r/ssm_patch_baseline.html.markdown @@ -216,6 +216,7 @@ The following arguments are optional: * `approvedPatchesComplianceLevel` - (Optional) Compliance level for approved patches. This means that if an approved patch is reported as missing, this is the severity of the compliance violation. Valid values are `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, `INFORMATIONAL`, `UNSPECIFIED`. The default value is `UNSPECIFIED`. * `approvedPatchesEnableNonSecurity` - (Optional) Whether the list of approved patches includes non-security updates that should be applied to the instances. Applies to Linux instances only. * `approvedPatches` - (Optional) List of explicitly approved patches for the baseline. Cannot be specified with `approvalRule`. +* `availableSecurityUpdatesComplianceStatus` - (Optional) Indicates the compliance status of managed nodes for which security-related patches are available but were not approved. Supported for Windows Server managed nodes only. Valid values are `COMPLIANT`, `NON_COMPLIANT`. * `description` - (Optional) Description of the patch baseline. * `globalFilter` - (Optional) Set of global filters used to exclude patches from the baseline. Up to 4 global filters can be specified using Key/Value pairs. Valid Keys are `PRODUCT`, `CLASSIFICATION`, `MSRC_SEVERITY`, and `PATCH_ID`. * `operatingSystem` - (Optional) Operating system the patch baseline applies to. Valid values are `ALMA_LINUX`, `AMAZON_LINUX`, `AMAZON_LINUX_2`, `AMAZON_LINUX_2022`, `AMAZON_LINUX_2023`, `CENTOS`, `DEBIAN`, `MACOS`, `ORACLE_LINUX`, `RASPBIAN`, `REDHAT_ENTERPRISE_LINUX`, `ROCKY_LINUX`, `SUSE`, `UBUNTU`, and `WINDOWS`. The default value is `WINDOWS`. @@ -279,4 +280,4 @@ Using `terraform import`, import SSM Patch Baselines using their baseline ID. Fo % terraform import aws_ssm_patch_baseline.example pb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssm_service_setting.html.markdown b/website/docs/cdktf/typescript/r/ssm_service_setting.html.markdown index 9a60bce44d65..ba56bbb07c02 100644 --- a/website/docs/cdktf/typescript/r/ssm_service_setting.html.markdown +++ b/website/docs/cdktf/typescript/r/ssm_service_setting.html.markdown @@ -41,7 +41,7 @@ class MyConvertedCode extends TerraformStack { This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `settingId` - (Required) ID of the service setting. +* `settingId` - (Required) ID of the service setting. Valid values are shown in the [AWS documentation](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_GetServiceSetting.html#API_GetServiceSetting_RequestSyntax). * `settingValue` - (Required) Value of the service setting. ## Attribute Reference @@ -83,4 +83,4 @@ Using `terraform import`, import AWS SSM Service Setting using the `settingId`. % terraform import aws_ssm_service_setting.example arn:aws:ssm:us-east-1:123456789012:servicesetting/ssm/parameter-store/high-throughput-enabled ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/transcribe_vocabulary.html.markdown b/website/docs/cdktf/typescript/r/transcribe_vocabulary.html.markdown index 9132213556ae..03dd0e6a2f1e 100644 --- a/website/docs/cdktf/typescript/r/transcribe_vocabulary.html.markdown +++ b/website/docs/cdktf/typescript/r/transcribe_vocabulary.html.markdown @@ -65,7 +65,6 @@ class MyConvertedCode extends TerraformStack { The following arguments are required: * `languageCode` - (Required) The language code you selected for your vocabulary. -* `vocabularyFileUri` - (Required) The Amazon S3 location (URI) of the text file that contains your custom vocabulary. * `vocabularyName` - (Required) The name of the Vocabulary. The following arguments are optional: @@ -123,4 +122,4 @@ Using `terraform import`, import Transcribe Vocabulary using the `vocabularyName % terraform import aws_transcribe_vocabulary.example example-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/verifiedpermissions_policy_store.html.markdown b/website/docs/cdktf/typescript/r/verifiedpermissions_policy_store.html.markdown index 9d25c3dee0d9..33bb4b927697 100644 --- a/website/docs/cdktf/typescript/r/verifiedpermissions_policy_store.html.markdown +++ b/website/docs/cdktf/typescript/r/verifiedpermissions_policy_store.html.markdown @@ -50,6 +50,7 @@ The following arguments are required: The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `deletionProtection` - (Optional) Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. Valid Values: `ENABLED`, `DISABLED`. Default value: `DISABLED`. * `description` - (Optional) A description of the Policy Store. * `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -93,4 +94,4 @@ Using `terraform import`, import Verified Permissions Policy Store using the `po % terraform import aws_verifiedpermissions_policy_store.example DxQg2j8xvXJQ1tQCYNWj9T ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/wafv2_regex_pattern_set.html.markdown b/website/docs/cdktf/typescript/r/wafv2_regex_pattern_set.html.markdown index 364ca0a7a66f..4656a8043d08 100644 --- a/website/docs/cdktf/typescript/r/wafv2_regex_pattern_set.html.markdown +++ b/website/docs/cdktf/typescript/r/wafv2_regex_pattern_set.html.markdown @@ -57,7 +57,7 @@ This resource supports the following arguments: * `namePrefix` - (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `name`. * `description` - (Optional) A friendly description of the regular expression pattern set. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. -* `regularExpression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. A maximum of 10 `regularExpression` blocks may be specified. +* `regularExpression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. * `tags` - (Optional) An array of key:value pairs to associate with the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### Regular Expression @@ -104,4 +104,4 @@ Using `terraform import`, import WAFv2 Regex Pattern Sets using `ID/name/scope`. % terraform import aws_wafv2_regex_pattern_set.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/wafv2_web_acl.html.markdown b/website/docs/cdktf/typescript/r/wafv2_web_acl.html.markdown index 042fc12d63ec..371ec32882ba 100644 --- a/website/docs/cdktf/typescript/r/wafv2_web_acl.html.markdown +++ b/website/docs/cdktf/typescript/r/wafv2_web_acl.html.markdown @@ -14,6 +14,8 @@ Creates a WAFv2 Web ACL resource. ~> **Note** In `fieldToMatch` blocks, _e.g._, in `byteMatchStatement`, the `body` block includes an optional argument `oversizeHandling`. AWS indicates this argument will be required starting February 2023. To avoid configurations breaking when that change happens, treat the `oversizeHandling` argument as **required** as soon as possible. +!> **Warning:** If you use the `aws_wafv2_web_acl_rule_group_association` resource to associate rule groups with this Web ACL, you must add `lifecycle { ignore_changes = [rule] }` to this resource to prevent configuration drift. The association resource modifies the Web ACL's rules outside of this resource's direct management. + ## Example Usage This resource is based on `aws_wafv2_rule_group`, check the documentation of the `aws_wafv2_rule_group` resource to see examples of the various available statements. @@ -1303,4 +1305,4 @@ Using `terraform import`, import WAFv2 Web ACLs using `ID/Name/Scope`. For examp % terraform import aws_wafv2_web_acl.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/wafv2_web_acl_rule_group_association.html.markdown b/website/docs/cdktf/typescript/r/wafv2_web_acl_rule_group_association.html.markdown new file mode 100644 index 000000000000..7598cc13ce33 --- /dev/null +++ b/website/docs/cdktf/typescript/r/wafv2_web_acl_rule_group_association.html.markdown @@ -0,0 +1,663 @@ +--- +subcategory: "WAF" +layout: "aws" +page_title: "AWS: aws_wafv2_web_acl_rule_group_association" +description: |- + Associates a WAFv2 Rule Group with a Web ACL by adding a rule that references the Rule Group. +--- + + + +# Resource: aws_wafv2_web_acl_rule_group_association + +Associates a WAFv2 Rule Group (custom or managed) with a Web ACL by adding a rule that references the Rule Group. Use this resource to apply the rules defined in a Rule Group to a Web ACL without duplicating rule definitions. + +This resource supports both: + +- **Custom Rule Groups**: User-created rule groups that you manage within your AWS account +- **Managed Rule Groups**: Pre-configured rule groups provided by AWS or third-party vendors + +!> **Warning:** Verify the rule names in your `ruleActionOverride`s carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. + +!> **Warning:** Using this resource will cause the associated Web ACL resource to show configuration drift in the `rule` argument unless you add `lifecycle { ignore_changes = [rule] }` to the Web ACL resource configuration. This is because this resource modifies the Web ACL's rules outside of the Web ACL resource's direct management. + +~> **Note:** This resource creates a rule within the Web ACL that references the entire Rule Group. The rule group's individual rules are evaluated as a unit when requests are processed by the Web ACL. + +## Example Usage + +### Custom Rule Group - Basic Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2RuleGroup } from "./.gen/providers/aws/wafv2-rule-group"; +import { Wafv2WebAcl } from "./.gen/providers/aws/wafv2-web-acl"; +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Wafv2RuleGroup(this, "example", { + capacity: 10, + name: "example-rule-group", + rule: [ + { + action: { + block: {}, + }, + name: "block-suspicious-requests", + priority: 1, + statement: { + geoMatchStatement: { + countryCodes: ["CN", "RU"], + }, + }, + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "block-suspicious-requests", + sampledRequestsEnabled: true, + }, + }, + ], + scope: "REGIONAL", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "example-rule-group", + sampledRequestsEnabled: true, + }, + }); + const awsWafv2WebAclExample = new Wafv2WebAcl(this, "example_1", { + defaultAction: { + allow: {}, + }, + lifecycle: { + ignoreChanges: [rule], + }, + name: "example-web-acl", + scope: "REGIONAL", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "example-web-acl", + sampledRequestsEnabled: true, + }, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclExample.overrideLogicalId("example"); + const awsWafv2WebAclRuleGroupAssociationExample = + new Wafv2WebAclRuleGroupAssociation(this, "example_2", { + priority: 100, + ruleGroupReference: [ + { + arn: example.arn, + }, + ], + ruleName: "example-rule-group-rule", + webAclArn: Token.asString(awsWafv2WebAclExample.arn), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclRuleGroupAssociationExample.overrideLogicalId("example"); + } +} + +``` + +### Managed Rule Group - Basic Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAcl } from "./.gen/providers/aws/wafv2-web-acl"; +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Wafv2WebAcl(this, "example", { + defaultAction: { + allow: {}, + }, + lifecycle: { + ignoreChanges: [rule], + }, + name: "example-web-acl", + scope: "REGIONAL", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "example-web-acl", + sampledRequestsEnabled: true, + }, + }); + new Wafv2WebAclRuleGroupAssociation(this, "managed_example", { + managedRuleGroup: [ + { + name: "AWSManagedRulesCommonRuleSet", + vendorName: "AWS", + }, + ], + priority: 50, + ruleName: "aws-common-rule-set", + webAclArn: example.arn, + }); + } +} + +``` + +### Managed Rule Group - With Version + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Wafv2WebAclRuleGroupAssociation(this, "managed_versioned", { + managedRuleGroup: [ + { + name: "AWSManagedRulesCommonRuleSet", + vendorName: "AWS", + version: "Version_1.0", + }, + ], + priority: 60, + ruleName: "aws-common-rule-set-versioned", + webAclArn: example.arn, + }); + } +} + +``` + +### Managed Rule Group - With Rule Action Overrides + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Wafv2WebAclRuleGroupAssociation(this, "managed_with_overrides", { + managedRuleGroup: [ + { + name: "AWSManagedRulesCommonRuleSet", + ruleActionOverride: [ + { + actionToUse: [ + { + count: [ + { + customRequestHandling: [ + { + insertHeader: [ + { + name: "X-RFI-Override", + value: "counted", + }, + ], + }, + ], + }, + ], + }, + ], + name: "GenericRFI_BODY", + }, + { + actionToUse: [ + { + captcha: [{}], + }, + ], + name: "SizeRestrictions_BODY", + }, + ], + vendorName: "AWS", + }, + ], + priority: 70, + ruleName: "aws-common-rule-set-with-overrides", + webAclArn: example.arn, + }); + } +} + +``` + +### Custom Rule Group - With Override Action + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Wafv2WebAclRuleGroupAssociation(this, "example", { + overrideAction: "count", + priority: 100, + ruleGroupReference: [ + { + arn: Token.asString(awsWafv2RuleGroupExample.arn), + }, + ], + ruleName: "example-rule-group-rule", + webAclArn: Token.asString(awsWafv2WebAclExample.arn), + }); + } +} + +``` + +### Custom Rule Group - With Rule Action Overrides + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2RuleGroup } from "./.gen/providers/aws/wafv2-rule-group"; +import { Wafv2WebAcl } from "./.gen/providers/aws/wafv2-web-acl"; +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Wafv2RuleGroup(this, "example", { + capacity: 10, + name: "example-rule-group", + rule: [ + { + action: { + block: {}, + }, + name: "geo-block-rule", + priority: 1, + statement: { + geoMatchStatement: { + countryCodes: ["CN", "RU"], + }, + }, + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "geo-block-rule", + sampledRequestsEnabled: true, + }, + }, + { + action: { + block: {}, + }, + name: "rate-limit-rule", + priority: 2, + statement: { + rateBasedStatement: { + aggregateKeyType: "IP", + limit: 1000, + }, + }, + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "rate-limit-rule", + sampledRequestsEnabled: true, + }, + }, + ], + scope: "REGIONAL", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "example-rule-group", + sampledRequestsEnabled: true, + }, + }); + const awsWafv2WebAclExample = new Wafv2WebAcl(this, "example_1", { + defaultAction: { + allow: {}, + }, + lifecycle: { + ignoreChanges: [rule], + }, + name: "example-web-acl", + scope: "REGIONAL", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "example-web-acl", + sampledRequestsEnabled: true, + }, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclExample.overrideLogicalId("example"); + const awsWafv2WebAclRuleGroupAssociationExample = + new Wafv2WebAclRuleGroupAssociation(this, "example_2", { + priority: 100, + ruleGroupReference: [ + { + arn: example.arn, + ruleActionOverride: [ + { + actionToUse: [ + { + count: [ + { + customRequestHandling: [ + { + insertHeader: [ + { + name: "X-Geo-Block-Override", + value: "counted", + }, + ], + }, + ], + }, + ], + }, + ], + name: "geo-block-rule", + }, + { + actionToUse: [ + { + captcha: [ + { + customRequestHandling: [ + { + insertHeader: [ + { + name: "X-Rate-Limit-Override", + value: "captcha-required", + }, + ], + }, + ], + }, + ], + }, + ], + name: "rate-limit-rule", + }, + ], + }, + ], + ruleName: "example-rule-group-rule", + webAclArn: Token.asString(awsWafv2WebAclExample.arn), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclRuleGroupAssociationExample.overrideLogicalId("example"); + } +} + +``` + +### Custom Rule Group - CloudFront Web ACL + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2RuleGroup } from "./.gen/providers/aws/wafv2-rule-group"; +import { Wafv2WebAcl } from "./.gen/providers/aws/wafv2-web-acl"; +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const cloudfrontExample = new Wafv2RuleGroup(this, "cloudfront_example", { + capacity: 10, + name: "cloudfront-rule-group", + rule: [ + { + action: { + block: {}, + }, + name: "rate-limit", + priority: 1, + statement: { + rateBasedStatement: { + aggregateKeyType: "IP", + limit: 2000, + }, + }, + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "rate-limit", + sampledRequestsEnabled: true, + }, + }, + ], + scope: "CLOUDFRONT", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "cloudfront-rule-group", + sampledRequestsEnabled: true, + }, + }); + const awsWafv2WebAclCloudfrontExample = new Wafv2WebAcl( + this, + "cloudfront_example_1", + { + defaultAction: { + allow: {}, + }, + lifecycle: { + ignoreChanges: [rule], + }, + name: "cloudfront-web-acl", + scope: "CLOUDFRONT", + visibilityConfig: { + cloudwatchMetricsEnabled: true, + metricName: "cloudfront-web-acl", + sampledRequestsEnabled: true, + }, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclCloudfrontExample.overrideLogicalId("cloudfront_example"); + const awsWafv2WebAclRuleGroupAssociationCloudfrontExample = + new Wafv2WebAclRuleGroupAssociation(this, "cloudfront_example_2", { + priority: 50, + ruleGroupReference: [ + { + arn: cloudfrontExample.arn, + }, + ], + ruleName: "cloudfront-rule-group-rule", + webAclArn: Token.asString(awsWafv2WebAclCloudfrontExample.arn), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsWafv2WebAclRuleGroupAssociationCloudfrontExample.overrideLogicalId( + "cloudfront_example" + ); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `ruleName` - (Required) Name of the rule to create in the Web ACL that references the rule group. Must be between 1 and 128 characters. +* `priority` - (Required) Priority of the rule within the Web ACL. Rules are evaluated in order of priority, with lower numbers evaluated first. +* `webAclArn` - (Required) ARN of the Web ACL to associate the Rule Group with. + +The following arguments are optional: + +* `managedRuleGroup` - (Optional) Managed Rule Group configuration. One of `ruleGroupReference` or `managedRuleGroup` is required. Conflicts with `ruleGroupReference`. [See below](#managed_rule_group). +* `overrideAction` - (Optional) Override action for the rule group. Valid values are `none` and `count`. Defaults to `none`. When set to `count`, the actions defined in the rule group rules are overridden to count matches instead of blocking or allowing requests. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `ruleGroupReference` - (Optional) Custom Rule Group reference configuration. One of `ruleGroupReference` or `managedRuleGroup` is required. Conflicts with `managedRuleGroup`. [See below](#rule_group_reference). + +### rule_group_reference + +* `arn` - (Required) ARN of the Rule Group to associate with the Web ACL. +* `ruleActionOverride` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### managed_rule_group + +* `name` - (Required) Name of the managed rule group. +* `vendorName` - (Required) Name of the managed rule group vendor. For AWS managed rule groups, this is `AWS`. +* `version` - (Optional) Version of the managed rule group. If not specified, the default version is used. +* `ruleActionOverride` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### rule_action_override + +* `name` - (Required) Name of the rule to override within the rule group. Verify the name carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. +* `actionToUse` - (Required) Action to use instead of the rule's original action. [See below](#action_to_use). + +### action_to_use + +Exactly one of the following action blocks must be specified: + +* `allow` - (Optional) Allow the request. [See below](#allow). +* `block` - (Optional) Block the request. [See below](#block). +* `captcha` - (Optional) Require CAPTCHA verification. [See below](#captcha). +* `challenge` - (Optional) Require challenge verification. [See below](#challenge). +* `count` - (Optional) Count the request without taking action. [See below](#count). + +### allow + +* `customRequestHandling` - (Optional) Custom handling for allowed requests. [See below](#custom_request_handling). + +### block + +* `customResponse` - (Optional) Custom response for blocked requests. [See below](#custom_response). + +### captcha + +* `customRequestHandling` - (Optional) Custom handling for CAPTCHA requests. [See below](#custom_request_handling). + +### challenge + +* `customRequestHandling` - (Optional) Custom handling for challenge requests. [See below](#custom_request_handling). + +### count + +* `customRequestHandling` - (Optional) Custom handling for counted requests. [See below](#custom_request_handling). + +### custom_request_handling + +* `insertHeader` - (Required) Headers to insert into the request. [See below](#insert_header). + +### custom_response + +* `customResponseBodyKey` - (Optional) Key of a custom response body to use. +* `responseCode` - (Required) HTTP response code to return (200-599). +* `responseHeader` - (Optional) Headers to include in the response. [See below](#response_header). + +### insert_header + +* `name` - (Required) Name of the header to insert. +* `value` - (Required) Value of the header to insert. + +### response_header + +* `name` - (Required) Name of the response header. +* `value` - (Required) Value of the response header. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +None. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `update` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + Wafv2WebAclRuleGroupAssociation.generateConfigForImport( + this, + "example", + "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule" + ); + } +} + +``` + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Wafv2WebAclRuleGroupAssociation } from "./.gen/providers/aws/wafv2-web-acl-rule-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + Wafv2WebAclRuleGroupAssociation.generateConfigForImport( + this, + "managedExample", + "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set" + ); + } +} + +``` + +Using `terraform import`, import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule" +``` + +Using `terraform import`, import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.managed_example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set" +``` + + \ No newline at end of file diff --git a/website/docs/d/ecr_repository.html.markdown b/website/docs/d/ecr_repository.html.markdown index 8b42b6122ca6..e6bcc7efce5e 100644 --- a/website/docs/d/ecr_repository.html.markdown +++ b/website/docs/d/ecr_repository.html.markdown @@ -34,6 +34,7 @@ This data source exports the following attributes in addition to the arguments a * `encryption_configuration` - Encryption configuration for the repository. See [Encryption Configuration](#encryption-configuration) below. * `image_scanning_configuration` - Configuration block that defines image scanning configuration for the repository. See [Image Scanning Configuration](#image-scanning-configuration) below. * `image_tag_mutability` - The tag mutability setting for the repository. +* `image_tag_mutability_exclusion_filter` - Block that defines filters to specify which image tags can override the default tag mutability setting. * `most_recent_image_tags` - List of image tags associated with the most recently pushed image in the repository. * `repository_url` - URL of the repository (in the form `aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName`). * `tags` - Map of tags assigned to the resource. @@ -43,6 +44,11 @@ This data source exports the following attributes in addition to the arguments a * `encryption_type` - Encryption type to use for the repository, either `AES256` or `KMS`. * `kms_key` - If `encryption_type` is `KMS`, the ARN of the KMS key used. +### Image Tag Mutability Exclusion Filter + +* `filter` - The filter pattern to use for excluding image tags from the mutability setting. +* `filter_type` - The type of filter to use. + ### Image Scanning Configuration * `scan_on_push` - Whether images are scanned after being pushed to the repository. diff --git a/website/docs/d/ecr_repository_creation_template.html.markdown b/website/docs/d/ecr_repository_creation_template.html.markdown index 7a66b35c3346..9a984d8653aa 100644 --- a/website/docs/d/ecr_repository_creation_template.html.markdown +++ b/website/docs/d/ecr_repository_creation_template.html.markdown @@ -34,6 +34,7 @@ This data source exports the following attributes in addition to the arguments a * `description` - The description for this template. * `encryption_configuration` - Encryption configuration for any created repositories. See [Encryption Configuration](#encryption-configuration) below. * `image_tag_mutability` - The tag mutability setting for any created repositories. +* `image_tag_mutability_exclusion_filter` - Block that defines filters to specify which image tags can override the default tag mutability setting. * `lifecycle_policy` - The lifecycle policy document to apply to any created repositories. * `registry_id` - The registry ID the repository creation template applies to. * `repository_policy` - The registry policy document to apply to any created repositories. @@ -43,3 +44,8 @@ This data source exports the following attributes in addition to the arguments a * `encryption_type` - Encryption type to use for any created repositories, either `AES256` or `KMS`. * `kms_key` - If `encryption_type` is `KMS`, the ARN of the KMS key used. + +### Image Tag Mutability Exclusion Filter + +* `filter` - The filter pattern to use for excluding image tags from the mutability setting. +* `filter_type` - The type of filter to use. diff --git a/website/docs/d/eks_cluster.html.markdown b/website/docs/d/eks_cluster.html.markdown index f270a5e54d6a..57234661b176 100644 --- a/website/docs/d/eks_cluster.html.markdown +++ b/website/docs/d/eks_cluster.html.markdown @@ -50,6 +50,7 @@ This data source exports the following attributes in addition to the arguments a * `data` - The base64 encoded certificate data required to communicate with your cluster. Add this to the `certificate-authority-data` section of the `kubeconfig` file for your cluster. * `cluster_id` - The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. * `created_at` - Unix epoch time stamp in seconds for when the cluster was created. +* `deletion_protection` - Whether deletion protection for the cluster is enabled. * `enabled_cluster_log_types` - The enabled control plane logs. * `endpoint` - Endpoint for your Kubernetes API server. * `identity` - Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the [`aws_eks_cluster` resource documentation](/docs/providers/aws/r/eks_cluster.html). diff --git a/website/docs/d/eks_cluster_versions.html.markdown b/website/docs/d/eks_cluster_versions.html.markdown index 7a9a17f39a36..f363e7c612ec 100644 --- a/website/docs/d/eks_cluster_versions.html.markdown +++ b/website/docs/d/eks_cluster_versions.html.markdown @@ -16,6 +16,18 @@ Terraform data source for managing AWS EKS (Elastic Kubernetes) Cluster Versions ```terraform data "aws_eks_cluster_versions" "example" {} + +output "eks_cluster_versions" { + value = data.aws_eks_cluster_versions.example.cluster_versions +} + +output "eks_cluster_version_filtered" { + value = [for version in data.aws_eks_cluster_versions.example.cluster_versions : version if version.cluster_version == "1.33"] +} + +output "eks_cluster_version_list" { + value = [for version in data.aws_eks_cluster_versions.example.cluster_versions : version.cluster_version] +} ``` ### Filter by Cluster Type @@ -41,7 +53,6 @@ The following arguments are optional: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `cluster_type` - (Optional) Type of clusters to filter by. Currently, the only valid value is `eks`. -* `cluster_versions` - (Optional) A list of Kubernetes versions that you can use to check if EKS supports it. * `default_only` - (Optional) Whether to show only the default versions of Kubernetes supported by EKS. * `include_all` - (Optional) Whether to include all kubernetes versions in the response. * `version_status` - (Optional) Status of the EKS cluster versions to list. @@ -51,12 +62,13 @@ Valid values are `STANDARD_SUPPORT` or `UNSUPPORTED` or `EXTENDED_SUPPORT`. This data source exports the following attributes in addition to the arguments above: -* `cluster_type` - Type of cluster that the version belongs to. -* `cluster_version` - Kubernetes version supported by EKS. -* `default_platform_version` - Default eks platform version for the cluster version. -* `default_version` - Default Kubernetes version for the cluster version. -* `end_of_extended_support_date` - End of extended support date for the cluster version. -* `end_of_standard_support_date` - End of standard support date for the cluster version. -* `kubernetes_patch_version` - Kubernetes patch version for the cluster version. -* `release_date` - Release date of the cluster version. -* `version_status` - Status of the EKS cluster version. +* `cluster_versions` - A list of Kubernetes version information. + * `cluster_type` - Type of cluster that the version belongs to. + * `cluster_version` - Kubernetes version supported by EKS. + * `default_platform_version` - Default eks platform version for the cluster version. + * `default_version` - Default Kubernetes version for the cluster version. + * `end_of_extended_support_date` - End of extended support date for the cluster version. + * `end_of_standard_support_date` - End of standard support date for the cluster version. + * `kubernetes_patch_version` - Kubernetes patch version for the cluster version. + * `release_date` - Release date of the cluster version. + * `version_status` - Status of the EKS cluster version. diff --git a/website/docs/d/quicksight_analysis.html.markdown b/website/docs/d/quicksight_analysis.html.markdown index 0ba1c342ed68..19ded3ac070c 100644 --- a/website/docs/d/quicksight_analysis.html.markdown +++ b/website/docs/d/quicksight_analysis.html.markdown @@ -24,9 +24,9 @@ data "aws_quicksight_analysis" "example" { This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `analysis_id` - (Required) Identifier for the analysis. -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference diff --git a/website/docs/d/quicksight_data_set.html.markdown b/website/docs/d/quicksight_data_set.html.markdown index fce943b46428..81f870982808 100644 --- a/website/docs/d/quicksight_data_set.html.markdown +++ b/website/docs/d/quicksight_data_set.html.markdown @@ -24,9 +24,9 @@ data "aws_quicksight_data_set" "example" { This data source supports the following arguments: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `data_set_id` - (Required) Identifier for the data set. -* `aws_account_id` - (Optional) AWS account ID. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference diff --git a/website/docs/d/quicksight_group.html.markdown b/website/docs/d/quicksight_group.html.markdown index 5be1cc4e9bf3..27f064df37ae 100644 --- a/website/docs/d/quicksight_group.html.markdown +++ b/website/docs/d/quicksight_group.html.markdown @@ -30,9 +30,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference diff --git a/website/docs/d/quicksight_theme.html.markdown b/website/docs/d/quicksight_theme.html.markdown index 732b934e848f..75b4d736b389 100644 --- a/website/docs/d/quicksight_theme.html.markdown +++ b/website/docs/d/quicksight_theme.html.markdown @@ -28,8 +28,8 @@ The following arguments are required: The following arguments are optional: +* `aws_account_id` - AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - AWS account ID. ## Attribute Reference diff --git a/website/docs/d/quicksight_user.html.markdown b/website/docs/d/quicksight_user.html.markdown index 526f8d56bcdb..aec9e82c9579 100644 --- a/website/docs/d/quicksight_user.html.markdown +++ b/website/docs/d/quicksight_user.html.markdown @@ -30,9 +30,9 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `aws_account_id` - (Optional) AWS account ID. +* `aws_account_id` - (Optional) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. * `namespace` - (Optional) QuickSight namespace. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). ## Attribute Reference @@ -40,6 +40,7 @@ This data source exports the following attributes in addition to the arguments a * `active` - The active status of user. When you create an Amazon QuickSight user that’s not an IAM user or an Active Directory user, that user is inactive until they sign in and provide a password. * `arn` - The Amazon Resource Name (ARN) for the user. +* `custom_permissions_name` - The custom permissions profile associated with this user. * `email` - The user's email address. * `identity_type` - The type of identity authentication used by the user. * `principal_id` - The principal ID of the user. diff --git a/website/docs/d/ram_resource_share.html.markdown b/website/docs/d/ram_resource_share.html.markdown index 8a310e31297c..b00590488668 100644 --- a/website/docs/d/ram_resource_share.html.markdown +++ b/website/docs/d/ram_resource_share.html.markdown @@ -39,7 +39,7 @@ This data source supports the following arguments: * `name` - (Optional) Name of the resource share to retrieve. * `resource_owner` (Required) Owner of the resource share. Valid values are `SELF` or `OTHER-ACCOUNTS`. * `resource_share_status` (Optional) Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are `PENDING`, `ACTIVE`, `FAILED`, `DELETING`, and `DELETED`. -* `filter` - (Optional) Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html). +* `filter` - (Optional) Filter used to scope the list of owned shares e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html). * `name` - (Required) Name of the tag key to filter on. * `values` - (Required) Value of the tag key. diff --git a/website/docs/d/s3_access_point.html.markdown b/website/docs/d/s3_access_point.html.markdown index 5295c67fb5db..a0c4c98e3925 100644 --- a/website/docs/d/s3_access_point.html.markdown +++ b/website/docs/d/s3_access_point.html.markdown @@ -43,5 +43,6 @@ This data source exports the following attributes in addition to the arguments a * `block_public_policy` - Whether Amazon S3 blocks public bucket policies for buckets in this account. * `ignore_public_acls` - Whether Amazon S3 ignores public ACLs for buckets in this account. * `restrict_public_buckets` - Whether Amazon S3 restricts public bucket policies for buckets in this account. +* `tags` - Tags assigned to the access point. * `vpc_configuration` - VPC configuration for the access point. * `vpc_id` - Access point will only allow connections from this VPC. diff --git a/website/docs/d/wafv2_web_acl.html.markdown b/website/docs/d/wafv2_web_acl.html.markdown index e7818cad9a91..563337705f42 100644 --- a/website/docs/d/wafv2_web_acl.html.markdown +++ b/website/docs/d/wafv2_web_acl.html.markdown @@ -12,6 +12,8 @@ Retrieves the summary of a WAFv2 Web ACL. ## Example Usage +### Lookup by name + ```terraform data "aws_wafv2_web_acl" "example" { name = "some-web-acl" @@ -19,12 +21,27 @@ data "aws_wafv2_web_acl" "example" { } ``` +### Lookup by associated resource + +```terraform +data "aws_wafv2_web_acl" "alb_example" { + resource_arn = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx" + scope = "REGIONAL" +} + +data "aws_wafv2_web_acl" "cloudfront_example" { + resource_arn = "arn:aws:cloudfront::123456789012:distribution/XXX" + scope = "CLOUDFRONT" +} +``` + ## Argument Reference This data source supports the following arguments: +* `name` - (Optional) Name of the WAFv2 Web ACL. Exactly one of `name` or `resource_arn` must be specified. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `name` - (Required) Name of the WAFv2 Web ACL. +* `resource_arn` - (Optional) ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of `name` or `resource_arn` must be specified. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. ## Attribute Reference diff --git a/website/docs/guides/custom-service-endpoints.html.markdown b/website/docs/guides/custom-service-endpoints.html.markdown index 1bc7580337e4..0c39dbc8bbe1 100644 --- a/website/docs/guides/custom-service-endpoints.html.markdown +++ b/website/docs/guides/custom-service-endpoints.html.markdown @@ -111,6 +111,7 @@ provider "aws" { |BCM Data Exports|`bcmdataexports`|`AWS_ENDPOINT_URL_BCM_DATA_EXPORTS`|`bcm_data_exports`| |Bedrock|`bedrock`|`AWS_ENDPOINT_URL_BEDROCK`|`bedrock`| |Bedrock Agents|`bedrockagent`|`AWS_ENDPOINT_URL_BEDROCK_AGENT`|`bedrock_agent`| +|Bedrock AgentCore|`bedrockagentcore`|`AWS_ENDPOINT_URL_BEDROCK_AGENTCORE_CONTROL`|`bedrock_agentcore_control`| |Billing|`billing`|`AWS_ENDPOINT_URL_BILLING`|`billing`| |Web Services Budgets|`budgets`|`AWS_ENDPOINT_URL_BUDGETS`|`budgets`| |CE (Cost Explorer)|`ce`(or `costexplorer`)|`AWS_ENDPOINT_URL_COST_EXPLORER`|`cost_explorer`| @@ -250,6 +251,7 @@ provider "aws" { |User Notifications|`notifications`|`AWS_ENDPOINT_URL_NOTIFICATIONS`|`notifications`| |User Notifications Contacts|`notificationscontacts`|`AWS_ENDPOINT_URL_NOTIFICATIONSCONTACTS`|`notificationscontacts`| |CloudWatch Observability Access Manager|`oam`(or `cloudwatchobservabilityaccessmanager`)|`AWS_ENDPOINT_URL_OAM`|`oam`| +|Oracle Database@AWS|`odb`|`AWS_ENDPOINT_URL_ODB`|`odb`| |OpenSearch|`opensearch`(or `opensearchservice`)|`AWS_ENDPOINT_URL_OPENSEARCH`|`opensearch`| |OpenSearch Serverless|`opensearchserverless`|`AWS_ENDPOINT_URL_OPENSEARCHSERVERLESS`|`opensearchserverless`| |Organizations|`organizations`|`AWS_ENDPOINT_URL_ORGANIZATIONS`|`organizations`| @@ -289,6 +291,7 @@ provider "aws" { |S3 Control|`s3control`|`AWS_ENDPOINT_URL_S3_CONTROL`|`s3_control`| |S3 on Outposts|`s3outposts`|`AWS_ENDPOINT_URL_S3OUTPOSTS`|`s3outposts`| |S3 Tables|`s3tables`|`AWS_ENDPOINT_URL_S3TABLES`|`s3tables`| +|S3 Vectors|`s3vectors`|`AWS_ENDPOINT_URL_S3VECTORS`|`s3vectors`| |SageMaker AI|`sagemaker`|`AWS_ENDPOINT_URL_SAGEMAKER`|`sagemaker`| |EventBridge Scheduler|`scheduler`|`AWS_ENDPOINT_URL_SCHEDULER`|`scheduler`| |EventBridge Schemas|`schemas`|`AWS_ENDPOINT_URL_SCHEMAS`|`schemas`| diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index a4d0e19b382b..10371e006f17 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -7,18 +7,13 @@ description: |- # AWS Provider -Use the Amazon Web Services (AWS) provider to interact with the -many resources supported by AWS. You must configure the provider -with the proper credentials before you can use it. +The Amazon Web Services (AWS) provider is Terraform’s most widely-used provider and the industry-standard way to manage AWS infrastructure as code. It is an indispensable part of how leading technology companies, global banks, government agencies, and some of the largest enterprises in the world build and operate in the cloud. Every day, it provisions and orchestrates billions of dollars of AWS infrastructure across thousands of organizations. -Use the navigation to the left to read about the available resources. There are currently 1514 resources and 609 data sources available in the provider. +With 1,514 resources and 609 data sources, the AWS provider spans the full breadth of AWS services—from foundational capabilities like compute, storage, networking, and identity management to advanced services for AI, analytics, and event-driven architectures, including Lambda, RDS, SageMaker, and Bedrock. Whether automating a single S3 bucket or orchestrating a multi-region, enterprise-scale environment, the provider delivers consistent, reliable workflows that scale with your needs. -To learn the basics of Terraform using this provider, follow the -hands-on [get started tutorials](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code?in=terraform/aws-get-started&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). Interact with AWS services, -including Lambda, RDS, and IAM by following the [AWS services -tutorials](https://developer.hashicorp.com/terraform/tutorials/aws?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). +Configure the provider with your AWS credentials, and you can immediately begin creating and managing infrastructure in a safe, repeatable way. Use the navigation on the left to explore the available resources, or start with our [Get Started tutorials](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code?in=terraform/aws-get-started&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) to learn the fundamentals. For deeper guidance on specific AWS services, visit the [AWS services tutorials](https://developer.hashicorp.com/terraform/tutorials/aws?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). -Some AWS services do not support IPv6. As a result, the provider may not be able to interact with AWS APIs using IPv6 addresses. +Note: Some AWS services do not yet support IPv6. In those cases, the provider may not be able to connect to AWS APIs over IPv6 addresses. ## Example Usage diff --git a/website/docs/r/appsync_api.html.markdown b/website/docs/r/appsync_api.html.markdown new file mode 100644 index 000000000000..bdbd1e030c92 --- /dev/null +++ b/website/docs/r/appsync_api.html.markdown @@ -0,0 +1,202 @@ +--- +subcategory: "AppSync" +layout: "aws" +page_title: "AWS: aws_appsync_api" +description: |- + Manages an AWS AppSync Event API. +--- + +# Resource: aws_appsync_api + +Manages an [AWS AppSync Event API](https://docs.aws.amazon.com/appsync/latest/eventapi/event-api-concepts.html#API). Event APIs enable real-time subscriptions and event-driven communication in AppSync applications. + +## Example Usage + +### Basic Usage + +```terraform +resource "aws_appsync_api" "example" { + name = "example-event-api" + + event_config { + auth_provider { + auth_type = "API_KEY" + } + + connection_auth_mode { + auth_type = "API_KEY" + } + + default_publish_auth_mode { + auth_type = "API_KEY" + } + + default_subscribe_auth_mode { + auth_type = "API_KEY" + } + } +} +``` + +### With Cognito Authentication + +```terraform +resource "aws_cognito_user_pool" "example" { + name = "example-user-pool" +} + +resource "aws_appsync_api" "example" { + name = "example-event-api" + + event_config { + auth_provider { + auth_type = "AMAZON_COGNITO_USER_POOLS" + cognito_config { + user_pool_id = aws_cognito_user_pool.example.id + aws_region = data.aws_region.current.name + } + } + + connection_auth_mode { + auth_type = "AMAZON_COGNITO_USER_POOLS" + } + + default_publish_auth_mode { + auth_type = "AMAZON_COGNITO_USER_POOLS" + } + + default_subscribe_auth_mode { + auth_type = "AMAZON_COGNITO_USER_POOLS" + } + } +} + +data "aws_region" "current" {} +``` + +### With Lambda Authorizer + +```terraform +resource "aws_appsync_api" "example" { + name = "example-event-api" + + event_config { + auth_provider { + auth_type = "AWS_LAMBDA" + lambda_authorizer_config { + authorizer_uri = aws_lambda_function.example.invoke_arn + authorizer_result_ttl_in_seconds = 300 + } + } + + connection_auth_mode { + auth_type = "AWS_LAMBDA" + } + + default_publish_auth_mode { + auth_type = "AWS_LAMBDA" + } + + default_subscribe_auth_mode { + auth_type = "AWS_LAMBDA" + } + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `event_config` - (Required) Configuration for the Event API. See [Event Config](#event-config) below. +* `name` - (Required) Name of the Event API. + +The following arguments are optional: + +* `owner_contact` - (Optional) Contact information for the owner of the Event API. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Event Config + +The `event_config` block supports the following: + +* `auth_provider` - (Required) List of authentication providers. See [Auth Providers](#auth-providers) below. +* `connection_auth_mode` - (Required) List of authentication modes for connections. See [Auth Modes](#auth-modes) below. +* `default_publish_auth_mode` - (Required) List of default authentication modes for publishing. See [Auth Modes](#auth-modes) below. +* `default_subscribe_auth_mode` - (Required) List of default authentication modes for subscribing. See [Auth Modes](#auth-modes) below. +* `log_config` - (Optional) Logging configuration. See [Log Config](#log-config) below. + +### Auth Providers + +The `auth_provider` block supports the following: + +* `auth_type` - (Required) Type of authentication provider. Valid values: `AMAZON_COGNITO_USER_POOLS`, `AWS_LAMBDA`, `OPENID_CONNECT`, `API_KEY`. +* `cognito_config` - (Optional) Configuration for Cognito user pool authentication. Required when `auth_type` is `AMAZON_COGNITO_USER_POOLS`. See [Cognito Config](#cognito-config) below. +* `lambda_authorizer_config` - (Optional) Configuration for Lambda authorization. Required when `auth_type` is `AWS_LAMBDA`. See [Lambda Authorizer Config](#lambda-authorizer-config) below. +* `openid_connect_config` - (Optional) Configuration for OpenID Connect. Required when `auth_type` is `OPENID_CONNECT`. See [OpenID Connect Config](#openid-connect-config) below. + +### Cognito Config + +The `cognito_config` block supports the following: + +* `app_id_client_regex` - (Optional) Regular expression for matching the client ID. +* `aws_region` - (Required) AWS region where the user pool is located. +* `user_pool_id` - (Required) ID of the Cognito user pool. + +### Lambda Authorizer Config + +The `lambda_authorizer_config` block supports the following: + +* `authorizer_result_ttl_in_seconds` - (Optional) TTL in seconds for the authorization result cache. +* `authorizer_uri` - (Required) URI of the Lambda function for authorization. +* `identity_validation_expression` - (Optional) Regular expression for identity validation. + +### OpenID Connect Config + +The `openid_connect_config` block supports the following: + +* `auth_ttl` - (Optional) TTL in seconds for the authentication token. +* `client_id` - (Optional) Client ID for the OpenID Connect provider. +* `iat_ttl` - (Optional) TTL in seconds for the issued at time. +* `issuer` - (Required) Issuer URL for the OpenID Connect provider. + +### Auth Modes + +The `connection_auth_mode`, `default_publish_auth_mode`, and `default_subscribe_auth_mode` blocks support the following: + +* `auth_type` - (Required) Type of authentication. Valid values: `API_KEY`, `AWS_IAM`, `AMAZON_COGNITO_USER_POOLS`, `OPENID_CONNECT`, `AWS_LAMBDA`. + +### Log Config + +The `log_config` block supports the following: + +* `cloudwatch_logs_role_arn` - (Required) ARN of the IAM role for CloudWatch logs. +* `log_level` - (Required) Log level. Valid values: `NONE`, `ERROR`, `ALL`, `INFO`, `DEBUG`. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `api_id` - ID of the Event API. +* `api_arn` - ARN of the Event API. +* `dns` - DNS configuration for the Event API. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `waf_web_acl_arn` - ARN of the associated WAF web ACL. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Event API using the `api_id`. For example: + +```terraform +import { + to = aws_appsync_api.example + id = "example-api-id" +} +``` + +Using `terraform import`, import AppSync Event API using the `api_id`. For example: + +```console +% terraform import aws_appsync_api.example example-api-id +``` diff --git a/website/docs/r/appsync_channel_namespace.html.markdown b/website/docs/r/appsync_channel_namespace.html.markdown new file mode 100644 index 000000000000..6b8ad380738f --- /dev/null +++ b/website/docs/r/appsync_channel_namespace.html.markdown @@ -0,0 +1,95 @@ +--- +subcategory: "AppSync" +layout: "aws" +page_title: "AWS: aws_appsync_channel_namespace" +description: |- + Manages an AWS AppSync Channel Namespace. +--- + +# Resource: aws_appsync_channel_namespace + +Manages an [AWS AppSync Channel Namespace](https://docs.aws.amazon.com/appsync/latest/eventapi/event-api-concepts.html#namespace). + +## Example Usage + +### Basic Usage + +```terraform +resource "aws_appsync_channel_namespace" "example" { + name = "example-channel-namespace" + api_id = aws_appsync_api.example.api_id +} +``` + +## Argument Reference + +The following arguments are required: + +* `api_id` - (Required) Event API ID. +* `name` - (Required) Name of the channel namespace. + +The following arguments are optional: + +* `code_handlers` - (Optional) Event handler functions that run custom business logic to process published events and subscribe requests. +* `handler_configs` - (Optional) Configuration for the `on_publish` and `on_subscribe` handlers. See [Handler Configs](#handler-configs) below. +* `publish_auth_mode` - (Optional) Authorization modes to use for publishing messages on the channel namespace. This configuration overrides the default API authorization configuration. See [Auth Modes](#auth-modes) below. +* `subscribe_auth_mode` - (Optional) Authorization modes to use for subscribing to messages on the channel namespace. This configuration overrides the default API authorization configuration. See [Auth Modes](#auth-modes) below. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Auth Modes + +The `publish_auth_mode`, and `subscribe_auth_mode` blocks support the following: + +* `auth_type` - (Required) Type of authentication. Valid values: `API_KEY`, `AWS_IAM`, `AMAZON_COGNITO_USER_POOLS`, `OPENID_CONNECT`, `AWS_LAMBDA`. + +### Handler Configs + +The `handler_configs` block support the following: + +* `on_publish` - (Optional) Handler configuration. See [Handler Config](#handler-config) below. +* `on_subscribe` - (Optional) Handler configuration. See [Handler Config](#handler-config) below. + +### Handler Config + +The `on_publish` and `on_subscribe` blocks support the following: + +* `behavior` - (Required) Behavior for the handler. Valid values: `CODE`, `DIRECT`. +* `integration` - (Required) Integration data source configuration for the handler. See [Integration](#integration) below. + +### Integration + +The `integration` block support the following: + +* `data_source_name` - (Required) Unique name of the data source that has been configured on the API. +* `lambda_config` - (Optional) Configuration for a Lambda data source. See [Lambda Config](#lambda-config) below. + +### Lambad Config + +The `lambda_config` block support the following: + +* `invoke_type` - (Optional) Invocation type for a Lambda data source. Valid values: `REQUEST_RESPONSE`, `EVENT`. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `channel_namespace_arn` - ARN of the channel namespace. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Channel Namespace using the `api_id` and `name` separated by a comma (`,`). For example: + +```terraform +import { + to = aws_appsync_channel_namespace.example + id = "example-api-id,example-channel-namespace" +} +``` + +Using `terraform import`, import AppSync Channel Namespace using the `api_id` and `name` separated by a comma (`,`). For example: + +```console +% terraform import aws_appsync_channel_namespace.example example-api-id,example-channel-namespace +``` diff --git a/website/docs/r/appsync_source_api_association.html.markdown b/website/docs/r/appsync_source_api_association.html.markdown index 802f6e4f5869..48847f954096 100644 --- a/website/docs/r/appsync_source_api_association.html.markdown +++ b/website/docs/r/appsync_source_api_association.html.markdown @@ -3,11 +3,11 @@ subcategory: "AppSync" layout: "aws" page_title: "AWS: aws_appsync_source_api_association" description: |- - Terraform resource for managing an AWS AppSync Source Api Association. + Terraform resource for managing an AWS AppSync Source API Association. --- # Resource: aws_appsync_source_api_association -Terraform resource for managing an AWS AppSync Source Api Association. +Terraform resource for managing an AWS AppSync Source API Association. ## Example Usage @@ -42,9 +42,9 @@ The `source_api_association_config` configuration block supports the following a This resource exports the following attributes in addition to the arguments above: -* `arn` - ARN of the Source Api Association. -* `association_id` - ID of the Source Api Association. -* `id` - Combined ID of the Source Api Association and Merge Api. +* `arn` - ARN of the Source API Association. +* `association_id` - ID of the Source API Association. +* `id` - Combined ID of the Source API Association and Merge API. ## Timeouts @@ -56,7 +56,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source Api Association using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppSync Source API Association using the `association_id` and `merged_api_id` separated by `,`. For example: ```terraform import { @@ -65,7 +65,7 @@ import { } ``` -Using `terraform import`, import AppSync Source Api Association using the `gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31`. For example: +Using `terraform import`, import AppSync Source API Association using the `association_id` and `merged_api_id` separated by `,`. For example: ```console % terraform import aws_appsync_source_api_association.example gzos6bteufdunffzzifiowisoe,243685a0-9347-4a1a-89c1-9b57dea01e31 diff --git a/website/docs/r/autoscaling_lifecycle_hook.html.markdown b/website/docs/r/autoscaling_lifecycle_hook.html.markdown index 3d950744e831..361b67466c53 100644 --- a/website/docs/r/autoscaling_lifecycle_hook.html.markdown +++ b/website/docs/r/autoscaling_lifecycle_hook.html.markdown @@ -65,7 +65,7 @@ This resource supports the following arguments: * `heartbeat_timeout` - (Optional) Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the DefaultResult parameter * `lifecycle_transition` - (Required) Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see [describe-lifecycle-hook-types](https://docs.aws.amazon.com/cli/latest/reference/autoscaling/describe-lifecycle-hook-types.html#examples) * `notification_metadata` - (Optional) Contains additional information that you want to include any time Auto Scaling sends a message to the notification target. -* `notification_target_arn` - (Optional) ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. +* `notification_target_arn` - (Optional) ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue, an SNS topic, or a Lambda function. * `role_arn` - (Optional) ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. ## Attribute Reference diff --git a/website/docs/r/bedrock_guardrail.html.markdown b/website/docs/r/bedrock_guardrail.html.markdown index 9fba113b093b..8d01928ef910 100644 --- a/website/docs/r/bedrock_guardrail.html.markdown +++ b/website/docs/r/bedrock_guardrail.html.markdown @@ -34,15 +34,23 @@ resource "aws_bedrock_guardrail" "example" { sensitive_information_policy_config { pii_entities_config { - action = "BLOCK" - type = "NAME" + action = "BLOCK" + input_action = "BLOCK" + output_action = "ANONYMIZE" + input_enabled = true + output_enabled = true + type = "NAME" } regexes_config { - action = "BLOCK" - description = "example regex" - name = "regex_example" - pattern = "^\\d{3}-\\d{2}-\\d{4}$" + action = "BLOCK" + input_action = "BLOCK" + output_action = "BLOCK" + input_enabled = true + output_enabled = false + description = "example regex" + name = "regex_example" + pattern = "^\\d{3}-\\d{2}-\\d{4}$" } } @@ -155,13 +163,21 @@ The `tier_config` configuration block supports the following arguments: #### PII Entities Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_action` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_enabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. +* `output_action` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `output_enabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `type` (Required) The currently supported PII entities. #### Regexes Config -* `action` (Required) Options for sensitive information action. +* `action` (Required) Options for sensitive information action. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_action` (Optional) Action to take when harmful content is detected in the input. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `input_enabled` (Optional) Whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. * `name` (Required) The regex name. +* `output_action` (Optional) Action to take when harmful content is detected in the output. Valid values: `BLOCK`, `ANONYMIZE`, `NONE`. +* `output_enabled` (Optional) Whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. * `pattern` (Required) The regex pattern. * `description` (Optional) The regex description. diff --git a/website/docs/r/bedrock_inference_profile.html.markdown b/website/docs/r/bedrock_inference_profile.html.markdown index c7fe84deea70..5ab1bdc9e701 100644 --- a/website/docs/r/bedrock_inference_profile.html.markdown +++ b/website/docs/r/bedrock_inference_profile.html.markdown @@ -79,7 +79,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Bedrock Inference Profile using the `name`. For example: ```terraform import { @@ -88,7 +88,7 @@ import { } ``` -Using `terraform import`, import Bedrock Inference Profile using the `example_id_arg`. For example: +Using `terraform import`, import Bedrock Inference Profile using the `name`. For example: ```console % terraform import aws_bedrock_inference_profile.example inference_profile-id-12345678 diff --git a/website/docs/r/cloudfront_function.html.markdown b/website/docs/r/cloudfront_function.html.markdown index f51aa9c0383e..57ae88b8c086 100644 --- a/website/docs/r/cloudfront_function.html.markdown +++ b/website/docs/r/cloudfront_function.html.markdown @@ -40,7 +40,7 @@ The following arguments are optional: * `comment` - (Optional) Comment. * `publish` - (Optional) Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`. -* `key_value_store_associations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to on key value store per function. +* `key_value_store_associations` - (Optional) List of `aws_cloudfront_key_value_store` ARNs to be associated to the function. AWS limits associations to one key value store per function. ## Attribute Reference diff --git a/website/docs/r/cloudfrontkeyvaluestore_key.html.markdown b/website/docs/r/cloudfrontkeyvaluestore_key.html.markdown index cfc452fe6f91..3b3399c9973f 100644 --- a/website/docs/r/cloudfrontkeyvaluestore_key.html.markdown +++ b/website/docs/r/cloudfrontkeyvaluestore_key.html.markdown @@ -46,7 +46,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CloudFront KeyValueStore Key using the `key_value_store_arn` and 'key' separated by `,`. For example: ```terraform import { @@ -55,7 +55,7 @@ import { } ``` -Using `terraform import`, import CloudFront KeyValueStore Key using the `id`. For example: +Using `terraform import`, import CloudFront KeyValueStore Key using the `key_value_store_arn` and 'key' separated by `,`. For example: ```console % terraform import aws_cloudfrontkeyvaluestore_key.example arn:aws:cloudfront::111111111111:key-value-store/8562g61f-caba-2845-9d99-b97diwae5d3c,someKey diff --git a/website/docs/r/cloudwatch_log_anomaly_detector.html.markdown b/website/docs/r/cloudwatch_log_anomaly_detector.html.markdown index fe702ac22b2d..5b80038b8f6c 100644 --- a/website/docs/r/cloudwatch_log_anomaly_detector.html.markdown +++ b/website/docs/r/cloudwatch_log_anomaly_detector.html.markdown @@ -66,7 +66,7 @@ import { } ``` -Using `terraform import`, import CloudWatch Log Anomaly Detector using the `example_id_arg`. For example: +Using `terraform import`, import CloudWatch Log Anomaly Detector using the `arn`. For example: ```console % terraform import aws_cloudwatch_log_anomaly_detector.example log_anomaly_detector-arn-12345678 diff --git a/website/docs/r/codebuild_project.html.markdown b/website/docs/r/codebuild_project.html.markdown index 68023663b338..027e983256a7 100755 --- a/website/docs/r/codebuild_project.html.markdown +++ b/website/docs/r/codebuild_project.html.markdown @@ -14,6 +14,8 @@ source (e.g., the "rebuild every time a code change is pushed" option in the Cod ## Example Usage +### Basic Usage + ```terraform resource "aws_s3_bucket" "example" { bucket = "example" @@ -260,6 +262,11 @@ resource "aws_codebuild_project" "project-using-github-app" { } ``` +### Runner Project + +While no special configuration is required for `aws_codebuild_project` to create a project as a Runner Project, an `aws_codebuild_webhook` resource with an appropriate `filter_group` is required. +See the [`aws_codebuild_webhook` resource documentation example](/docs/providers/aws/r/codebuild_webhook.html#for-codebuild-runner-project) for more details. + ## Argument Reference The following arguments are required: diff --git a/website/docs/r/codebuild_webhook.html.markdown b/website/docs/r/codebuild_webhook.html.markdown index 79da76f115bf..f7b06dbebbe2 100644 --- a/website/docs/r/codebuild_webhook.html.markdown +++ b/website/docs/r/codebuild_webhook.html.markdown @@ -64,6 +64,24 @@ resource "github_repository_webhook" "example" { } ``` +### For CodeBuild Runner Project + +To create a CodeBuild project as a Runner Project, the following `aws_codebuild_webhook` resource is required for the project. +See thr [AWS Documentation](https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html) for more information about CodeBuild Runner Projects. + +```terraform +resource "aws_codebuild_webhook" "example" { + project_name = aws_codebuild_project.example.name + build_type = "BUILD" + filter_group { + filter { + type = "EVENT" + pattern = "WORKFLOW_JOB_QUEUED" + } + } +} +``` + ## Argument Reference This resource supports the following arguments: diff --git a/website/docs/r/computeoptimizer_recommendation_preferences.html.markdown b/website/docs/r/computeoptimizer_recommendation_preferences.html.markdown index 7d36ebfc58b9..2d5a166f658e 100644 --- a/website/docs/r/computeoptimizer_recommendation_preferences.html.markdown +++ b/website/docs/r/computeoptimizer_recommendation_preferences.html.markdown @@ -59,7 +59,7 @@ This resource supports the following arguments: * `inferred_workload_types` - (Optional) The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`. * `look_back_period` - (Optional) The preference to control the number of days the utilization metrics of the AWS resource are analyzed. Valid values: `DAYS_14`, `DAYS_32`, `DAYS_93`. * `preferred_resource` - (Optional) The preference to control which resource type values are considered when generating rightsizing recommendations. See [Preferred Resources](#preferred-resources) below. -* `resource_type` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`. +* `resource_type` - (Required) The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`, `AuroraDBClusterStorage`. * `savings_estimation_mode` - (Optional) The status of the savings estimation mode preference. Valid values: `AfterDiscounts`, `BeforeDiscounts`. * `scope` - (Required) The scope of the recommendation preferences. See [Scope](#scope) below. * `utilization_preference` - (Optional) The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. See [Utilization Preferences](#utilization-preferences) below. diff --git a/website/docs/r/datazone_glossary.html.markdown b/website/docs/r/datazone_glossary.html.markdown index a517396c8b30..0bd7f7cd1e78 100644 --- a/website/docs/r/datazone_glossary.html.markdown +++ b/website/docs/r/datazone_glossary.html.markdown @@ -115,7 +115,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DataZone Glossary using a comma-delimited string combining the domain id, glossary id, and the id of the project it's under. For example: ```terraform import { diff --git a/website/docs/r/dlm_lifecycle_policy.html.markdown b/website/docs/r/dlm_lifecycle_policy.html.markdown index b9e439506634..564e16f5c04d 100644 --- a/website/docs/r/dlm_lifecycle_policy.html.markdown +++ b/website/docs/r/dlm_lifecycle_policy.html.markdown @@ -232,7 +232,7 @@ This resource supports the following arguments: * `action` - (Optional) The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`action` configuration](#action-arguments) block. * `event_source` - (Optional) The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the [`event_source` configuration](#event-source-arguments) block. * `resource_types` - (Optional) A list of resource types that should be targeted by the lifecycle policy. Valid values are `VOLUME` and `INSTANCE`. -* `resource_locations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If you specify `OUTPOST`, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values are `CLOUD` and `OUTPOST`. +* `resource_locations` - (Optional) The location of the resources to backup. If the source resources are located in an AWS Region, specify `CLOUD`. If the source resources are located on an Outpost in your account, specify `OUTPOST`. If the source resources are located in a Local Zone, specify `LOCAL_ZONE`. Valid values are `CLOUD`, `LOCAL_ZONE`, and `OUTPOST`. * `policy_type` - (Optional) The valid target resource types and actions a policy can manage. Specify `EBS_SNAPSHOT_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify `IMAGE_MANAGEMENT` to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify `EVENT_BASED_POLICY` to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value is `EBS_SNAPSHOT_MANAGEMENT`. * `parameters` - (Optional) A set of optional parameters for snapshot and AMI lifecycle policies. See the [`parameters` configuration](#parameters-arguments) block. * `schedule` - (Optional) See the [`schedule` configuration](#schedule-arguments) block. diff --git a/website/docs/r/docdb_cluster.html.markdown b/website/docs/r/docdb_cluster.html.markdown index 63ec86bedd4b..0e43dfb151a9 100644 --- a/website/docs/r/docdb_cluster.html.markdown +++ b/website/docs/r/docdb_cluster.html.markdown @@ -75,6 +75,7 @@ This resource supports the following arguments: Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 * `preferred_maintenance_window` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `restore_to_point_in_time` - (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. +* `serverless_v2_scaling_configuration` - (Optional) Scaling configuration of an Amazon DocumentDB Serverless cluster. See [Serverless V2 Scaling Configuration](#serverless-v2-scaling-configuration) below for details. * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false`. @@ -95,6 +96,14 @@ The `restore_to_point_in_time` block supports the following arguments: * `source_cluster_identifier` - (Required) The identifier of the source DB cluster from which to restore. Must match the identifier of an existing DB cluster. * `use_latest_restorable_time` - (Optional) A boolean value that indicates whether the DB cluster is restored from the latest backup time. Defaults to `false`. Cannot be specified with `restore_to_time`. +### Serverless V2 Scaling Configuration + +The `serverless_v2_scaling_configuration` block supports the following arguments. +Adding this block (i.e. switching to serverless) or removing it (i.e. switching from serverless) will trigger cluster replacement. + +* `max_capacity` - (Required) Maximum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 1 and 256. +* `min_capacity` - (Required) Minimum number of Amazon DocumentDB capacity units (DCUs) for an instance in an Amazon DocumentDB Serverless cluster. Valid values are multiples of 0.5 between 0.5 and 256. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: diff --git a/website/docs/r/dynamodb_resource_policy.html.markdown b/website/docs/r/dynamodb_resource_policy.html.markdown index 58b57a130156..7ef0961f209a 100644 --- a/website/docs/r/dynamodb_resource_policy.html.markdown +++ b/website/docs/r/dynamodb_resource_policy.html.markdown @@ -42,7 +42,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DynamoDB Resource Policy using the `resource_arn`. For example: ```terraform import { @@ -51,7 +51,7 @@ import { } ``` -Using `terraform import`, import DynamoDB Resource Policy using the `example_id_arg`. For example: +Using `terraform import`, import DynamoDB Resource Policy using the `resource_arn`. For example: ```console % terraform import aws_dynamodb_resource_policy.example arn:aws:dynamodb:us-east-1:1234567890:table/my-table diff --git a/website/docs/r/dynamodb_table.html.markdown b/website/docs/r/dynamodb_table.html.markdown index 9db105d0aec8..5d7fc23a7af9 100644 --- a/website/docs/r/dynamodb_table.html.markdown +++ b/website/docs/r/dynamodb_table.html.markdown @@ -297,6 +297,7 @@ The following arguments are optional: **Note:** This attribute will _not_ be populated with the ARN of _default_ keys. **Note:** Changing this value will recreate the replica. * `point_in_time_recovery` - (Optional) Whether to enable Point In Time Recovery for the replica. Default is `false`. +* `deletion_protection_enabled` - (Optional) Whether deletion protection is enabled (true) or disabled (false) on the replica. Default is `false`. * `propagate_tags` - (Optional) Whether to propagate the global table's tags to a replica. Default is `false`. Changes to tags only move in one direction: from global (source) to replica. diff --git a/website/docs/r/ebs_fast_snapshot_restore.html.markdown b/website/docs/r/ebs_fast_snapshot_restore.html.markdown index e8898ac5d37e..d92628db70b2 100644 --- a/website/docs/r/ebs_fast_snapshot_restore.html.markdown +++ b/website/docs/r/ebs_fast_snapshot_restore.html.markdown @@ -45,7 +45,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availability_zone` and `snapshot_id` separated by `,`. For example: ```terraform import { @@ -54,7 +54,7 @@ import { } ``` -Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `id`. For example: +Using `terraform import`, import EC2 (Elastic Compute Cloud) EBS Fast Snapshot Restore using the `availability_zone` and `snapshot_id` separated by `,`. For example: ```console % terraform import aws_ebs_fast_snapshot_restore.example us-west-2a,snap-abcdef123456 diff --git a/website/docs/r/ecr_repository.html.markdown b/website/docs/r/ecr_repository.html.markdown index 07704c2e4538..17d44a8be012 100644 --- a/website/docs/r/ecr_repository.html.markdown +++ b/website/docs/r/ecr_repository.html.markdown @@ -23,6 +23,25 @@ resource "aws_ecr_repository" "foo" { } ``` +### With Image Tag Mutability Exclusion + +```terraform +resource "aws_ecr_repository" "example" { + name = "example-repo" + image_tag_mutability = "IMMUTABLE_WITH_EXCLUSION" + + image_tag_mutability_exclusion_filter { + filter = "latest*" + filter_type = "WILDCARD" + } + + image_tag_mutability_exclusion_filter { + filter = "dev-*" + filter_type = "WILDCARD" + } +} +``` + ## Argument Reference This resource supports the following arguments: @@ -32,7 +51,8 @@ This resource supports the following arguments: * `encryption_configuration` - (Optional) Encryption configuration for the repository. See [below for schema](#encryption_configuration). * `force_delete` - (Optional) If `true`, will delete the repository even if it contains images. Defaults to `false`. -* `image_tag_mutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE`. Defaults to `MUTABLE`. +* `image_tag_mutability` - (Optional) The tag mutability setting for the repository. Must be one of: `MUTABLE`, `IMMUTABLE`, `IMMUTABLE_WITH_EXCLUSION`, or `MUTABLE_WITH_EXCLUSION`. Defaults to `MUTABLE`. +* `image_tag_mutability_exclusion_filter` - (Optional) Configuration block that defines filters to specify which image tags can override the default tag mutability setting. Only applicable when `image_tag_mutability` is set to `IMMUTABLE_WITH_EXCLUSION` or `MUTABLE_WITH_EXCLUSION`. See [below for schema](#image_tag_mutability_exclusion_filter). * `image_scanning_configuration` - (Optional) Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the [ECR User Guide](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) for more information about image scanning. * `scan_on_push` - (Required) Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -42,6 +62,11 @@ This resource supports the following arguments: * `encryption_type` - (Optional) The encryption type to use for the repository. Valid values are `AES256` or `KMS`. Defaults to `AES256`. * `kms_key` - (Optional) The ARN of the KMS key to use when `encryption_type` is `KMS`. If not specified, uses the default AWS managed key for ECR. +### image_tag_mutability_exclusion_filter + +* `filter` - (Required) The filter pattern to use for excluding image tags from the mutability setting. Must contain only letters, numbers, and special characters (._*-). Each filter can be up to 128 characters long and can contain a maximum of 2 wildcards (*). +* `filter_type` - (Required) The type of filter to use. Must be `WILDCARD`. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: diff --git a/website/docs/r/ecr_repository_creation_template.html.markdown b/website/docs/r/ecr_repository_creation_template.html.markdown index 5f7508c004bb..21b059546106 100644 --- a/website/docs/r/ecr_repository_creation_template.html.markdown +++ b/website/docs/r/ecr_repository_creation_template.html.markdown @@ -95,6 +95,7 @@ This resource supports the following arguments: * `description` - (Optional) The description for this template. * `encryption_configuration` - (Optional) Encryption configuration for any created repositories. See [below for schema](#encryption_configuration). * `image_tag_mutability` - (Optional) The tag mutability setting for any created repositories. Must be one of: `MUTABLE` or `IMMUTABLE`. Defaults to `MUTABLE`. +* `image_tag_mutability_exclusion_filter` - (Optional) Configuration block that defines filters to specify which image tags can override the default tag mutability setting. Only applicable when `image_tag_mutability` is set to `IMMUTABLE_WITH_EXCLUSION` or `MUTABLE_WITH_EXCLUSION`. See [below for schema](#image_tag_mutability_exclusion_filter). * `lifecycle_policy` - (Optional) The lifecycle policy document to apply to any created repositories. See more details about [Policy Parameters](http://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html#lifecycle_policy_parameters) in the official AWS docs. Consider using the [`aws_ecr_lifecycle_policy_document` data_source](/docs/providers/aws/d/ecr_lifecycle_policy_document.html) to generate/manage the JSON document used for the `lifecycle_policy` argument. * `repository_policy` - (Optional) The registry policy document to apply to any created repositories. This is a JSON formatted string. For more information about building IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). * `resource_tags` - (Optional) A map of tags to assign to any created repositories. @@ -104,6 +105,11 @@ This resource supports the following arguments: * `encryption_type` - (Optional) The encryption type to use for any created repositories. Valid values are `AES256` or `KMS`. Defaults to `AES256`. * `kms_key` - (Optional) The ARN of the KMS key to use when `encryption_type` is `KMS`. If not specified, uses the default AWS managed key for ECR. +### image_tag_mutability_exclusion_filter + +* `filter` - (Required) The filter pattern to use for excluding image tags from the mutability setting. Must contain only letters, numbers, and special characters (._*-). Each filter can be up to 128 characters long and can contain a maximum of 2 wildcards (*). +* `filter_type` - (Required) The type of filter to use. Must be `WILDCARD`. + ## Attribute Reference This resource exports the following attributes in addition to the arguments above: diff --git a/website/docs/r/eks_cluster.html.markdown b/website/docs/r/eks_cluster.html.markdown index 9f31195c2cfa..389c2e193bd2 100644 --- a/website/docs/r/eks_cluster.html.markdown +++ b/website/docs/r/eks_cluster.html.markdown @@ -344,15 +344,16 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `access_config` - (Optional) Configuration block for the access config associated with your cluster, see [Amazon EKS Access Entries](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html). [Detailed](#access_config) below. * `bootstrap_self_managed_addons` - (Optional) Install default unmanaged add-ons, such as `aws-cni`, `kube-proxy`, and CoreDNS during cluster creation. If `false`, you must manually install desired add-ons. Changing this value will force a new cluster to be created. Defaults to `true`. * `compute_config` - (Optional) Configuration block with compute configuration for EKS Auto Mode. [Detailed](#compute_config) below. +* `deletion_protection` - (Optional) Whether to enable deletion protection for the cluster. When enabled, the cluster cannot be deleted unless deletion protection is first disabled. Default: `false`. * `enabled_cluster_log_types` - (Optional) List of the desired control plane logging to enable. For more information, see [Amazon EKS Control Plane Logging](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html). * `encryption_config` - (Optional) Configuration block with encryption configuration for the cluster. [Detailed](#encryption_config) below. * `force_update_version` - (Optional) Force version update by overriding upgrade-blocking readiness checks when updating a cluster. * `kubernetes_network_config` - (Optional) Configuration block with kubernetes network configuration for the cluster. [Detailed](#kubernetes_network_config) below. If removed, Terraform will only perform drift detection if a configuration value is provided. * `outpost_config` - (Optional) Configuration block representing the configuration of your local Amazon EKS cluster on an AWS Outpost. This block isn't available for creating Amazon EKS clusters on the AWS cloud. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `remote_network_config` - (Optional) Configuration block with remote network configuration for EKS Hybrid Nodes. [Detailed](#remote_network_config) below. * `storage_config` - (Optional) Configuration block with storage configuration for EKS Auto Mode. [Detailed](#storage_config) below. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. diff --git a/website/docs/r/emr_cluster.html.markdown b/website/docs/r/emr_cluster.html.markdown index 61000f843276..96a7c2853fe2 100644 --- a/website/docs/r/emr_cluster.html.markdown +++ b/website/docs/r/emr_cluster.html.markdown @@ -668,6 +668,8 @@ EOF * `unhealthy_node_replacement` - (Optional) Whether whether Amazon EMR should gracefully replace core nodes that have degraded within the cluster. Default value is `false`. * `visible_to_all_users` - (Optional) Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true`. + **NOTE:** As per the [Amazon EMR API Reference](https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html#EMR-RunJobFlow-request-VisibleToAllUsers), this argument is no longer supported. Do not set this argument, particularly to `false`, as it would lead to perpetual differences. + ### bootstrap_action * `args` - (Optional) List of command line arguments to pass to the bootstrap action script. @@ -834,7 +836,6 @@ This resource exports the following attributes in addition to the arguments abov * `release_label` - Release label for the Amazon EMR release. * `service_role` - IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf. * `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). -* `visible_to_all_users` - Indicates whether the job flow is visible to all IAM users of the AWS account associated with the job flow. ## Import diff --git a/website/docs/r/finspace_kx_volume.html.markdown b/website/docs/r/finspace_kx_volume.html.markdown index e96a0edb147d..50f5cc1665ff 100644 --- a/website/docs/r/finspace_kx_volume.html.markdown +++ b/website/docs/r/finspace_kx_volume.html.markdown @@ -18,7 +18,7 @@ Terraform resource for managing an AWS FinSpace Kx Volume. resource "aws_finspace_kx_volume" "example" { name = "my-tf-kx-volume" environment_id = aws_finspace_kx_environment.example.id - availability_zones = "use1-az2" + availability_zones = ["use1-az2"] az_mode = "SINGLE" type = "NAS_1" nas1_configuration { diff --git a/website/docs/r/flow_log.html.markdown b/website/docs/r/flow_log.html.markdown index c0ef726e4d38..1f4ee4d517f1 100644 --- a/website/docs/r/flow_log.html.markdown +++ b/website/docs/r/flow_log.html.markdown @@ -9,7 +9,7 @@ description: |- # Resource: aws_flow_log Provides a VPC/Subnet/ENI/Transit Gateway/Transit Gateway Attachment Flow Log to capture IP traffic for a specific network -interface, subnet, or VPC. Logs are sent to a CloudWatch Log Group, a S3 Bucket, or Amazon Kinesis Data Firehose +interface, subnet, or VPC. Logs are sent to a CloudWatch Log Group, a S3 Bucket, or Amazon Data Firehose ## Example Usage @@ -68,7 +68,7 @@ resource "aws_iam_role_policy" "example" { } ``` -### Amazon Kinesis Data Firehose logging +### Amazon Data Firehose logging ```terraform resource "aws_flow_log" "example" { @@ -174,15 +174,152 @@ resource "aws_s3_bucket" "example" { } ``` +### Cross-Account Amazon Data Firehose Logging + +The following example shows how to set up a flow log in one AWS account (source) that sends logs to an Amazon Data Firehose delivery stream in another AWS account (destination). +See the [AWS Documentation](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs-firehose.html). + +```terraform +# Provider configurations +provider "aws" { + profile = "admin-src" +} + +provider "aws" { + alias = "destination_account" + profile = "admin-dst" +} + +# For source account +resource "aws_vpc" "src" { + # config... +} + +data "aws_iam_policy_document" "src_assume_role_policy" { + statement { + actions = ["sts:AssumeRole"] + effect = "Allow" + principals { + type = "Service" + identifiers = ["delivery.logs.amazonaws.com"] + } + } +} + +resource "aws_iam_role" "src" { + name = "tf-example-mySourceRole" + assume_role_policy = data.aws_iam_policy_document.src_assume_role_policy.json +} + +data "aws_iam_policy_document" "src_role_policy" { + statement { + effect = "Allow" + actions = ["iam:PassRole"] + resources = [aws_iam_role.src.arn] + + condition { + test = "StringEquals" + variable = "iam:PassedToService" + values = ["delivery.logs.amazonaws.com"] + } + + condition { + test = "StringLike" + variable = "iam:AssociatedResourceARN" + values = [aws_vpc.src.arn] + } + } + + statement { + effect = "Allow" + actions = [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:ListLogDeliveries", + "logs:GetLogDelivery" + ] + resources = ["*"] + } + + statement { + effect = "Allow" + actions = ["sts:AssumeRole"] + resources = [aws_iam_role.dst.arn] + } +} + +resource "aws_iam_role_policy" "src_policy" { + name = "tf-example-mySourceRolePolicy" + role = aws_iam_role.src.name + policy = data.aws_iam_policy_document.src_role_policy.json +} + +resource "aws_flow_log" "src" { + log_destination_type = "kinesis-data-firehose" + log_destination = aws_kinesis_firehose_delivery_stream.dst.arn + traffic_type = "ALL" + vpc_id = aws_vpc.src.id + iam_role_arn = aws_iam_role.src.arn + deliver_cross_account_role = aws_iam_role.dst.arn +} + +# For destination account +data "aws_iam_policy_document" "dst_assume_role_policy" { + statement { + actions = ["sts:AssumeRole"] + effect = "Allow" + principals { + type = "AWS" + identifiers = [aws_iam_role.src.arn] + } + } +} + +resource "aws_iam_role" "dst" { + provider = aws.destination_account + name = "AWSLogDeliveryFirehoseCrossAccountRole" # must start with "AWSLogDeliveryFirehoseCrossAccountRolePolicy" + assume_role_policy = data.aws_iam_policy_document.dst_assume_role_policy.json +} + +data "aws_iam_policy_document" "dst_role_policy" { + statement { + effect = "Allow" + actions = [ + "iam:CreateServiceLinkedRole", + "firehose:TagDeliveryStream" + ] + resources = ["*"] + } +} + +resource "aws_iam_role_policy" "dst" { + provider = aws.destination_account + name = "AWSLogDeliveryFirehoseCrossAccountRolePolicy" + role = aws_iam_role.dst.name + policy = data.aws_iam_policy_document.dst_role_policy.json +} + +resource "aws_kinesis_firehose_delivery_stream" "dst" { + provider = aws.destination_account + # The tag named "LogDeliveryEnabled" must be set to "true" to allow the service-linked role "AWSServiceRoleForLogDelivery" + # to perform permitted actions on your behalf. + # See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-infrastructure-Firehose.html + tags = { + LogDeliveryEnabled = "true" + } + # other config... +} +``` + ## Argument Reference This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `traffic_type` - (Required) The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. -* `deliver_cross_account_role` - (Optional) ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. +* `deliver_cross_account_role` - (Optional) ARN of the IAM role in the destination account used for cross-account delivery of flow logs. * `eni_id` - (Optional) Elastic Network Interface ID to attach to. -* `iam_role_arn` - (Optional) ARN of the IAM role that's used to post flow logs to a CloudWatch Logs log group. +* `iam_role_arn` - (Optional) ARN of the IAM role used to post flow logs. Corresponds to `DeliverLogsPermissionArn` in the [AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFlowLogs.html). * `log_destination_type` - (Optional) Logging destination type. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. * `log_destination` - (Optional) ARN of the logging destination. * `subnet_id` - (Optional) Subnet ID to attach to. diff --git a/website/docs/r/gamelift_fleet.html.markdown b/website/docs/r/gamelift_fleet.html.markdown index 9caa1e1326ca..48c4cb65ddc7 100644 --- a/website/docs/r/gamelift_fleet.html.markdown +++ b/website/docs/r/gamelift_fleet.html.markdown @@ -33,7 +33,7 @@ resource "aws_gamelift_fleet" "example" { This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `build_id` - (Optional) ID of the GameLift Build to be deployed on the fleet. +* `build_id` - (Optional) ID of the GameLift Build to be deployed on the fleet. Conflicts with `script_id`. * `certificate_configuration` - (Optional) Prompts GameLift to generate a TLS/SSL certificate for the fleet. See [certificate_configuration](#certificate_configuration). * `description` - (Optional) Human-readable description of the fleet. * `ec2_inbound_permission` - (Optional) Range of IP addresses and port settings that permit inbound traffic to access server processes running on the fleet. See below. @@ -45,7 +45,7 @@ This resource supports the following arguments: * `new_game_session_protection_policy` - (Optional) Game session protection policy to apply to all instances in this fleetE.g., `FullProtection`. Defaults to `NoProtection`. * `resource_creation_limit_policy` - (Optional) Policy that limits the number of game sessions an individual player can create over a span of time for this fleet. See below. * `runtime_configuration` - (Optional) Instructions for launching server processes on each instance in the fleet. See below. -* `script_id` - (Optional) ID of the GameLift Script to be deployed on the fleet. +* `script_id` - (Optional) ID of the GameLift Script to be deployed on the fleet. Conflicts with `build_id`. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### Nested Fields diff --git a/website/docs/r/globalaccelerator_cross_account_attachment.html.markdown b/website/docs/r/globalaccelerator_cross_account_attachment.html.markdown index 9c4bbaa89697..363fb3d86dde 100644 --- a/website/docs/r/globalaccelerator_cross_account_attachment.html.markdown +++ b/website/docs/r/globalaccelerator_cross_account_attachment.html.markdown @@ -69,7 +69,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Global Accelerator Cross Account Attachment using the `arn`. For example: ```terraform import { @@ -78,7 +78,7 @@ import { } ``` -Using `terraform import`, import Global Accelerator Cross Account Attachment using the `example_id_arg`. For example: +Using `terraform import`, import Global Accelerator Cross Account Attachment using the `arn`. For example: ```console % terraform import aws_globalaccelerator_cross_account_attachment.example arn:aws:globalaccelerator::012345678910:attachment/01234567-abcd-8910-efgh-123456789012 diff --git a/website/docs/r/imagebuilder_workflow.html.markdown b/website/docs/r/imagebuilder_workflow.html.markdown index a1acbe63929b..41b9a8eaa13e 100644 --- a/website/docs/r/imagebuilder_workflow.html.markdown +++ b/website/docs/r/imagebuilder_workflow.html.markdown @@ -80,7 +80,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import EC2 Image Builder Workflow using the `arn`. For example: ```terraform import { @@ -89,7 +89,7 @@ import { } ``` -Using `terraform import`, import EC2 Image Builder Workflow using the `example_id_arg`. For example: +Using `terraform import`, import EC2 Image Builder Workflow using the `arn`. For example: ```console % terraform import aws_imagebuilder_workflow.example arn:aws:imagebuilder:us-east-1:aws:workflow/test/example/1.0.1/1 diff --git a/website/docs/r/inspector2_enabler.html.markdown b/website/docs/r/inspector2_enabler.html.markdown index 9507cb6fdd89..d2b363718df8 100644 --- a/website/docs/r/inspector2_enabler.html.markdown +++ b/website/docs/r/inspector2_enabler.html.markdown @@ -56,3 +56,20 @@ This resource exports no additional attributes. * `create` - (Default `5m`) * `update` - (Default `5m`) * `delete` - (Default `5m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Inspector Enabler using `account_ids` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `account_ids` are sorted in ascending order and `resource_types` are sorted in alphabetical order. For example: + +```terraform +import { + to = aws_inspector2_enabler.example + id = "123456789012:234567890123-EC2:ECR" +} +``` + +Using `terraform import`, import Inspector Enabler using using `account_ids` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `account_ids` are sorted in ascending order and `resource_types` are sorted in alphabetical order. For example: + +```console +% terraform import aws_inspector2_enabler.example 123456789012:234567890123-EC2:ECR +``` diff --git a/website/docs/r/inspector2_filter.html.markdown b/website/docs/r/inspector2_filter.html.markdown index b2544b0f7b75..fb18ee6dc364 100644 --- a/website/docs/r/inspector2_filter.html.markdown +++ b/website/docs/r/inspector2_filter.html.markdown @@ -156,7 +156,7 @@ import { } ``` -Using `terraform import`, import Inspector Filter using the `example_id_arg`. For example: +Using `terraform import`, import Inspector Filter using the `arn`. For example: ```console % terraform import aws_inspector2_filter.example "arn:aws:inspector2:us-east-1:111222333444:owner/111222333444/filter/abcdefgh12345678" diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index d8a46ec4b08a..d545bd57a645 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -224,6 +224,7 @@ This resource supports the following arguments: * `enable_primary_ipv6` - (Optional) Whether to assign a primary IPv6 Global Unicast Address (GUA) to the instance when launched in a dual-stack or IPv6-only subnet. A primary IPv6 address ensures a consistent IPv6 address for the instance and is automatically assigned by AWS to the ENI. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains until the instance is terminated or the ENI is detached. Disabling `enable_primary_ipv6` after it has been enabled forces recreation of the instance. * `enclave_options` - (Optional) Enable Nitro Enclaves on launched instances. See [Enclave Options](#enclave-options) below for more details. * `ephemeral_block_device` - (Optional) One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a set of objects. +* `force_destroy` - (Optional) Destroys instance even if `disable_api_termination` or `disable_api_stop` is set to `true`. Defaults to `false`. Once this parameter is set to `true`, a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the instance or destroying the instance, this flag will not work. Additionally when importing an instance, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation. * `get_password_data` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. * `hibernation` - (Optional) If true, the launched EC2 instance will support hibernation. * `host_id` - (Optional) ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. diff --git a/website/docs/r/lakeformation_data_cells_filter.html.markdown b/website/docs/r/lakeformation_data_cells_filter.html.markdown index 243db10cdb46..77536786c4f2 100644 --- a/website/docs/r/lakeformation_data_cells_filter.html.markdown +++ b/website/docs/r/lakeformation_data_cells_filter.html.markdown @@ -71,7 +71,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Lake Formation Data Cells Filter using the `database_name`, `name`, `table_catalog_id`, and `table_name` separated by `,`. For example: ```terraform import { @@ -80,7 +80,7 @@ import { } ``` -Using `terraform import`, import Lake Formation Data Cells Filter using the `id`. For example: +Using `terraform import`, import Lake Formation Data Cells Filter using the `database_name`, `name`, `table_catalog_id`, and `table_name` separated by `,`. For example: ```console % terraform import aws_lakeformation_data_cells_filter.example database_name,name,table_catalog_id,table_name diff --git a/website/docs/r/launch_template.html.markdown b/website/docs/r/launch_template.html.markdown index e904ec8a1234..31454dc1ec2e 100644 --- a/website/docs/r/launch_template.html.markdown +++ b/website/docs/r/launch_template.html.markdown @@ -186,7 +186,7 @@ The `ebs` block supports the following: The `capacity_reservation_specification` block supports the following: -* `capacity_reservation_preference` - Indicates the instance's Capacity Reservation preferences. Can be `open` or `none`. (Default `none`). +* `capacity_reservation_preference` - Indicates the instance's Capacity Reservation preferences. Can be `capacity-reservations-only`, `open` or `none`. If `capacity_reservation_id` or `capacity_reservation_resource_group_arn` is specified in `capacity_reservation_target` block, either omit `capacity_reservation_preference` or set it to `capacity-reservations-only`. * `capacity_reservation_target` - Used to target a specific Capacity Reservation: The `capacity_reservation_target` block supports the following: diff --git a/website/docs/r/msk_cluster.html.markdown b/website/docs/r/msk_cluster.html.markdown index 3580ab60c116..35ad4c1ae792 100644 --- a/website/docs/r/msk_cluster.html.markdown +++ b/website/docs/r/msk_cluster.html.markdown @@ -204,16 +204,16 @@ resource "aws_msk_cluster" "example" { This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). -* `broker_node_group_info` - (Required) Configuration block for the broker nodes of the Kafka cluster. +* `broker_node_group_info` - (Required) Configuration block for the broker nodes of the Kafka cluster. See [broker_node_group_info Argument Reference](#broker_node_group_info-argument-reference) below. * `cluster_name` - (Required) Name of the MSK cluster. * `kafka_version` - (Required) Specify the desired Kafka software version. * `number_of_broker_nodes` - (Required) The desired total number of broker nodes in the kafka cluster. It must be a multiple of the number of specified client subnets. -* `client_authentication` - (Optional) Configuration block for specifying a client authentication. See below. -* `configuration_info` - (Optional) Configuration block for specifying a MSK Configuration to attach to Kafka brokers. See below. -* `encryption_info` - (Optional) Configuration block for specifying encryption. See below. +* `client_authentication` - (Optional) Configuration block for specifying a client authentication. See [client_authentication Argument Reference](#client_authentication-argument-reference) below. +* `configuration_info` - (Optional) Configuration block for specifying an MSK Configuration to attach to Kafka brokers. See [configuration_info Argument Reference](#configuration_info-argument-reference) below. +* `encryption_info` - (Optional) Configuration block for specifying encryption. See [encryption_info Argument Reference](#encryption_info-argument-reference) below. * `enhanced_monitoring` - (Optional) Specify the desired enhanced MSK CloudWatch monitoring level. See [Monitoring Amazon MSK with Amazon CloudWatch](https://docs.aws.amazon.com/msk/latest/developerguide/monitoring.html) -* `open_monitoring` - (Optional) Configuration block for JMX and Node monitoring for the MSK cluster. See below. -* `logging_info` - (Optional) Configuration block for streaming broker logs to Cloudwatch/S3/Kinesis Firehose. See below. +* `open_monitoring` - (Optional) Configuration block for JMX and Node monitoring for the MSK cluster. See [open_monitoring Argument Reference](#open_monitoring-argument-reference) below. +* `logging_info` - (Optional) Configuration block for streaming broker logs to Cloudwatch/S3/Kinesis Firehose. See [logging_info Argument Reference](#logging_info-argument-reference) below. * `storage_mode` - (Optional) Controls storage mode for supported storage tiers. Valid values are: `LOCAL` or `TIERED`. * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -222,14 +222,14 @@ This resource supports the following arguments: * `client_subnets` - (Required) A list of subnets to connect to in client VPC ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-prop-brokernodegroupinfo-clientsubnets)). * `instance_type` - (Required) Specify the instance type to use for the kafka brokersE.g., kafka.m5.large. ([Pricing info](https://aws.amazon.com/msk/pricing/)) * `security_groups` - (Required) A list of the security groups to associate with the elastic network interfaces to control who can communicate with the cluster. -* `az_distribution` - (Optional) The distribution of broker nodes across availability zones ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-model-brokerazdistribution)). Currently the only valid value is `DEFAULT`. -* `connectivity_info` - (Optional) Information about the cluster access configuration. See below. For security reasons, you can't turn on public access while creating an MSK cluster. However, you can update an existing cluster to make it publicly accessible. You can also create a new cluster and then update it to make it publicly accessible ([documentation](https://docs.aws.amazon.com/msk/latest/developerguide/public-access.html)). -* `storage_info` - (Optional) A block that contains information about storage volumes attached to MSK broker nodes. See below. +* `az_distribution` - (Optional) The distribution of broker nodes across availability zones ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-model-brokerazdistribution)). Currently, the only valid value is `DEFAULT`. +* `connectivity_info` - (Optional) Information about the cluster access configuration. See [broker_node_group_info connectivity_info Argument Reference](#broker_node_group_info-connectivity_info-argument-reference) below. For security reasons, you can't turn on public access while creating an MSK cluster. However, you can update an existing cluster to make it publicly accessible. You can also create a new cluster and then update it to make it publicly accessible ([documentation](https://docs.aws.amazon.com/msk/latest/developerguide/public-access.html)). +* `storage_info` - (Optional) A block that contains information about storage volumes attached to MSK broker nodes. See [broker_node_group_info storage_info Argument Reference](#broker_node_group_info-storage_info-argument-reference) below. ### broker_node_group_info connectivity_info Argument Reference -* `public_access` - (Optional) Access control settings for brokers. See below. -* `vpc_connectivity` - (Optional) VPC connectivity access control for brokers. See below. +* `public_access` - (Optional) Access control settings for brokers. See [connectivity_info public_access Argument Reference](#connectivity_info-public_access-argument-reference) below. +* `vpc_connectivity` - (Optional) VPC connectivity access control for brokers. See [connectivity_info vpc_connectivity Argument Reference](#connectivity_info-vpc_connectivity-argument-reference) below. ### connectivity_info public_access Argument Reference @@ -237,11 +237,11 @@ This resource supports the following arguments: ### connectivity_info vpc_connectivity Argument Reference -* `client_authentication` - (Optional) Includes all client authentication information for VPC connectivity. See below. +* `client_authentication` - (Optional) Includes all client authentication information for VPC connectivity. See [vpc_connectivity client_authentication Argument Reference](#vpc_connectivity-client_authentication-argument-reference) below. ### vpc_connectivity client_authentication Argument Reference -* `sasl` - (Optional) SASL authentication type details for VPC connectivity. See below. +* `sasl` - (Optional) SASL authentication type details for VPC connectivity. See [vpc_connectivity client_authentication sasl Argument Reference](#vpc_connectivity-client_authentication-sasl-argument-reference) below. * `tls` - (Optional) Enables TLS authentication for VPC connectivity. ### vpc_connectivity client_authentication sasl Argument Reference @@ -251,11 +251,11 @@ This resource supports the following arguments: ### broker_node_group_info storage_info Argument Reference -* `ebs_storage_info` - (Optional) A block that contains EBS volume information. See below. +* `ebs_storage_info` - (Optional) A block that contains EBS volume information. See [storage_info ebs_storage_info Argument Reference](#storage_info-ebs_storage_info-argument-reference) below. ### storage_info ebs_storage_info Argument Reference -* `provisioned_throughput` - (Optional) A block that contains EBS volume provisioned throughput information. To provision storage throughput, you must choose broker type kafka.m5.4xlarge or larger. See below. +* `provisioned_throughput` - (Optional) A block that contains EBS volume provisioned throughput information. To provision storage throughput, you must choose broker type kafka.m5.4xlarge or larger. See [ebs_storage_info provisioned_throughput Argument Reference](#ebs_storage_info-provisioned_throughput-argument-reference) below. * `volume_size` - (Optional) The size in GiB of the EBS volume for the data drive on each broker node. Minimum value of `1` and maximum value of `16384`. ### ebs_storage_info provisioned_throughput Argument Reference @@ -265,8 +265,8 @@ This resource supports the following arguments: ### client_authentication Argument Reference -* `sasl` - (Optional) Configuration block for specifying SASL client authentication. See below. -* `tls` - (Optional) Configuration block for specifying TLS client authentication. See below. +* `sasl` - (Optional) Configuration block for specifying SASL client authentication. See [client_authentication sasl Argument Reference](#client_authentication-sasl-argument-reference) below. +* `tls` - (Optional) Configuration block for specifying TLS client authentication. See [client_authentication tls Argument Reference](#client_authentication-tls-argument-reference) below. * `unauthenticated` - (Optional) Enables unauthenticated access. #### client_authentication sasl Argument Reference @@ -285,7 +285,7 @@ This resource supports the following arguments: ### encryption_info Argument Reference -* `encryption_in_transit` - (Optional) Configuration block to specify encryption in transit. See below. +* `encryption_in_transit` - (Optional) Configuration block to specify encryption in transit. See [encryption_info encryption_in_transit Argument Reference](#encryption_info-encryption_in_transit-argument-reference) below. * `encryption_at_rest_kms_key_arn` - (Optional) You may specify a KMS key short ID or ARN (it will always output an ARN) to use for encrypting your data at rest. If no key is specified, an AWS managed KMS ('aws/msk' managed service) key will be used for encrypting the data at rest. #### encryption_info encryption_in_transit Argument Reference @@ -295,12 +295,12 @@ This resource supports the following arguments: #### open_monitoring Argument Reference -* `prometheus` - (Required) Configuration block for Prometheus settings for open monitoring. See below. +* `prometheus` - (Required) Configuration block for Prometheus settings for open monitoring. See [open_monitoring prometheus Argument Reference](#open_monitoring-prometheus-argument-reference) below. #### open_monitoring prometheus Argument Reference -* `jmx_exporter` - (Optional) Configuration block for JMX Exporter. See below. -* `node_exporter` - (Optional) Configuration block for Node Exporter. See below. +* `jmx_exporter` - (Optional) Configuration block for JMX Exporter. See [open_monitoring prometheus jmx_exporter Argument Reference](#open_monitoring-prometheus-jmx_exporter-argument-reference) below. +* `node_exporter` - (Optional) Configuration block for Node Exporter. See [open_monitoring prometheus node_exporter Argument Reference](#open_monitoring-prometheus-node_exporter-argument-reference) below. #### open_monitoring prometheus jmx_exporter Argument Reference @@ -312,7 +312,13 @@ This resource supports the following arguments: #### logging_info Argument Reference -* `broker_logs` - (Required) Configuration block for Broker Logs settings for logging info. See below. +* `broker_logs` - (Required) Configuration block for Broker Logs settings for logging info. See [logging_info broker_logs Argument Reference](#logging_info-broker_logs-argument-reference) below. + +#### logging_info broker_logs Argument Reference + +* `cloudwatch_logs` - (Optional) Configuration block for Cloudwatch Logs settings. See [logging_info broker_logs cloudwatch_logs Argument Reference](#logging_info-broker_logs-cloudwatch_logs-argument-reference) below. +* `firehose` - (Optional) Configuration block for Kinesis Data Firehose settings. See [logging_info broker_logs firehose Argument Reference](#logging_info-broker_logs-firehose-argument-reference) below. +* `s3` - (Optional) Configuration block for S3 settings. See [logging_info broker_logs s3 Argument Reference](#logging_info-broker_logs-s3-argument-reference) below. #### logging_info broker_logs cloudwatch_logs Argument Reference diff --git a/website/docs/r/networkfirewall_vpc_endpoint_association.html.markdown b/website/docs/r/networkfirewall_vpc_endpoint_association.html.markdown new file mode 100644 index 000000000000..8ee056c71140 --- /dev/null +++ b/website/docs/r/networkfirewall_vpc_endpoint_association.html.markdown @@ -0,0 +1,92 @@ +--- +subcategory: "Network Firewall" +layout: "aws" +page_title: "AWS: aws_networkfirewall_vpc_endpoint_association" +description: |- + Manages a firewall endpoint for an AWS Network Firewall firewall. +--- + +# Resource: aws_networkfirewall_vpc_endpoint_association + +Manages a firewall endpoint for an AWS Network Firewall firewall. + +Use `aws_networkfirewall_vpc_endpoint_association` to establish new firewall endpoints in any Availability Zone where the firewall is already being used. The first use of a firewall in an Availability Zone must be defined by `aws_networkfirewall_firewall` resource and `subnet_mapping` argument. + +## Example Usage + +### Basic Usage + +```terraform +resource "aws_networkfirewall_vpc_endpoint_association" "example" { + firewall_arn = aws_networkfirewall_firewall.example.arn + vpc_id = aws_vpc.example.id + + subnet_mapping { + subnet_id = aws_subnet.example.id + } + + subnet_mapping { + subnet_id = aws_subnet.example_two.id + } + + tags = { + Name = "example endpoint" + } +} +``` + +## Argument Reference + +This resource supports the following arguments: + +* `description` (Optional) - A description of the VPC endpoint association. +* `firewall_arn` (Required) - The Amazon Resource Name (ARN) that identifies the firewall. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `subnet_mapping` (Required) - The ID for a subnet that's used in an association with a firewall. See [Subnet Mapping](#subnet-mapping) below for details. +* `tags` - (Optional) Map of resource tags to associate with the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `vpc_id` (Required) - The unique identifier of the VPC for the endpoint association. + +### Subnet Mapping + +The `subnet_mapping` block supports the following arguments: + +* `ip_address_type` - (Optional) The subnet's IP address type. Valid values: `"DUALSTACK"`, `"IPV4"`. +* `subnet_id` - (Required) The unique identifier for the subnet. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `vpc_endpoint_association_arn` - ARN of the VPC Endpoint Association. +* `vpc_endpoint_association_id` - The unique identifier of the VPC endpoint association. +* `vpc_endpoint_association_status` - Nested list of information about the current status of the VPC Endpoint Association. + * `association_sync_states` - Set of subnets configured for use by the VPC Endpoint Association. + * `attachment` - Nested list describing the attachment status of the firewall's VPC Endpoint Association with a single VPC subnet. + * `endpoint_id` - The identifier of the VPC endpoint that AWS Network Firewall has instantiated in the subnet. You use this to identify the firewall endpoint in the VPC route tables, when you redirect the VPC traffic through the endpoint. + * `subnet_id` - The unique identifier of the subnet that you've specified to be used for a VPC Endpoint Association endpoint. + * `availability_zone` - The Availability Zone where the subnet is configured. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Network Firewall VPC Endpoint Association using the `vpc_endpoint_association_arn`. For example: + +```terraform +import { + to = aws_networkfirewall_vpc_endpoint_association.example + id = "arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example" +} +``` + +Using `terraform import`, import Network Firewall VPC Endpoint Association using the `vpc_endpoint_association_arn`. For example: + +```console +% terraform import aws_networkfirewall_vpc_endpoint_association.example arn:aws:network-firewall:us-west-1:123456789012:vpc-endpoint-association/example +``` diff --git a/website/docs/r/opensearch_authorize_vpc_endpoint_access.html.markdown b/website/docs/r/opensearch_authorize_vpc_endpoint_access.html.markdown index c459e11c9901..0141e58c7006 100644 --- a/website/docs/r/opensearch_authorize_vpc_endpoint_access.html.markdown +++ b/website/docs/r/opensearch_authorize_vpc_endpoint_access.html.markdown @@ -44,7 +44,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Authorize Vpc Endpoint Access using the `domain_name`. For example: ```terraform import { @@ -53,7 +53,7 @@ import { } ``` -Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example: +Using `terraform import`, import OpenSearch Authorize Vpc Endpoint Access using the `domain_name`. For example: ```console % terraform import aws_opensearch_authorize_vpc_endpoint_access.example authorize_vpc_endpoint_access-id-12345678 diff --git a/website/docs/r/opensearch_domain_policy.html.markdown b/website/docs/r/opensearch_domain_policy.html.markdown index c857add58802..f3ace154298d 100644 --- a/website/docs/r/opensearch_domain_policy.html.markdown +++ b/website/docs/r/opensearch_domain_policy.html.markdown @@ -62,3 +62,20 @@ This resource exports no additional attributes. * `update` - (Default `180m`) * `delete` - (Default `90m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OpenSearch Domain Policy using `domain_name` prefixed with `esd-policy-`. For example: + +```terraform +import { + to = aws_opensearch_domain_policy.example + id = "esd-policy-tf-test" +} +``` + +Using `terraform import`, import OpenSearch Domain Policy using `domain_name` prefixed with `esd-policy-`. For example: + +```console +% terraform import aws_opensearch_domain_policy.example esd-policy-tf-test +``` diff --git a/website/docs/r/quicksight_custom_permissions.html.markdown b/website/docs/r/quicksight_custom_permissions.html.markdown new file mode 100644 index 000000000000..7ea7ab857dd8 --- /dev/null +++ b/website/docs/r/quicksight_custom_permissions.html.markdown @@ -0,0 +1,85 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_custom_permissions" +description: |- + Manages a QuickSight custom permissions profile. +--- + +# Resource: aws_quicksight_custom_permissions + +Manages a QuickSight custom permissions profile. + +## Example Usage + +resource "aws_quicksight_custom_permissions" "example" { + custom_permissions_name = "example-permissions" + + capabilities { + print_reports = "DENY" + share_dashboards = "DENY" + } +} + +## Argument Reference + +The following arguments are required: + +* `capabilities` - (Required) Actions to include in the custom permissions profile. See [capabilities](#capabilities). +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### capabilities + +* `add_or_run_anomaly_detection_for_analyses` - (Optional) The ability to add or run anomaly detection. Valid values: `DENY`. +* `create_and_update_dashboard_email_reports` - (Optional) The ability to create and update email reports. Valid values: `DENY`. +* `create_and_update_datasets` - (Optional) The ability to create and update datasets. Valid values: `DENY`. +* `create_and_update_data_sources` - (Optional) The ability to create and update data sources. Valid values: `DENY`. +* `create_and_update_themes` - (Optional) The ability to export to create and update themes. Valid values: `DENY`. +* `create_and_update_threshold_alerts` - (Optional) The ability to create and update threshold alerts. Valid values: `DENY`. +* `create_shared_folders` - (Optional) The ability to create shared folders. Valid values: `DENY`. +* `create_spice_dataset` - (Optional) The ability to create a SPICE dataset. Valid values: `DENY`. +* `export_to_csv` - (Optional) The ability to export to CSV files from the UI. Valid values: `DENY`. +* `export_to_csv_in_scheduled_reports` - (Optional) The ability to export to CSV files in scheduled email reports. Valid values: `DENY`. +* `export_to_excel` - (Optional) The ability to export to Excel files from the UI. Valid values: `DENY`. +* `export_to_excel_in_scheduled_reports` - (Optional) The ability to export to Excel files in scheduled email reports. Valid values: `DENY`. +* `export_to_pdf` - (Optional) The ability to export to PDF files from the UI. Valid values: `DENY`. +* `export_to_pdf_in_scheduled_reports` - (Optional) The ability to export to PDF files in scheduled email reports. Valid values: `DENY`. +* `include_content_in_scheduled_reports_email` - (Optional) The ability to include content in scheduled email reports. Valid values: `DENY`. +* `print_reports` - (Optional) The ability to print reports. Valid values: `DENY`. +* `rename_shared_folders` - (Optional) The ability to rename shared folders. Valid values: `DENY`. +* `share_analyses` - (Optional) The ability to share analyses. Valid values: `DENY`. +* `share_dashboards` - (Optional) The ability to share dashboards. Valid values: `DENY`. +* `share_datasets` - (Optional) The ability to share datasets. Valid values: `DENY`. +* `share_data_sources` - (Optional) The ability to share data sources. Valid values: `DENY`. +* `subscribe_dashboard_email_reports` - (Optional) The ability to subscribe to email reports. Valid values: `DENY`. +* `view_account_spice_capacity` - (Optional) The ability to view account SPICE capacity. Valid values: `DENY`. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `arn` - ARN of the custom permissions profile. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```terraform +import { + to = aws_quicksight_custom_permissions.example + id = "123456789012,example-permissions" +} +``` + +Using `terraform import`, import a QuickSight custom permissions profile using the AWS account ID and custom permissions profile name separated by a comma (`,`). For example: + +```console +% terraform import aws_quicksight_custom_permissions.example 123456789012,example-permissions +``` diff --git a/website/docs/r/quicksight_role_custom_permission.html.markdown b/website/docs/r/quicksight_role_custom_permission.html.markdown new file mode 100644 index 000000000000..c1d1514cbdff --- /dev/null +++ b/website/docs/r/quicksight_role_custom_permission.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_role_custom_permission" +description: |- + Manages the custom permissions that are associated with a role. +--- + +# Resource: aws_quicksight_role_custom_permission + +Manages the custom permissions that are associated with a role. + +## Example Usage + +```terraform +resource "aws_quicksight_role_custom_permission" "example" { + role = "READER" + custom_permissions_name = aws_quicksight_custom_permissions.example.custom_permissions_name +} +``` + +## Argument Reference + +The following arguments are required: + +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. +* `role` - (Required, Forces new resource) Role. Valid values are `ADMIN`, `AUTHOR`, `READER`, `ADMIN_PRO`, `AUTHOR_PRO`, and `READER_PRO`. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace containing the role. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight role custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace` and `role`. For example: + +```terraform +import { + to = aws_quicksight_role_custom_permission.example + id = "012345678901,default,READER" +} +``` + +Using `terraform import`, import QuickSight role custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace`, and `role`. For example: + +```console +% terraform import aws_quicksight_role_custom_permission.example 012345678901,default,READER +``` diff --git a/website/docs/r/quicksight_user.html.markdown b/website/docs/r/quicksight_user.html.markdown index 33a3d8eca320..566db96c8ab3 100644 --- a/website/docs/r/quicksight_user.html.markdown +++ b/website/docs/r/quicksight_user.html.markdown @@ -52,8 +52,8 @@ resource "aws_quicksight_user" "example" { The following arguments are required: * `email` - (Required) Email address of the user that you want to register. -* `identity_type` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`. -* `user_role` - (Required) Amazon QuickSight role for the user. Value values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`. +* `identity_type` - (Required) Identity type that your Amazon QuickSight account uses to manage the identity of users. Valid values: `IAM`, `QUICKSIGHT`, `IAM_IDENTITY_CENTER`. +* `user_role` - (Required) Amazon QuickSight role for the user. Valid values: `READER`, `AUTHOR`, `ADMIN`, `READER_PRO`, `AUTHOR_PRO`, `ADMIN_PRO`, `RESTRICTED_AUTHOR`, `RESTRICTED_READER`. The following arguments are optional: diff --git a/website/docs/r/quicksight_user_custom_permission.html.markdown b/website/docs/r/quicksight_user_custom_permission.html.markdown new file mode 100644 index 000000000000..0056be62211a --- /dev/null +++ b/website/docs/r/quicksight_user_custom_permission.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "QuickSight" +layout: "aws" +page_title: "AWS: aws_quicksight_user_custom_permission" +description: |- + Manages the custom permissions profile for a user. +--- + +# Resource: aws_quicksight_user_custom_permission + +Manages the custom permissions profile for a user. + +## Example Usage + +```terraform +resource "aws_quicksight_user_custom_permission" "example" { + user_name = aws_quicksight_user.example.user_name + custom_permissions_name = aws_quicksight_custom_permissions.example.custom_permissions_name +} +``` + +## Argument Reference + +The following arguments are required: + +* `custom_permissions_name` - (Required, Forces new resource) Custom permissions profile name. +* `user_name` - (Required, Forces new resource) Username of the user. + +The following arguments are optional: + +* `aws_account_id` - (Optional, Forces new resource) AWS account ID. Defaults to automatically determined account ID of the Terraform AWS provider. +* `namespace` - (Optional, Forces new resource) Namespace that the user belongs to. Defaults to `default`. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). + +## Attribute Reference + +This resource exports no additional attributes. + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QuickSight user custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace` and `user_name`. For example: + +```terraform +import { + to = aws_quicksight_user_custom_permission.example + id = "012345678901,default,user1" +} +``` + +Using `terraform import`, import QuickSight user custom permissions using a comma-delimited string combining the `aws_account_id`, `namespace`, and `user_name`. For example: + +```console +% terraform import aws_quicksight_user_custom_permission.example 012345678901,default,user1 +``` diff --git a/website/docs/r/rds_instance_state.html.markdown b/website/docs/r/rds_instance_state.html.markdown index 3ecc6cbefece..56de232f09b7 100644 --- a/website/docs/r/rds_instance_state.html.markdown +++ b/website/docs/r/rds_instance_state.html.markdown @@ -33,9 +33,7 @@ This resource supports the following arguments: ## Attribute Reference -This resource exports the following attributes in addition to the arguments above: - -* `identifier` - DB Instance Identifier +This resource exports no additional attributes. ## Timeouts @@ -46,7 +44,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```terraform import { @@ -55,7 +53,7 @@ import { } ``` -Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `example_id_arg`. For example: +Using `terraform import`, import RDS (Relational Database) RDS Instance State using the `identifier`. For example: ```console % terraform import aws_rds_instance_state.example rds_instance_state-id-12345678 diff --git a/website/docs/r/rekognition_collection.html.markdown b/website/docs/r/rekognition_collection.html.markdown index cf8859799a02..d617aad1e126 100644 --- a/website/docs/r/rekognition_collection.html.markdown +++ b/website/docs/r/rekognition_collection.html.markdown @@ -49,7 +49,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Collection using the `collection_id`. For example: ```terraform import { @@ -58,7 +58,7 @@ import { } ``` -Using `terraform import`, import Rekognition Collection using the `example_id_arg`. For example: +Using `terraform import`, import Rekognition Collection using the `collection_id`. For example: ```console % terraform import aws_rekognition_collection.example collection-id-12345678 diff --git a/website/docs/r/rekognition_project.html.markdown b/website/docs/r/rekognition_project.html.markdown index c1bb5f974c61..4b4deaa4d211 100644 --- a/website/docs/r/rekognition_project.html.markdown +++ b/website/docs/r/rekognition_project.html.markdown @@ -61,7 +61,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Rekognition Project using the `name`. For example: ```terraform import { diff --git a/website/docs/r/route53_resolver_endpoint.html.markdown b/website/docs/r/route53_resolver_endpoint.html.markdown index 751add9f6f38..df302b87f679 100644 --- a/website/docs/r/route53_resolver_endpoint.html.markdown +++ b/website/docs/r/route53_resolver_endpoint.html.markdown @@ -46,8 +46,7 @@ This resource supports the following arguments: * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `direction` - (Required) Direction of DNS queries to or from the Route 53 Resolver endpoint. -Valid values are `INBOUND` (resolver forwards DNS queries to the DNS service for a VPC from your network or another VPC) -or `OUTBOUND` (resolver forwards DNS queries from the DNS service for a VPC to your network or another VPC). +Valid values are `INBOUND` (resolver forwards DNS queries to the DNS service for a VPC from your network or another VPC), `OUTBOUND` (resolver forwards DNS queries from the DNS service for a VPC to your network or another VPC) or `INBOUND_DELEGATION` (resolver delegates queries to Route 53 private hosted zones from your network). * `ip_address` - (Required) Subnets and IP addresses in your VPC that you want DNS queries to pass through on the way from your VPCs to your network (for outbound endpoints) or on the way from your network to your VPCs (for inbound endpoints). Described below. * `name` - (Optional) Friendly name of the Route 53 Resolver endpoint. diff --git a/website/docs/r/route53profiles_association.html.markdown b/website/docs/r/route53profiles_association.html.markdown index 038a1def3c90..ed8fb921b297 100644 --- a/website/docs/r/route53profiles_association.html.markdown +++ b/website/docs/r/route53profiles_association.html.markdown @@ -72,7 +72,7 @@ import { } ``` -Using `terraform import`, import Route 53 Profiles Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Association using the `id`. For example: ```console % terraform import aws_route53profiles_association.example rpa-id-12345678 diff --git a/website/docs/r/route53profiles_profile.html.markdown b/website/docs/r/route53profiles_profile.html.markdown index 1eb323762bdc..aa5a067a226b 100644 --- a/website/docs/r/route53profiles_profile.html.markdown +++ b/website/docs/r/route53profiles_profile.html.markdown @@ -54,7 +54,7 @@ This resource exports the following attributes in addition to the arguments abov ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `example_id_arg`. For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Route 53 Profiles Profile using the `id`. For example: ```terraform import { @@ -63,7 +63,7 @@ import { } ``` -Using `terraform import`, import Route 53 Profiles Profile using the `example`. For example: +Using `terraform import`, import Route 53 Profiles Profile using the `id`. For example: ```console % terraform import aws_route53profiles_profile.example rp-12345678 diff --git a/website/docs/r/route53profiles_resource_association.html.markdown b/website/docs/r/route53profiles_resource_association.html.markdown index 1e2b01996900..995ba99fb3d3 100644 --- a/website/docs/r/route53profiles_resource_association.html.markdown +++ b/website/docs/r/route53profiles_resource_association.html.markdown @@ -77,7 +77,7 @@ import { } ``` -Using `terraform import`, import Route 53 Profiles Resource Association using the `example_id_arg`. For example: +Using `terraform import`, import Route 53 Profiles Resource Association using the `id`. For example: ```console % terraform import aws_route53profiles_resource_association.example rpa-id-12345678 diff --git a/website/docs/r/s3_access_point.html.markdown b/website/docs/r/s3_access_point.html.markdown index e08c24fd221e..bd8324242849 100644 --- a/website/docs/r/s3_access_point.html.markdown +++ b/website/docs/r/s3_access_point.html.markdown @@ -82,11 +82,12 @@ The following arguments are required: The following arguments are optional: -* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `account_id` - (Optional) AWS account ID for the owner of the bucket for which you want to create an access point. Defaults to automatically determined account ID of the Terraform AWS provider. * `bucket_account_id` - (Optional) AWS account ID associated with the S3 bucket associated with this access point. * `policy` - (Optional) Valid JSON document that specifies the policy that you want to apply to this access point. Removing `policy` from your configuration or setting `policy` to null or an empty string (i.e., `policy = ""`) _will not_ delete the policy since it could have been set by `aws_s3control_access_point_policy`. To remove the `policy`, set it to `"{}"` (an empty JSON document). * `public_access_block_configuration` - (Optional) Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `tags` - (Optional) Map of tags to assign to the bucket. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_configuration` - (Optional) Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Required for S3 on Outposts. Detailed below. ### public_access_block_configuration Configuration Block @@ -122,6 +123,7 @@ Note: S3 access points only support secure access by HTTPS. HTTP isn't supported * `has_public_access_policy` - Indicates whether this access point currently has a policy that allows public access. * `id` - For Access Point of an AWS Partition S3 Bucket, the AWS account ID and access point name separated by a colon (`:`). For S3 on Outposts Bucket, the ARN of the Access Point. * `network_origin` - Indicates whether this access point allows access from the public Internet. Values are `VPC` (the access point doesn't allow access from the public Internet) and `Internet` (the access point allows access from the public Internet, subject to the access point and bucket access policies). +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Import diff --git a/website/docs/r/securityhub_standards_subscription.html.markdown b/website/docs/r/securityhub_standards_subscription.html.markdown index abea85bc7379..497bc4bdb212 100644 --- a/website/docs/r/securityhub_standards_subscription.html.markdown +++ b/website/docs/r/securityhub_standards_subscription.html.markdown @@ -45,7 +45,9 @@ Currently available standards (remember to replace `${var.partition}` and `${var | CIS AWS Foundations Benchmark v1.4.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/1.4.0` | | CIS AWS Foundations Benchmark v3.0.0 | `arn:${var.partition}:securityhub:${var.region}::standards/cis-aws-foundations-benchmark/v/3.0.0` | | NIST SP 800-53 Rev. 5 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-53/v/5.0.0` | -| PCI DSS | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| NIST SP 800-171 Rev. 2 | `arn:${var.partition}:securityhub:${var.region}::standards/nist-800-171/v/2.0.0` | +| PCI DSS v3.2.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/3.2.1` | +| PCI DSS v4.0.1 | `arn:${var.partition}:securityhub:${var.region}::standards/pci-dss/v/4.0.1` | ## Attribute Reference diff --git a/website/docs/r/sesv2_email_identity_policy.html.markdown b/website/docs/r/sesv2_email_identity_policy.html.markdown index 9ca457d961f3..5b1d5c718ea0 100644 --- a/website/docs/r/sesv2_email_identity_policy.html.markdown +++ b/website/docs/r/sesv2_email_identity_policy.html.markdown @@ -63,7 +63,7 @@ This resource exports no additional attributes. ## Import -In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `id` (`email_identity|policy_name`). For example: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity Policy using the `email_identity` and `policy_name` separated by `|`. For example: ```terraform import { @@ -72,7 +72,7 @@ import { } ``` -Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `example_id_arg`. For example: +Using `terraform import`, import SESv2 (Simple Email V2) Email Identity Policy using the `email_identity` and `policy_name` separated by `|`. For example: ```console % terraform import aws_sesv2_email_identity_policy.example example_email_identity|example_policy_name diff --git a/website/docs/r/wafv2_regex_pattern_set.html.markdown b/website/docs/r/wafv2_regex_pattern_set.html.markdown index 8921d27f5dae..71c2b55a2c9f 100644 --- a/website/docs/r/wafv2_regex_pattern_set.html.markdown +++ b/website/docs/r/wafv2_regex_pattern_set.html.markdown @@ -42,7 +42,7 @@ This resource supports the following arguments: * `name_prefix` - (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `name`. * `description` - (Optional) A friendly description of the regular expression pattern set. * `scope` - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. -* `regular_expression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. A maximum of 10 `regular_expression` blocks may be specified. +* `regular_expression` - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. See [Regular Expression](#regular-expression) below for details. * `tags` - (Optional) An array of key:value pairs to associate with the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### Regular Expression diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index 92d57d08029d..5e04af1894ca 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -12,6 +12,8 @@ Creates a WAFv2 Web ACL resource. ~> **Note** In `field_to_match` blocks, _e.g._, in `byte_match_statement`, the `body` block includes an optional argument `oversize_handling`. AWS indicates this argument will be required starting February 2023. To avoid configurations breaking when that change happens, treat the `oversize_handling` argument as **required** as soon as possible. +!> **Warning:** If you use the `aws_wafv2_web_acl_rule_group_association` resource to associate rule groups with this Web ACL, you must add `lifecycle { ignore_changes = [rule] }` to this resource to prevent configuration drift. The association resource modifies the Web ACL's rules outside of this resource's direct management. + ## Example Usage This resource is based on `aws_wafv2_rule_group`, check the documentation of the `aws_wafv2_rule_group` resource to see examples of the various available statements. diff --git a/website/docs/r/wafv2_web_acl_rule_group_association.html.markdown b/website/docs/r/wafv2_web_acl_rule_group_association.html.markdown new file mode 100644 index 000000000000..81e2a614ede9 --- /dev/null +++ b/website/docs/r/wafv2_web_acl_rule_group_association.html.markdown @@ -0,0 +1,504 @@ +--- +subcategory: "WAF" +layout: "aws" +page_title: "AWS: aws_wafv2_web_acl_rule_group_association" +description: |- + Associates a WAFv2 Rule Group with a Web ACL by adding a rule that references the Rule Group. +--- + +# Resource: aws_wafv2_web_acl_rule_group_association + +Associates a WAFv2 Rule Group (custom or managed) with a Web ACL by adding a rule that references the Rule Group. Use this resource to apply the rules defined in a Rule Group to a Web ACL without duplicating rule definitions. + +This resource supports both: + +- **Custom Rule Groups**: User-created rule groups that you manage within your AWS account +- **Managed Rule Groups**: Pre-configured rule groups provided by AWS or third-party vendors + +!> **Warning:** Verify the rule names in your `rule_action_override`s carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. + +!> **Warning:** Using this resource will cause the associated Web ACL resource to show configuration drift in the `rule` argument unless you add `lifecycle { ignore_changes = [rule] }` to the Web ACL resource configuration. This is because this resource modifies the Web ACL's rules outside of the Web ACL resource's direct management. + +~> **Note:** This resource creates a rule within the Web ACL that references the entire Rule Group. The rule group's individual rules are evaluated as a unit when requests are processed by the Web ACL. + +## Example Usage + +### Custom Rule Group - Basic Usage + +```terraform +resource "aws_wafv2_rule_group" "example" { + name = "example-rule-group" + scope = "REGIONAL" + capacity = 10 + + rule { + name = "block-suspicious-requests" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["CN", "RU"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "block-suspicious-requests" + sampled_requests_enabled = true + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "example-rule-group" + sampled_requests_enabled = true + } +} + +resource "aws_wafv2_web_acl" "example" { + name = "example-web-acl" + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "example-web-acl" + sampled_requests_enabled = true + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "example" { + rule_name = "example-rule-group-rule" + priority = 100 + web_acl_arn = aws_wafv2_web_acl.example.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.example.arn + } +} +``` + +### Managed Rule Group - Basic Usage + +```terraform +resource "aws_wafv2_web_acl" "example" { + name = "example-web-acl" + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "example-web-acl" + sampled_requests_enabled = true + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "managed_example" { + rule_name = "aws-common-rule-set" + priority = 50 + web_acl_arn = aws_wafv2_web_acl.example.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + } +} +``` + +### Managed Rule Group - With Version + +```terraform +resource "aws_wafv2_web_acl_rule_group_association" "managed_versioned" { + rule_name = "aws-common-rule-set-versioned" + priority = 60 + web_acl_arn = aws_wafv2_web_acl.example.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + version = "Version_1.0" + } +} +``` + +### Managed Rule Group - With Rule Action Overrides + +```terraform +resource "aws_wafv2_web_acl_rule_group_association" "managed_with_overrides" { + rule_name = "aws-common-rule-set-with-overrides" + priority = 70 + web_acl_arn = aws_wafv2_web_acl.example.arn + + managed_rule_group { + name = "AWSManagedRulesCommonRuleSet" + vendor_name = "AWS" + + # Override specific rules within the managed rule group + rule_action_override { + name = "GenericRFI_BODY" + action_to_use { + count { + custom_request_handling { + insert_header { + name = "X-RFI-Override" + value = "counted" + } + } + } + } + } + + rule_action_override { + name = "SizeRestrictions_BODY" + action_to_use { + captcha {} + } + } + } +} +``` + +### Custom Rule Group - With Override Action + +```terraform +resource "aws_wafv2_web_acl_rule_group_association" "example" { + rule_name = "example-rule-group-rule" + priority = 100 + web_acl_arn = aws_wafv2_web_acl.example.arn + override_action = "count" + + rule_group_reference { + arn = aws_wafv2_rule_group.example.arn + } +} +``` + +### Custom Rule Group - With Rule Action Overrides + +```terraform +resource "aws_wafv2_rule_group" "example" { + name = "example-rule-group" + scope = "REGIONAL" + capacity = 10 + + rule { + name = "geo-block-rule" + priority = 1 + + action { + block {} + } + + statement { + geo_match_statement { + country_codes = ["CN", "RU"] + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "geo-block-rule" + sampled_requests_enabled = true + } + } + + rule { + name = "rate-limit-rule" + priority = 2 + + action { + block {} + } + + statement { + rate_based_statement { + limit = 1000 + aggregate_key_type = "IP" + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "rate-limit-rule" + sampled_requests_enabled = true + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "example-rule-group" + sampled_requests_enabled = true + } +} + +resource "aws_wafv2_web_acl" "example" { + name = "example-web-acl" + scope = "REGIONAL" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "example-web-acl" + sampled_requests_enabled = true + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "example" { + rule_name = "example-rule-group-rule" + priority = 100 + web_acl_arn = aws_wafv2_web_acl.example.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.example.arn + + # Override specific rules within the rule group + rule_action_override { + name = "geo-block-rule" + action_to_use { + count { + custom_request_handling { + insert_header { + name = "X-Geo-Block-Override" + value = "counted" + } + } + } + } + } + + rule_action_override { + name = "rate-limit-rule" + action_to_use { + captcha { + custom_request_handling { + insert_header { + name = "X-Rate-Limit-Override" + value = "captcha-required" + } + } + } + } + } + } +} +``` + +### Custom Rule Group - CloudFront Web ACL + +```terraform +resource "aws_wafv2_rule_group" "cloudfront_example" { + name = "cloudfront-rule-group" + scope = "CLOUDFRONT" + capacity = 10 + + rule { + name = "rate-limit" + priority = 1 + + action { + block {} + } + + statement { + rate_based_statement { + limit = 2000 + aggregate_key_type = "IP" + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "rate-limit" + sampled_requests_enabled = true + } + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "cloudfront-rule-group" + sampled_requests_enabled = true + } +} + +resource "aws_wafv2_web_acl" "cloudfront_example" { + name = "cloudfront-web-acl" + scope = "CLOUDFRONT" + + default_action { + allow {} + } + + visibility_config { + cloudwatch_metrics_enabled = true + metric_name = "cloudfront-web-acl" + sampled_requests_enabled = true + } + + lifecycle { + ignore_changes = [rule] + } +} + +resource "aws_wafv2_web_acl_rule_group_association" "cloudfront_example" { + rule_name = "cloudfront-rule-group-rule" + priority = 50 + web_acl_arn = aws_wafv2_web_acl.cloudfront_example.arn + + rule_group_reference { + arn = aws_wafv2_rule_group.cloudfront_example.arn + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `rule_name` - (Required) Name of the rule to create in the Web ACL that references the rule group. Must be between 1 and 128 characters. +* `priority` - (Required) Priority of the rule within the Web ACL. Rules are evaluated in order of priority, with lower numbers evaluated first. +* `web_acl_arn` - (Required) ARN of the Web ACL to associate the Rule Group with. + +The following arguments are optional: + +* `managed_rule_group` - (Optional) Managed Rule Group configuration. One of `rule_group_reference` or `managed_rule_group` is required. Conflicts with `rule_group_reference`. [See below](#managed_rule_group). +* `override_action` - (Optional) Override action for the rule group. Valid values are `none` and `count`. Defaults to `none`. When set to `count`, the actions defined in the rule group rules are overridden to count matches instead of blocking or allowing requests. +* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). +* `rule_group_reference` - (Optional) Custom Rule Group reference configuration. One of `rule_group_reference` or `managed_rule_group` is required. Conflicts with `managed_rule_group`. [See below](#rule_group_reference). + +### rule_group_reference + +* `arn` - (Required) ARN of the Rule Group to associate with the Web ACL. +* `rule_action_override` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### managed_rule_group + +* `name` - (Required) Name of the managed rule group. +* `vendor_name` - (Required) Name of the managed rule group vendor. For AWS managed rule groups, this is `AWS`. +* `version` - (Optional) Version of the managed rule group. If not specified, the default version is used. +* `rule_action_override` - (Optional) Override actions for specific rules within the rule group. [See below](#rule_action_override). + +### rule_action_override + +* `name` - (Required) Name of the rule to override within the rule group. Verify the name carefully. With managed rule groups, WAF silently ignores any override that uses an invalid rule name. With customer-owned rule groups, invalid rule names in your overrides will cause web ACL updates to fail. An invalid rule name is any name that doesn't exactly match the case-sensitive name of an existing rule in the rule group. +* `action_to_use` - (Required) Action to use instead of the rule's original action. [See below](#action_to_use). + +### action_to_use + +Exactly one of the following action blocks must be specified: + +* `allow` - (Optional) Allow the request. [See below](#allow). +* `block` - (Optional) Block the request. [See below](#block). +* `captcha` - (Optional) Require CAPTCHA verification. [See below](#captcha). +* `challenge` - (Optional) Require challenge verification. [See below](#challenge). +* `count` - (Optional) Count the request without taking action. [See below](#count). + +### allow + +* `custom_request_handling` - (Optional) Custom handling for allowed requests. [See below](#custom_request_handling). + +### block + +* `custom_response` - (Optional) Custom response for blocked requests. [See below](#custom_response). + +### captcha + +* `custom_request_handling` - (Optional) Custom handling for CAPTCHA requests. [See below](#custom_request_handling). + +### challenge + +* `custom_request_handling` - (Optional) Custom handling for challenge requests. [See below](#custom_request_handling). + +### count + +* `custom_request_handling` - (Optional) Custom handling for counted requests. [See below](#custom_request_handling). + +### custom_request_handling + +* `insert_header` - (Required) Headers to insert into the request. [See below](#insert_header). + +### custom_response + +* `custom_response_body_key` - (Optional) Key of a custom response body to use. +* `response_code` - (Required) HTTP response code to return (200-599). +* `response_header` - (Optional) Headers to include in the response. [See below](#response_header). + +### insert_header + +* `name` - (Required) Name of the header to insert. +* `value` - (Required) Value of the header to insert. + +### response_header + +* `name` - (Required) Name of the response header. +* `value` - (Required) Value of the response header. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +None. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `update` - (Default `30m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```terraform +import { + to = aws_wafv2_web_acl_rule_group_association.example + id = "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule" +} +``` + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```terraform +import { + to = aws_wafv2_web_acl_rule_group_association.managed_example + id = "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set" +} +``` + +Using `terraform import`, import WAFv2 web ACL custom rule group associations using `WebACLARN,RuleGroupARN,RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,arn:aws:wafv2:us-east-1:123456789012:regional/rulegroup/example-rule-group/87654321-4321-4321-4321-210987654321,example-rule-group-rule" +``` + +Using `terraform import`, import WAFv2 web ACL managed rule group associations using `WebACLARN,VendorName:RuleGroupName[:Version],RuleName`. For example: + +```console +% terraform import aws_wafv2_web_acl_rule_group_association.managed_example "arn:aws:wafv2:us-east-1:123456789012:regional/webacl/example-web-acl/12345678-1234-1234-1234-123456789012,AWS:AWSManagedRulesCommonRuleSet,aws-common-rule-set" +```