Skip to content

Commit

Permalink
feat: upgrade terraform hashicorp/aws provider to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdwint committed Jun 5, 2023
1 parent 3c75089 commit 69bc668
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions terraform/modules/s3pypi/basic_auth/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}

variable "domain" {
type = string
description = "Domain name"
Expand Down
17 changes: 12 additions & 5 deletions terraform/modules/s3pypi/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
configuration_aliases = [
aws.us_east_1,
]
}
}
}

variable "bucket" {
type = string
description = "S3 bucket name"
Expand Down Expand Up @@ -30,10 +42,6 @@ locals {
hosted_zone = replace(var.domain, "/^[^.]+\\./", "")
}

provider "aws" {
alias = "us_east_1"
}

data "aws_acm_certificate" "viewer" {
provider = aws.us_east_1
domain = var.use_wildcard_certificate ? "*.${local.hosted_zone}" : var.domain
Expand Down Expand Up @@ -129,7 +137,6 @@ resource "aws_cloudfront_origin_access_identity" "oai" {}

resource "aws_s3_bucket" "pypi" {
bucket = var.bucket
acl = "private"
}

resource "aws_s3_bucket_policy" "s3_policy" {
Expand Down

0 comments on commit 69bc668

Please sign in to comment.