Skip to content

Commit

Permalink
Merge pull request aws-samples#286 from aws-samples/getting-started-t…
Browse files Browse the repository at this point in the history
…f-1.3

Getting started tf 1.3
  • Loading branch information
svennam92 authored Feb 7, 2023
2 parents 440e1fc + 2e968c9 commit 2404d23
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.2.9
terraform_version: ~1.3.7
- name: Verify terraform
working-directory: terraform
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.2.9
terraform_version: ~1.3.7
terraform_wrapper: false
- name: Install utilities
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: '17'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.2.9
terraform_version: ~1.3.7
- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
}
}

required_version = "<= 1.2.9"
required_version = "~> 1.3.7"
}

provider "aws" {
Expand Down
5 changes: 1 addition & 4 deletions terraform/modules/cluster/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ terraform {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
}


}

required_version = "<= 1.2.9"
required_version = "~> 1.3.7"
}
3 changes: 1 addition & 2 deletions terraform/modules/ide/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ terraform {
version = ">= 4.46.0"
}
}

required_version = "<= 1.2.9"
required_version = "~> 1.3.7"
}
2 changes: 1 addition & 1 deletion test/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
backend "s3" {}

required_version = "<= 1.2.9"
required_version = "~> 1.3.7"
}

module "core" {
Expand Down
31 changes: 14 additions & 17 deletions website/docs/introduction/setup/your-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 30
In this workshop, we'll use Terraform to provision the required infrastructure and get everything up and running. If you provision this in your account, **there will be cost associated with them**. The cleanup section will guide you to remove them to prevent future charges.

### Prerequisites:
- [Install terraform 1.2.x](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
- [Install Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)

### Set up
Use the following instructions to set up the Terraform project.
Expand All @@ -19,7 +19,7 @@ Use the following instructions to set up the Terraform project.
$ git clone https://github.com/aws-samples/eks-workshop-v2.git
$ cd eks-workshop-v2/terraform
```
2. Check that your terraform version is 1.2.x.
2. The workshops require Terraform version 1.3.7+. Check your version:

```bash test=false
$ terraform version
Expand All @@ -33,33 +33,30 @@ $ terraform apply --auto-approve
```

:::caution
The terraform state file (terraform.tfstate) is used to determine what resources were provisioned and is used in the cleanup process. If you delete/lose it, you will have to manually delete the resources.
The Terraform state file (terraform.tfstate) is used to determine what resources were provisioned and is used in the cleanup process. If you delete/lose it, you will have to manually delete the resources.
:::

## Cleanup

In your account, you'll be handling the cleanup of any resources you create. You can use the following commands to delete the resources you've created with Terraform.
When you're done with the workshop, to avoid any unexpected costs, you'll be responsible for the cleanup of any resources in your account. This section has the instructions for cleanup.

1. To delete general add-ons, run the following command:
1. From Cloud9, run the following to clean the environment.

```bash test=false
$ cd terraform
$ terraform destroy -target=module.cluster.module.eks_blueprints_kubernetes_addons --auto-approve
$ delete-environment
```

2. To delete the descheduler add-on, run the following command:
```bash test=false
$ terraform destroy -target=module.cluster.module.descheduler --auto-approve
```
2. The following commands will delete the resources you've created with Terraform (using the terraform.tfstate from [Provisioning](#provisioning) above).

3. To delete the core blueprints add-ons, run the following command:
```bash test=false
# To delete general add-ons, run the following command:
$ cd terraform
$ terraform destroy -target=module.cluster.module.eks_blueprints_kubernetes_addons --auto-approve
# To delete the descheduler add-on, run the following command:
$ terraform destroy -target=module.cluster.module.descheduler --auto-approve
# To delete the core blueprints add-ons, run the following command:
$ terraform destroy -target=module.cluster.module.eks_blueprints --auto-approve
```

4. To delete the remaining resources created by Terraform, run the following command:
```bash test=false
# To delete the remaining resources created by Terraform, run the following command:
$ terraform destroy --auto-approve
```

Proceed to the [Accessing the IDE](../ide) section to access your Cloud9 IDE environment.

0 comments on commit 2404d23

Please sign in to comment.