terraform-provider-awscc icon indicating copy to clipboard operation
terraform-provider-awscc copied to clipboard

awscc_inspectorv2_cis_scan_configuration: subsequent terraform apply shows updates

Open quixoticmonk opened this issue 9 months ago • 4 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

terraform -v
Terraform v1.7.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.50.0
+ provider registry.terraform.io/hashicorp/awscc v0.78.0

Affected Resource(s)

  • awscc_inspectorv2_cis_scan_configuration

Terraform Configuration Files

resource "awscc_inspectorv2_cis_scan_configuration" "example" {
  scan_name = "example"
  schedule = {
    daily = {
      start_time = {
        time_of_day = "00:00"
        time_zone   = "UTC"
      }
    }
  }

  security_level = "LEVEL_1"
  targets = {
    account_ids = ["123456789012"]
    target_resource_tags = {
      "Modified By" = ["AWSCC"]
    }

  }

  tags = {
    "Modified By" = "AWSCC"
  }
}

Debug Output

Panic Output

Expected Behavior

Expected Terraform to display " No changes detected. .." showcasing the idempotencty of the operation.

Actual Behavior

Terraform identified changes required in two places on a subsequent terraform apply when the configuration didn't change.

  • schedule where the daily one was conifgured and others were not set.
  • targt account_ids was noted as SELF and modified to the target account number. Terraform state has the account_id in the value than SELF. This drift is peculiar since the state also matches the target configuration.
  ~ update in-place

Terraform will perform the following actions:

  # awscc_inspectorv2_cis_scan_configuration.example will be updated in-place
  ~ resource "awscc_inspectorv2_cis_scan_configuration" "example" {
        id             = "arn:aws:inspector2:us-east-1:123456789012:owner/123456789012/cis-configuration/a6add744-7bbf-43fc-8aff-0e4bba35f1b9"
      ~ schedule       = {
          + monthly  = (known after apply)
          + one_time = (known after apply)
          + weekly   = (known after apply)
            # (1 unchanged attribute hidden)
        }
        tags           = {
            "Modified By" = "AWSCC"
        }
      ~ targets        = {
          ~ account_ids          = [
              - "SELF",
              + "123456789012",
            ]
            # (1 unchanged attribute hidden)
        }
        # (3 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Important Factoids

References

quixoticmonk avatar May 24 '24 17:05 quixoticmonk