-
Notifications
You must be signed in to change notification settings - Fork 827
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
Adding k8s-infra-kops-scale-tests bucket with public read #5696
Merged
k8s-ci-robot
merged 2 commits into
kubernetes:main
from
pkprzekwas:k8s-infra-kops-scale-tests-bucket
Aug 8, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
infra/aws/terraform/s3/k8s-infra-e2e-boskos-scale-001/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
*.tfplan | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
25 changes: 25 additions & 0 deletions
25
infra/aws/terraform/s3/k8s-infra-e2e-boskos-scale-001/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
infra/aws/terraform/s3/k8s-infra-e2e-boskos-scale-001/bucket.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
Copyright 2022 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
resource "aws_s3_bucket" "k8s_infra_kops_scale_tests" { | ||
bucket = "k8s-infra-kops-scale-tests" | ||
} | ||
|
||
resource "aws_s3_bucket_public_access_block" "k8s_infra_kops_scale_tests" { | ||
bucket = aws_s3_bucket.k8s_infra_kops_scale_tests.id | ||
|
||
block_public_acls = false | ||
block_public_policy = false | ||
ignore_public_acls = false | ||
restrict_public_buckets = false | ||
} | ||
|
||
resource "aws_s3_bucket_policy" "k8s_infra_kops_scale_tests" { | ||
bucket = aws_s3_bucket.k8s_infra_kops_scale_tests.id | ||
|
||
depends_on = [aws_s3_bucket_public_access_block.k8s_infra_kops_scale_tests] | ||
|
||
policy = jsonencode({ | ||
"Id" : "Public-Access", | ||
"Version" : "2012-10-17", | ||
"Statement" : [ | ||
{ | ||
"Action" : "s3:ListBucket", | ||
"Effect" : "Allow", | ||
"Resource" : "${aws_s3_bucket.k8s_infra_kops_scale_tests.arn}", | ||
"Principal" : "*" | ||
}, | ||
{ | ||
"Action" : "s3:GetObject", | ||
"Effect" : "Allow", | ||
"Resource" : "${aws_s3_bucket.k8s_infra_kops_scale_tests.arn}/*", | ||
"Principal" : "*" | ||
}, | ||
{ | ||
"Sid" : "RequireTLSForObjectAccess", | ||
"Action" : "s3:*", | ||
"Effect" : "Deny", | ||
"Resource" : "${aws_s3_bucket.k8s_infra_kops_scale_tests.arn}/*", | ||
"Condition" : { | ||
"Bool" : { | ||
"aws:SecureTransport" : "false" | ||
} | ||
}, | ||
"Principal" : "*" | ||
} | ||
] | ||
}) | ||
} |
33 changes: 33 additions & 0 deletions
33
infra/aws/terraform/s3/k8s-infra-e2e-boskos-scale-001/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
terraform { | ||
backend "s3" { | ||
bucket = "k8s-infra-kops-scale-tests-tf-state" | ||
region = "us-east-2" | ||
key = "s3/k8s-infra-kops-scale-tests/terraform.tfstate" | ||
} | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-2" | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@pkprzekwas suggestion: we should probably move this .gitignore file to
../infra/aws/terraform
so all the sub-repos inherit this config.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.
We can think about having some generic ignore at the top level of the terraform directory. But that should be a dedicated PR that would also remove other ignores.
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.
Yeah. let's do that in a separate PR.