Skip to content

Commit

Permalink
Merge pull request #19 from opzkit/aws-provider-4.x
Browse files Browse the repository at this point in the history
feat: update to AWS-provider 4.x
  • Loading branch information
argoyle authored Mar 20, 2022
2 parents fa113f8 + 5e5a263 commit 3435e95
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions examples/additional_nodes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ module "k8s" {

resource "aws_s3_bucket" "state-store" {
bucket = "state-store"
}

resource "aws_s3_bucket_acl" "state-store" {
bucket = aws_s3_bucket.state-store.id
acl = "public-read"
}
2 changes: 1 addition & 1 deletion examples/additional_nodes/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {

aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
5 changes: 5 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ module "k8s" {

resource "aws_s3_bucket" "state-store" {
bucket = "state-store"
}

resource "aws_s3_bucket_acl" "state-store" {
bucket = aws_s3_bucket.state-store.id
acl = "public-read"
}

2 changes: 1 addition & 1 deletion examples/basic/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {

aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
4 changes: 4 additions & 0 deletions examples/policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module "k8s" {

resource "aws_s3_bucket" "state-store" {
bucket = "state-store"
}

resource "aws_s3_bucket_acl" "state-store" {
bucket = aws_s3_bucket.state-store.id
acl = "public-read"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/policies/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {

aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
4 changes: 2 additions & 2 deletions k8s.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "aws_s3_bucket_object" "extra_addons" {
resource "aws_s3_object" "extra_addons" {
for_each = { for a in local.addons : a.name => a }
bucket = var.bucket_state_store.id
key = "${var.name}-addons/${each.value.name}/v${each.value.version}.yaml"
Expand All @@ -8,7 +8,7 @@ resource "aws_s3_bucket_object" "extra_addons" {
metadata = {}
}

resource "aws_s3_bucket_object" "addons" {
resource "aws_s3_object" "addons" {
bucket = var.bucket_state_store.id
key = "${var.name}-addons/addon.yaml"
content = local.addons_yaml
Expand Down
4 changes: 4 additions & 0 deletions providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
kops = {
source = "eddycharly/kops"
version = "~>1.21.0"
Expand Down
7 changes: 6 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
resource "aws_s3_bucket" "issuer" {
count = var.aws_oidc_provider ? 1 : 0
bucket = "${replace(var.name, ".", "-")}-irsa-issuer"
acl = "public-read"
force_destroy = true
}

resource "aws_s3_bucket_acl" "issuer" {
count = var.aws_oidc_provider ? 1 : 0
bucket = aws_s3_bucket.issuer[count.index].id
acl = "public-read"
}

0 comments on commit 3435e95

Please sign in to comment.