-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Add versioning option to S3 bucket #2942
Conversation
This seems like a reasonable change and implementation. A couple thoughts:
Just some things to think about, since these decisions will be hard to change later without breaking backward compatibility. |
Thanks review.
If conform the AWS API, I think should make
I agree make attribute a string.
|
That sounds reasonable to me. IIRC schema attributes can't actually be |
Hi @kjmkznr Would you mind rebasing last commits from upstream
I actually think that boolean here makes sense. The reason
I think we should hide this detail away from user, hence I think that default state, when there'll be no
To clarify, this would be adequate to default state, when user doesn't define versioning at all: versioning {
enabled = false
mfa_delete = false
} Let me know if there's anything else you need to finish this up, so we can merge it. 😉 |
"versioning": &schema.Schema{ | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why keep this Computed: true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I mistake it.
bc8b598
to
707fe3a
Compare
@radeksimko I rebase upstream
|
Set: func(v interface{}) int { | ||
var buf bytes.Buffer | ||
m := v.(map[string]interface{}) | ||
buf.WriteString(fmt.Sprintf("%d-", m["enabled"].(bool))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now reported by go vet
:
builtin/providers/aws/resource_aws_s3_bucket.go:108: arg m["enabled"].(bool) for printf verb %d of wrong type: bool
the right modifier is %t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Schema looks ok, do you plan adding Besides that one |
I updated S3 bucket resource document. I don't have adding |
LGTM 👍 |
provider/aws: Add versioning option to S3 bucket
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 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. |
This commit is allows to versioning configuration to S3 bucket resource.