hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
241 stars 109 forks source link

awscc_signer_signing_profile: adding tags fails apply with model validation failure #1673

Open quixoticmonk opened 2 months ago

quixoticmonk commented 2 months ago

Community Note

Terraform CLI and Terraform AWS Cloud Control Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.


resource "awscc_signer_signing_profile" "example" {
  platform_id = "AWSLambda-SHA384-ECDSA"

  signature_validity_period ={
    value = 5
    type  = "YEARS"
  }

  tags = [{
    key   = "Modified By"
    value = "AWSCC"
  }]
}

Debug Output

Panic Output

Expected Behavior

The signing profile should be created.

Actual Behavior

Recieved the below error message.

  # awscc_signer_signing_profile.example will be created
  + resource "awscc_signer_signing_profile" "example" {
      + arn                       = (known after apply)
      + id                        = (known after apply)
      + platform_id               = "AWSLambda-SHA384-ECDSA"
      + profile_name              = (known after apply)
      + profile_version           = (known after apply)
      + profile_version_arn       = (known after apply)
      + signature_validity_period = {
          + type  = "YEARS"
          + value = 5
        }
      + tags                      = [
          + {
              + key   = "Modified By"
              + value = "AWSCC"
            },
        ]
    }

Plan: 1 to add, 0 to change, 0 to destroy.
awscc_signer_signing_profile.example: Creating...
╷
│ Error: AWS SDK Go Service Operation Unsuccessful
│
│   with awscc_signer_signing_profile.example,
│   on main.tf line 5, in resource "awscc_signer_signing_profile" "example":
│    5: resource "awscc_signer_signing_profile" "example" {
│
│ Calling Cloud Control API service CreateResource operation returned: operation error
│ CloudControl: CreateResource, https response error StatusCode: 400, RequestID:
│ 1d2e29b2-e0c9-4cb6-b2f9-53a4c966e220, api error ValidationException: Model validation
│ failed (#/Tags/0/Key: failed validation constraint for keyword [pattern])

Steps to Reproduce

  1. terraform apply

Important Factoids

References

quixoticmonk commented 2 months ago

This is happening on the awscc_codebuild_fleet resource as well.

with awscc_codebuild_fleet.example,
│   on main.tf line 1, in resource "awscc_codebuild_fleet" "example":
│    1: resource "awscc_codebuild_fleet" "example" {
│
│ Calling Cloud Control API service UpdateResource operation returned: operation error
│ CloudControl: UpdateResource, https response error StatusCode: 400, RequestID:
│ ce98f925-e654-4cc6-9726-429bb7f43c55, api error ValidationException: Model validation
│ failed (#/Tags/0/Key: failed validation constraint for keyword [pattern])