-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Diogo Duran
committed
Apr 30, 2023
1 parent
455dc78
commit f37e573
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'Create K8S Cluster - Plan' | ||
|
||
on: | ||
workflow_dispatch: | ||
ref: "refs/heads/main" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
terraform: | ||
name: 'Terraform - Plan k8s' | ||
runs-on: ubuntu-latest | ||
environment: production | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: . | ||
|
||
steps: | ||
# Checkout the repository to the GitHub Actions runner | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
|
||
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. | ||
- name: Terraform Init | ||
run: terraform init -backend-config="bucket=peiel--tf-backend" -backend-config="key=eks" -backend-config="region=us-west-2" | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.tf_var_aws_iam_access_key }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.tf_var_aws_iam_secret_key }} | ||
TF_VAR_aws_iam_access_key: ${{ secrets.TF_VAR_aws_iam_access_key }} | ||
TF_VAR_aws_iam_secret_key: ${{ secrets.TF_VAR_aws_iam_secret_key }} | ||
|
||
- name: Terraform Plan | ||
run: terraform plan -input=false | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.tf_var_aws_iam_access_key }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.tf_var_aws_iam_secret_key }} | ||
TF_VAR_aws_iam_access_key: ${{ secrets.TF_VAR_aws_iam_access_key }} | ||
TF_VAR_aws_iam_secret_key: ${{ secrets.TF_VAR_aws_iam_secret_key }} |