coalfire-cf / terraform-aws-s3 Goto Github PK
View Code? Open in Web Editor NEWCoalfire AWS s3 Terraform Module
Home Page: https://coalfire.com/opensource
License: MIT License
Coalfire AWS s3 Terraform Module
Home Page: https://coalfire.com/opensource
License: MIT License
Describe the bug
The module fails with a malformed XML whne you try to terraform apply
a lifecycle rule with a prefix but no tags. It happens because it is coded in a way that the filter field always starts with an "and": https://github.com/Coalfire-CF/terraform-aws-s3/blob/main/main.tf#L130-L131
To Reproduce
Steps to reproduce the behavior: Create a lifecycle rule with only prefix, no tags.
Expected behavior
Successful lifecycle rule creation.
Screenshots
╷
│ Error: updating S3 Bucket Lifecycle Configuration (fedco-images): operation error S3: PutBucketLifecycleConfiguration, https response error StatusCode: 400, RequestID: 3N66EYQFVXJ4QKWT, HostID: BA4hCQ7FsDsdHEY2l/TZr30pX+YOv4a1oJGhwX+8nw0urj/p2GtpyryNHBi/+v0toLzkYNVwMTE=, api error MalformedXML: The XML you provided was not well-formed or did not validate against our published schema
│
│ with module.bucket_images.aws_s3_bucket_lifecycle_configuration.default[0],
│ on .terraform/modules/bucket_images/main.tf line 116, in resource "aws_s3_bucket_lifecycle_configuration" "default":
│ 116: resource "aws_s3_bucket_lifecycle_configuration" "default" {
│
╵
Additional context
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration#example-usage
I believe this issue stemmed out of trying to get around a bug where "filter" was required, even if empty, but it seems not to be required anymore.
This module could be improved by having example code in the readme showing how to use the module. Some ideas:
Describe the bug
Name of output key_iam
is deceptive. This name needs updated OR the output value needs changed.
To Reproduce
outputs.tf
file
output "key_iam" {
value = join("", aws_s3_bucket.s3_default[*].bucket_domain_name)
description = "The Domain of the s3 bucket."
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.