-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add kudo-matic S3 buckets and IAM user #80
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
22b243f
Merge pull request #13 from kabisa/develop
egonm12 ac62ff2
Merge pull request #35 from kabisa/develop
JoostSaanen b2a0fee
Merge pull request #38 from kabisa/develop
MeijerM1 d2f64bf
Merge pull request #47 from kabisa/develop
MeijerM1 aab612a
Merge pull request #54 from kabisa/develop
ArnoutCreemers b29fcc5
Merge branch 'develop'
pascalw 124069f
Add .terraform to gitignore file
JoostSaanen 2a9b37d
Add Terraform code for S3 bucket and IAM user
JoostSaanen 82bd9ab
Update README.md
JoostSaanen 13e2026
Fix policy
JoostSaanen d92c566
feat: also add and import IAM access key
lukvdborne 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
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 |
---|---|---|
|
@@ -28,4 +28,6 @@ tmp/storage | |
storage | ||
|
||
# redis | ||
dump.rdb | ||
dump.rdb | ||
|
||
**/.terraform/ |
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
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 @@ | ||
1.11.0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
terraform { | ||
backend "s3" { | ||
region = "eu-west-1" | ||
bucket = "kabisa-terraform-statefiles" | ||
dynamodb_table = "kabisa-terraform-lockfiles" | ||
key = "kudo-o-matic/terraform.tfstate" | ||
encrypt = true | ||
|
||
assume_role = { | ||
role_arn = "arn:aws:iam::003476575487:role/admin" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.region | ||
|
||
assume_role { | ||
role_arn = "arn:aws:iam::${var.account_id}:role/admin" | ||
} | ||
} |
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,53 @@ | ||
resource "aws_s3_bucket" "kudo_o_matic_production" { | ||
bucket = "kudo-o-matic-production" | ||
} | ||
|
||
resource "aws_s3_bucket" "kudo_o_matic_development" { | ||
bucket = "kudo-o-matic-development" | ||
} | ||
|
||
resource "aws_s3_bucket" "kudo_o_matic_staging" { | ||
bucket = "kudo-o-matic-staging" | ||
} | ||
|
||
resource "aws_iam_user" "kudo_user" { | ||
name = "kudo-user" | ||
} | ||
|
||
resource "aws_iam_policy" "kudo_policy" { | ||
name = "kudo-s3-access-policy" | ||
description = "Policy to allow full access to kudo S3 buckets" | ||
|
||
policy = jsonencode({ | ||
Version = "2012-10-17" | ||
Statement = [ | ||
{ | ||
Effect = "Allow" | ||
Action = "s3:ListAllMyBuckets" | ||
Resource = "arn:aws:s3:::*" | ||
}, | ||
{ | ||
Effect = "Allow" | ||
Action = "s3:*" | ||
Resource = [ | ||
aws_s3_bucket.kudo_o_matic_development.arn, | ||
"${aws_s3_bucket.kudo_o_matic_development.arn}/*", | ||
aws_s3_bucket.kudo_o_matic_staging.arn, | ||
"${aws_s3_bucket.kudo_o_matic_staging.arn}/*", | ||
aws_s3_bucket.kudo_o_matic_production.arn, | ||
"${aws_s3_bucket.kudo_o_matic_production.arn}/*" | ||
] | ||
} | ||
] | ||
}) | ||
} | ||
|
||
resource "aws_iam_user_policy_attachment" "kudo_user_policy_attachment" { | ||
user = aws_iam_user.kudo_user.name | ||
policy_arn = aws_iam_policy.kudo_policy.arn | ||
} | ||
|
||
resource "aws_iam_access_key" "kudo_user_iam_access_key" { | ||
user = aws_iam_user.kudo_user.name | ||
} | ||
|
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 @@ | ||
account_id = "299159644482" |
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,5 @@ | ||
variable "region" { | ||
default = "eu-west-1" | ||
} | ||
|
||
variable "account_id" {} |
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.
@JoostSaanen heb hier ook nog de key toegevoegd.