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_s3_bucket_replication_configuration: event_threshold block in metrics should not be required #21895

Closed
robmp opened this issue Nov 24, 2021 · 3 comments · Fixed by #21901
Closed
Assignees
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@robmp
Copy link

robmp commented Nov 24, 2021

Thanks for implementing S3 bucket replication as a separate resource. Unfortunately it has the following issue which prevents us from being able to us it: having metrics enabled, but replication_time not specified or disabled is a perfectly valid configuration in AWS, but is currently impossible to achieve with Terraform AWS provider.

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

Terraform CLI and Terraform AWS Provider Version

Terraform v1.0.11
+ provider registry.terraform.io/hashicorp/aws v3.66.0

Affected Resource(s)

  • aws_s3_bucket_replication_configuration

Terraform Configuration Files

resource "aws_s3_bucket_replication_configuration" "this" {
  #(...)

  rule {
    destination {
      metrics {
        status = "Enabled"
      }

      # replication_time not specified
    }
  }
}

or

resource "aws_s3_bucket_replication_configuration" "this" {
  #(...)

  rule {
    destination {
      metrics {
        event_threshold {
          minutes = 15
        }
        status = "Enabled"
      }

      # replication_time not specified
    }
  }
}

Expected Behavior

Replication metrics and notifications should be enabled.

Actual Behavior

The first configuration result:

╷
│ Error: Insufficient event_threshold blocks
│
│   on main.tf line 115, in resource "aws_s3_bucket_replication_configuration" "this":
│  115:       metrics {
│
│ At least 1 "event_threshold" blocks are required.
╵

The second configuration result:

╷
│ Error: error creating S3 replication configuration for bucket (bucket-name): InvalidArgument: Metrics cannot contain an event threshold when ReplicationTime is not specified or Disabled
│       status code: 400, request id: XXX, host id: XXX=
│

Steps to Reproduce

  1. terraform apply
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Nov 24, 2021
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 24, 2021
@anGie44 anGie44 self-assigned this Nov 24, 2021
@haytham-salhi
Copy link

haytham-salhi commented Jan 24, 2022

@anGie44 this issue still exists! Still we get Metrics cannot contain an event threshold when ReplicationTime is not specified or Disabled when enabling the metrics only!!! Please advise.

Tested on version: terraform-provider-aws_v3.73.0_x5

@anGie44
Copy link
Contributor

anGie44 commented Jan 25, 2022

Hi @haytham-salhi , thank you for your feedback! Do you mind opening a new issue with all the required info (tf config, provider version, tf version, etc.) so we can look into it further? thanks!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2022
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/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
3 participants