terraform-aws-ssm-patch-manager icon indicating copy to clipboard operation
terraform-aws-ssm-patch-manager copied to clipboard

chore: bumps examples/complete ec2-instance module (Closes #31)

Open Gowiem opened this issue 1 year ago • 8 comments

what

  • Continues the work from #31 to bump the module version and also update the configuration

why

  • Stays on latest module version in our example
  • We're no longer passing a hardcoded AMI (AMI must have been deprecated because it was causing tests to fail)

references

  • Closes #31

Gowiem avatar Feb 24 '24 05:02 Gowiem

/terratest

Gowiem avatar Feb 24 '24 05:02 Gowiem

/terratest

Gowiem avatar Feb 24 '24 05:02 Gowiem

The last test returns this error

TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOPATCH): AlreadyExistsException: Patch Group TOPATCH already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   with module.ssm_patch_manager.aws_ssm_patch_group.install_patchgroup[0],
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   on ../../main.tf line 210, in resource "aws_ssm_patch_group" "install_patchgroup":
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │  210: resource "aws_ssm_patch_group" "install_patchgroup" {
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: ╵
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: ╷
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOSCAN): AlreadyExistsException: Patch Group TOSCAN already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   with module.ssm_patch_manager.aws_ssm_patch_group.scan_patchgroup[0],
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   on ../../main.tf line 216, in resource "aws_ssm_patch_group" "scan_patchgroup":
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │  216: resource "aws_ssm_patch_group" "scan_patchgroup" {
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: ╵
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: ╷
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ Error: creating EC2 Instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 	status code: 400, request id: 7f17a1a8-bbcf-47eb-a4f1-ecb0c6fe3444
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   with module.ec2_instance.aws_instance.default[0],
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │   on .terraform/modules/ec2_instance/main.tf line 104, in resource "aws_instance" "default":
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │  104: resource "aws_instance" "default" {
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: │ 
TestExamplesComplete 2024-02-24T05:35:16Z logger.go:66: ╵
TestExamplesComplete 2024-02-24T05:35:16Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOPATCH): AlreadyExistsException: Patch Group TOPATCH already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
│ 
│   with module.ssm_patch_manager.aws_ssm_patch_group.install_patchgroup[0],
│   on ../../main.tf line 210, in resource "aws_ssm_patch_group" "install_patchgroup":
│  210: resource "aws_ssm_patch_group" "install_patchgroup" {
│ 
╵
╷
│ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOSCAN): AlreadyExistsException: Patch Group TOSCAN already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
│ 
│   with module.ssm_patch_manager.aws_ssm_patch_group.scan_patchgroup[0],
│   on ../../main.tf line 216, in resource "aws_ssm_patch_group" "scan_patchgroup":
│  216: resource "aws_ssm_patch_group" "scan_patchgroup" {
│ 
╵
╷
│ Error: creating EC2 Instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
│ 	status code: 400, request id: 7f17a1a8-bbcf-47eb-a4f1-ecb0c6fe3444
│ 
│   with module.ec2_instance.aws_instance.default[0],
│   on .terraform/modules/ec2_instance/main.tf line 104, in resource "aws_instance" "default":
│  104: resource "aws_instance" "default" {
│ 
╵}
    apply.go:15: 
        	Error Trace:	apply.go:15
        	            				examples_complete_test.go:37
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; ╷
        	            	│ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOPATCH): AlreadyExistsException: Patch Group TOPATCH already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
        	            	│ 
        	            	│   with module.ssm_patch_manager.aws_ssm_patch_group.install_patchgroup[0],
        	            	│   on ../../main.tf line 210, in resource "aws_ssm_patch_group" "install_patchgroup":
        	            	│  210: resource "aws_ssm_patch_group" "install_patchgroup" {
        	            	│ 
        	            	╵
        	            	╷
        	            	│ Error: registering SSM Patch Baseline (pb-009c41ffb525fbcc5) for Patch Group (TOSCAN): AlreadyExistsException: Patch Group TOSCAN already has a baseline registered for OperatingSystem AMAZON_LINUX_2.
        	            	│ 
        	            	│   with module.ssm_patch_manager.aws_ssm_patch_group.scan_patchgroup[0],
        	            	│   on ../../main.tf line 216, in resource "aws_ssm_patch_group" "scan_patchgroup":
        	            	│  216: resource "aws_ssm_patch_group" "scan_patchgroup" {
        	            	│ 
        	            	╵
        	            	╷
        	            	│ Error: creating EC2 Instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	            	│ 	status code: 400, request id: 7f17a1a8-bbcf-47eb-a4f1-ecb0c6fe3444
        	            	│ 
        	            	│   with module.ec2_instance.aws_instance.default[0],
        	            	│   on .terraform/modules/ec2_instance/main.tf line 104, in resource "aws_instance" "default":
        	            	│  104: resource "aws_instance" "default" {
        	            	│ 
        	            	╵}
        	Test:       	TestExamplesComplete
TestExamplesComplete 2024-02-24T05:35:16Z retry.go:91: terraform [destroy -auto-approve -input=false -var attributes=["24560"] -var-file fixtures.us-east-2.tfvars -lock=false]

nitrocode avatar Feb 24 '24 15:02 nitrocode

/terratest

nitrocode avatar Feb 24 '24 15:02 nitrocode

Hm... I'm not sure what the deal is here. @jamengual have you run into this error before with your work using Patch manager?

Gowiem avatar Feb 27 '24 00:02 Gowiem

/terratest

jamengual avatar Feb 27 '24 00:02 jamengual

Hm... I'm not sure what the deal is here. @jamengual have you run into this error before with your work using Patch manager?

not really. maybe we hit a limit on the CP test account? we might need support from CP to check the test account trail.

jamengual avatar Feb 27 '24 00:02 jamengual

/terratest

hans-d avatar Mar 03 '24 12:03 hans-d