-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple task_parameter blocks in aws_ssm_maintenance_window_task do not apply in idempotent manner #3218
Comments
be good to see both resolved 👍 |
I can confirm. I see this in 0.11.8 as well. |
Same problem on Terraform 0.11.10 with the AWS provider 1.57.0. |
…rdering differences Reference: #3218 Previously (before code update): ``` --- FAIL: TestAccAWSSSMMaintenanceWindowTask_TaskParameters (12.95s) testing.go:568: Step 0 error: After applying this step, the plan was not empty: DIFF: UPDATE: aws_ssm_maintenance_window_task.test ... task_parameters.#: "3" => "3" task_parameters.0.name: "commandLine" => "sourceType" task_parameters.0.values.#: "1" => "1" task_parameters.0.values.0: "date" => "s3" task_parameters.1.name: "sourceInfo" => "sourceInfo" task_parameters.1.values.#: "1" => "1" task_parameters.1.values.0: "https://s3.amazonaws.com/bucket" => "https://s3.amazonaws.com/bucket" task_parameters.2.name: "sourceType" => "commandLine" task_parameters.2.values.#: "1" => "1" task_parameters.2.values.0: "s3" => "date" ``` Output from acceptance testing: ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskParameters (18.13s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (126.33s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (127.14s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (157.65s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (158.38s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (178.09s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (233.40s) ```
Fix submitted: #9364 |
Reference: #3218 Previously (before code update): ``` --- FAIL: TestAccAWSSSMMaintenanceWindowTask_TaskParameters (12.95s) testing.go:568: Step 0 error: After applying this step, the plan was not empty: DIFF: UPDATE: aws_ssm_maintenance_window_task.test ... task_parameters.#: "3" => "3" task_parameters.0.name: "commandLine" => "sourceType" task_parameters.0.values.#: "1" => "1" task_parameters.0.values.0: "date" => "s3" task_parameters.1.name: "sourceInfo" => "sourceInfo" task_parameters.1.values.#: "1" => "1" task_parameters.1.values.0: "https://s3.amazonaws.com/bucket" => "https://s3.amazonaws.com/bucket" task_parameters.2.name: "sourceType" => "commandLine" task_parameters.2.values.#: "1" => "1" task_parameters.2.values.0: "s3" => "date" ``` Output from acceptance testing: ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskParameters (18.13s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (126.33s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (127.14s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (157.65s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (158.38s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (178.09s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (233.40s) ```
The fix to the |
The fix to the For further feature requests or bug reports with this resource, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
Terraform Configuration Files
Debug Output
Expected Behavior
After the above configuration is applied, all else being equal, running
terraform apply
again should result in no infrastructure changes.Actual Behavior
Running
terraform apply
results in terraform wanting to destroy and create theaws_ssm_maintenance_window_task
again, since the order in which multipletask_parameter
s are matched up is ostensibly not guaranteed. For instance, the below output shows thetask_parameter
ordering causes terraform to think the resource has changed in the config, even though it hasn't:Running
terraform apply
again may showtask_parameter
s matched up in different ways, and may even show no infrastructure changes required if you win the lottery and everything happens to match up evenly.Steps to Reproduce
terraform init
aws_ssm_maintenance_window_task
and multipletask_parameter
blocks. (Note: there are SSM maintenance tasks that require more than one task parameter, so this should be a valid use case)terraform apply
=> results in maintenance window task being applied.terraform apply
=> most likely results in a plan where the maintenance window task wants to be recreated due to the multipletask_parameter
blocks not matching up.Additional Context
Hopefully nothing abnormal here in my setup, running the latest terraform and latest AWS provider on a MBP (10.13.3).
References
#2876 mentions behavior like this, but it's buried in a feature request and doesn't have much detail, so I figured I'd expand on it here.
The text was updated successfully, but these errors were encountered: