Skip to content

Commit

Permalink
indicate more precise where the bucket name needs to go
Browse files Browse the repository at this point in the history
  • Loading branch information
schnipseljagd committed Aug 31, 2022
1 parent 995fb31 commit 512488d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions 1-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Let’s extend the stack and deploy more resources:
</body>
</html>
```
3. Replace the `main.tf` file:
3. Replace the `main.tf` file with:
```tf
terraform {
required_version = "~> 1.1.7"
Expand Down Expand Up @@ -107,8 +107,8 @@ Before we continue and go to the next lab, we need to talk about the Terraform s

Until now, we used local files for the Terraform state. That’s okay for a workshop but doesn’t work for production workloads. The problem is, that we always need the state to apply changes. So if you want to work on the same stack with a team or some form of automation, then you need to share the state with others. The recommended solution is a remote backend. In this workshop, we focus on an S3 bucket, but you have [different options](https://www.terraform.io/language/settings/backends). Instead of keeping the state locally, we upload the state to the S3 bucket and read the current status from there.

1. Create a new S3 bucket in the [AWS Management Console](https://s3.console.aws.amazon.com/s3/bucket/create?region=eu-central-1). Copy the name of the bucket afterward.
2. Go to the file `main.tf` and replace it:
1. Create a new S3 bucket in the [AWS Management Console](https://s3.console.aws.amazon.com/s3/bucket/create?region=eu-central-1). Copy the name of the bucket and keep for use in **step 3** as well as other workshop units.
2. Go to the file `main.tf` and replace it with:
```tf
terraform {
required_version = "~> 1.1.7"
Expand Down
5 changes: 5 additions & 0 deletions 1-getting-started/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
terraform {
required_version = "~> 1.1.7"

backend "s3" {
key = "terraform.tfstate"
region = "eu-central-1"
}
}

provider "aws" {
Expand Down
4 changes: 2 additions & 2 deletions 2-third-party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In the first lab, we bootstrapped Terraform and got familiar with the very basic
};
};
```
4. Now, go back to the `main.tf` file and replace it:
4. Now, go back to the `main.tf` file and replace it with:
```tf
terraform {
required_version = "~> 1.1.7"
Expand Down Expand Up @@ -82,7 +82,7 @@ That’s it for the Lambda function. Let’s go to the API Gateway.

## API Gateway

1. Replace the `main.tf` file:
1. Replace the `main.tf` file with:
```tf
terraform {
required_version = "~> 1.1.7"
Expand Down
4 changes: 2 additions & 2 deletions 3-module-composition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The previous lab introduced a third-party module to easily deploy a Lambda funct
value = "http://${aws_s3_bucket_website_configuration.website.website_endpoint}"
}
```
17. Replace the root `main.tf` file:
17. Replace the root `main.tf` file with:
```tf
terraform {
required_version = "~> 1.1.7"
Expand All @@ -123,7 +123,7 @@ The previous lab introduced a third-party module to easily deploy a Lambda funct
source = "./modules/api"
}
```
18. Replace the root `outputs.tf` file:
18. Replace the root `outputs.tf` file with:
```tf
output "api_url" {
description = "Hello World API URL"
Expand Down
8 changes: 4 additions & 4 deletions 5-parameterization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The API becomes more powerful in this lab, but we want to be careful and only ro

## Implement new feature

1. Go to the file `modules/api/variables.tf` and replace it:
1. Go to the file `modules/api/variables.tf` and replace it with:

```
variable "environment" {
Expand All @@ -19,7 +19,7 @@ variable "enable_greeting_feature" {
}
```

2. Go to the file `modules/api/main.tf` and replace it:
2. Go to the file `modules/api/main.tf` and replace it with:

```tf
locals {
Expand Down Expand Up @@ -54,7 +54,7 @@ resource "aws_apigatewayv2_api" "hello_world" {
}
```

3. Go to the file `modules/api/functions/helloworld.js` and replace it:
3. Go to the file `modules/api/functions/helloworld.js` and replace it with:

```js
const greetingEnabled = process.env.GREETING_ENABLED === "true";
Expand All @@ -77,7 +77,7 @@ The new feature wouldn’t appear after deployment (feel free to try it and depl
## Rollout
1. Go to the file `staging/main.tf` and replace it:
1. Go to the file `staging/main.tf` and replace it with:
```tf
terraform {
Expand Down

0 comments on commit 512488d

Please sign in to comment.