Skip to content
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

aws_ssm_maintenance_window_task logging_info s3_bucket_name doesn't support update #7154

Closed
jeohist opened this issue Jan 16, 2019 · 4 comments · Fixed by #7823
Closed

aws_ssm_maintenance_window_task logging_info s3_bucket_name doesn't support update #7154

jeohist opened this issue Jan 16, 2019 · 4 comments · Fixed by #7823
Labels
bug Addresses a defect in current functionality. service/ssm Issues and PRs that pertain to the ssm service.
Milestone

Comments

@jeohist
Copy link
Contributor

jeohist commented Jan 16, 2019

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 "me too" comments, 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

Terraform Version

Terraform v0.11.11
provider "aws" (1.56.0)

Affected Resource(s)

  • aws_ssm_maintenance_window_task

Terraform Configuration Files

I've removed all non-relevant data:

Original state:

resource "aws_ssm_maintenance_window_task" "foo" {
  window_id        = "${aws_ssm_maintenance_window.foo.id}"
  task_type        = "RUN_COMMAND"
  task_arn         = "AWS-RunPatchBaseline"
  service_role_arn = "${aws_iam_service_linked_role.ssm_maintenance_service_role.arn}"

  max_concurrency = "1"
  max_errors      = "100"

  targets {
    key    = "WindowTargetIds"
    values = ["${aws_ssm_maintenance_window_target.foo.id}"]
  }

  task_parameters {
    name   = "Operation"
    values = ["Install"]
  }

  logging_info {
    s3_bucket_name   = "foo"
    s3_bucket_prefix = "amazon-patch"
    s3_region        = "eu-west-1"
  }
}

Desired state:

resource "aws_ssm_maintenance_window_task" "foo" {
  window_id        = "${aws_ssm_maintenance_window.foo.id}"
  task_type        = "RUN_COMMAND"
  task_arn         = "AWS-RunPatchBaseline"
  service_role_arn = "${aws_iam_service_linked_role.ssm_maintenance_service_role.arn}"

  max_concurrency = "1"
  max_errors      = "100"

  targets {
    key    = "WindowTargetIds"
    values = ["${aws_ssm_maintenance_window_target.foo.id}"]
  }

  task_parameters {
    name   = "Operation"
    values = ["Install"]
  }

  logging_info {
    s3_bucket_name   = "bar"
    s3_bucket_prefix = "amazon-patch"
    s3_region        = "eu-west-1"
  }
}

Expected Behavior

Terraform updates the S3 bucket used for logging, either by updating the resource in-place or recreating the resource

Actual Behavior

  • aws_ssm_maintenance_window_task.foo: doesn't support update

Steps to Reproduce

  1. terraform apply the original state
  2. terraform apply the desired state to update the logging bucket name
@jeohist
Copy link
Contributor Author

jeohist commented Jan 16, 2019

Relevant file: https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_ssm_maintenance_window_task.go

Relevant documentation: https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_UpdateMaintenanceWindowTask.html

LoggingInfo
The new logging location in Amazon S3 to specify.

Note

LoggingInfo has been deprecated. To specify an S3 bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported Maintenance Window task types, see MaintenanceWindowTaskInvocationParameters.

Type: LoggingInfo object

And relevant Go documentation: https://docs.aws.amazon.com/sdk-for-go/api/service/ssm/#MaintenanceWindowTaskInvocationParameters

@bflad bflad added the service/ssm Issues and PRs that pertain to the ssm service. label Jan 17, 2019
@bflad bflad added the bug Addresses a defect in current functionality. label Jan 30, 2019
@bflad
Copy link
Contributor

bflad commented Jan 30, 2019

Hi @jeohist 👋Thanks for reporting this and apologies for the unexpected behavior here! This type of resource schema bug is similar to #7351 so at the very least, the resource schema should be updated to include ForceNew: true for the attributes under logging_info attribute so updates to the Terraform configuration at least automatically trigger resource recreation. Ideally though as you mention, the resource should preferably be enhanced to include update functionality for certain attributes. I'm going to leave this issue marked as a bug since Terraform is incorrectly handling this situation without manual operator intervention.

@bflad
Copy link
Contributor

bflad commented Jul 16, 2019

Support for updates with the aws_ssm_maintenance_window_task resource and a new task_invocation_parameters configuration block in the aws_ssm_maintenance_window_task resource (to replace the deprecated logging_info configuration block) has been merged and will release with version 2.20.0 of the Terraform AWS Provider, expected later this week. Thanks to @kterada0509 for the implementation work. 👍

@ghost
Copy link

ghost commented Nov 2, 2019

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!

@ghost ghost locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ssm Issues and PRs that pertain to the ssm service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants