Open andyshinn opened 3 years ago
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Not stale.
Yes, Its not stale. The problem continues to persist in the latest version of Terraform. As mentioned earlier, when we enable the SecurityHub control via Terraform and subsequently attempt to disable it using Terraform, an error occurs.
resource "aws_securityhub_standards_subscription" "pci_dss_v_3_2_1" {
standards_arn = "arn:aws:securityhub:${data.aws_region.current.name}::standards/pci-dss/v/3.2.1"
}
resource "aws_securityhub_standards_control" "disable_security_control" {
standards_control_arn = "arn:aws:securityhub:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:control/pci-dss/v/3.2.1/PCI.IAM.4
control_status = "DISABLED"
disabled_reason = "Disabling control"
depends_on = [
aws_securityhub_standards_subscription.pci_dss_v_3_2_1
]
}
Steps to Reproduce (This happening randomly - not all time)
Error: updating Security Hub Standards Control (arn:aws:securityhub:iiii:iiii:control/pci-dss/v/3.2.1/PCI.IAM.4): ResourceNotFoundException: StandardsControl not found
{
RespMetadata: {
StatusCode: 404,
},
Code_: "ResourceNotFoundException",
Message_: "StandardsControl not found"
}
Community Note
Terraform CLI and Terraform AWS 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.
Debug Output
https://gist.github.com/andyshinn/32aa411e57e3fa9ef9563760dc14fcf4
Panic Output
Expected Behavior
Existing resource ignored as it already exists in state (even if it is a special resource).
Actual Behavior
Error occurs:
Steps to Reproduce
control_status
to "ENABLED".terraform apply
control_status
to "DISABLED".terraform apply
Important Factoids
References