Skip to content
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

Update AWS provider for terraform >= v0.13 #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ The static website is published on a subdomain registered in Route 53.
> A live example can be found at [https://serverless-static-website-with-basic-auth.dumrauf.uk/](https://serverless-static-website-with-basic-auth.dumrauf.uk/?utm_source=GitHub&utm_medium=social&utm_campaign=README) using the demo username `guest` and password [`letmein`](https://www.theguardian.com/technology/2016/jan/20/123456-worst-passwords-revealed).
> Note that access to the underlying [S3 bucket](https://us-east-1-serverless-webs-serverlesswebsitebucket-1mtsv4odbs2x0.s3.amazonaws.com) hosting the static website is denied.

The master branch in this repository is compliant with [Terraform v0.12](https://www.terraform.io/upgrade-guides/0-12.html); a legacy version that is compatible with [Terraform v0.11](https://www.terraform.io/upgrade-guides/0-11.html) is available on branch [terraform@0.11](https://github.com/dumrauf/serverless_static_website_with_basic_auth/tree/terraform%400.11).
The master branch in this repository is compliant with [Terraform >= v0.13](https://www.terraform.io/language/v1.1.x/upgrade-guides/0-13); a legacy version that is compatible with [Terraform v0.11](https://www.terraform.io/upgrade-guides/0-11.html) is available on branch [terraform@0.11](https://github.com/dumrauf/serverless_static_website_with_basic_auth/tree/terraform%400.11).

> **Note**
> Upgrading from `v0.12` to later versions

Due to changes in the AWS provider, if you have existing state from <= `v0.12` and are upgrading to >= `v0.13` the following will achieve that:

```shell
terraform state replace-provider -- -/random hashicorp/random
terraform state replace-provider -- -/archive hashicorp/archive
terraform state replace-provider -- -/aws hashicorp/aws
terraform init
```

## You Have

Expand Down
15 changes: 11 additions & 4 deletions Terraform/providers.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
region = var.region
shared_credentials_file = var.shared_credentials_file
profile = var.profile
region = var.region
shared_credentials_files = [var.shared_credentials_file]
profile = var.profile
}