Skip to content

Commit

Permalink
docs: Update and standardize examples to follow conventions defined i…
Browse files Browse the repository at this point in the history
…n pre-commit checks (#424)

* chore: standardize AWS provider and region usage on examples

* chore: clean up old license reference material

* chore: clean up `cluster_version` in examples and use latest `1.22`

* chore: standardize versions in `versions.tf`

* chore: update providers to use `exec` for retrieving cluster auth token

* fix: use pre-commit version of tflint and remove extra file

* chore: align vpc module version pin pattern

* chore: move outputs to `outputs.tf` file per convention

* chore: correct tflint errors

* fix: correct terraform docs usage so that documentation is updated correctly

* chore: rollback `1.22` upgrade to `1.21`

* fix: add template to `terraform-docs` workflow to ensure tags are aligned to pre-commit tags

* chore: remove prior CI test and update naming scheme for PR changes

* refactor: remove prior e2e tests that are now replaced with terratest

* chore: additional updates for READMEs

* chore: update to catch up recent merges
  • Loading branch information
bryantbiggs authored Apr 29, 2022
1 parent acd5ffa commit deec7d5
Show file tree
Hide file tree
Showing 288 changed files with 3,211 additions and 3,703 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/e2e-parallel-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: "true"

env:
DEFAULT_DEPLOY_ORDER: "module.e2e-test.module.aws_vpc,module.e2e-test.module.eks-blueprints,module.e2e-test.module.eks-blueprints-kubernetes-addons"
DEFAULT_DEPLOY_ORDER: "module.e2e_test.module.aws_vpc,module.e2e_test.module.eks_blueprints,module.e2e_test.module.eks_blueprints_kubernetes_addons"

jobs:
deploy:
Expand Down Expand Up @@ -40,22 +40,22 @@ jobs:
tenant_name: "private"
deployment_order:
[
"module.e2e-test.module.aws_vpc",
"module.e2e-test.module.vpc_endpoint_gateway",
"module.e2e-test.module.vpc_endpoints",
"module.e2e-test.module.eks-blueprints",
"module.e2e_test.module.aws_vpc",
"module.e2e_test.module.vpc_endpoint_gateway",
"module.e2e_test.module.vpc_endpoints",
"module.e2e_test.module.eks_blueprints",
]
- example_path: examples/game-tech/agones-game-controller
tenant_name: "agones"
- example_path: examples/ingress-controllers/nginx
tenant_name: "nginx"
deployment_order:
[
"module.e2e-test.module.aws_vpc",
"module.e2e-test.module.eks-blueprints",
"module.e2e-test.module.eks-blueprints-kubernetes-addons",
"module.e2e-test.module.aws_load_balancer_controller",
"module.e2e-test.module.ingress_nginx",
"module.e2e_test.module.aws_vpc",
"module.e2e_test.module.eks_blueprints",
"module.e2e_test.module.eks_blueprints_kubernetes_addons",
"module.e2e_test.module.aws_load_balancer_controller",
"module.e2e_test.module.ingress_nginx",
]
- example_path: examples/karpenter
tenant_name: "karpenter"
Expand All @@ -74,17 +74,17 @@ jobs:
- name: Pre Setup
id: pre-setup
run: |
mkdir -p deploy/e2e/gh-e2e-test
mkdir -p deploy/e2e-test
if [[ ${{ matrix.example_path }} == deploy/* ]]
then
echo "Skipping pre-setup for ${{ matrix.example_path }}"
cp -R ${{ matrix.example_path }}/* deploy/e2e/gh-e2e-test/
cp -R ${{ matrix.example_path }}/* deploy/e2e-test/
else
echo "Running pre-setup for ${{ matrix.example_path }}"
cp -R deploy/e2e/gh-e2e-template/* deploy/e2e/gh-e2e-test/
sed -i "s!REPLACE_ME!${{ matrix.tenant_name }}!g" deploy/e2e/gh-e2e-test/base.tfvars
sed -i "s!TF_STATE_PATH!${{ matrix.example_path }}!g" deploy/e2e/gh-e2e-test/backend.conf
sed -i "s!EXAMPLE_PATH!${{ matrix.example_path }}!g" deploy/e2e/gh-e2e-test/main.tf
cp -R deploy/e2e-template/* deploy/e2e-test/
sed -i "s!REPLACE_ME!${{ matrix.tenant_name }}!g" deploy/e2e-test/base.tfvars
sed -i "s!TF_STATE_PATH!${{ matrix.example_path }}!g" deploy/e2e-test/backend.conf
sed -i "s!EXAMPLE_PATH!${{ matrix.example_path }}!g" deploy/e2e-test/main.tf
fi
continue-on-error: false

Expand Down Expand Up @@ -123,24 +123,24 @@ jobs:
- name: Terraform Init
id: init
run: terraform init -backend-config backend.conf -reconfigure
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
continue-on-error: false

- name: Terraform Validate
id: validate
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: terraform validate -no-color
continue-on-error: false

- name: Terraform Plan Destroy
id: plan-destroy
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: terraform plan -destroy -var-file base.tfvars -no-color
continue-on-error: false

- name: Terraform Destroy
id: destroy
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: |
reverse_array=$(echo ${{ env.DEPLOYMENT_ORDER }} | awk -F, '{for (i=NF; i>0; --i) printf "%s%s", (i<NF ? "," : ""), $i; printf "\n"}')
IFS=',' read -r -a array <<< "$reverse_array"
Expand Down
45 changes: 21 additions & 24 deletions .github/workflows/e2e-parallel-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
default: "true"
env:
DEFAULT_DEPLOY_ORDER: "module.e2e-test.module.aws_vpc,module.e2e-test.module.eks-blueprints,module.e2e-test.module.eks-blueprints-kubernetes-addons"
DEFAULT_DEPLOY_ORDER: "module.e2e_test.module.aws_vpc,module.e2e_test.module.eks_blueprints,module.e2e_test.module.eks_blueprints_kubernetes_addons"

jobs:
deploy:
Expand All @@ -27,9 +27,6 @@ jobs:
tenant_name: "emr-eks"
- example_path: examples/analytics/spark-k8s-operator
tenant_name: "spark"
# This is example that we can use test from deploy folder, see logic in the pre setup step
# - example_path: deploy/e2e/vpc
# tenant_name: "vpc"
- example_path: examples/multi-tenancy-with-teams
tenant_name: "teams"
- example_path: examples/gitops/argocd
Expand All @@ -44,22 +41,22 @@ jobs:
tenant_name: "private"
deployment_order:
[
"module.e2e-test.module.aws_vpc",
"module.e2e-test.module.vpc_endpoint_gateway",
"module.e2e-test.module.vpc_endpoints",
"module.e2e-test.module.eks-blueprints",
"module.e2e_test.module.aws_vpc",
"module.e2e_test.module.vpc_endpoint_gateway",
"module.e2e_test.module.vpc_endpoints",
"module.e2e_test.module.eks_blueprints",
]
- example_path: examples/game-tech/agones-game-controller
tenant_name: "agones"
- example_path: examples/ingress-controllers/nginx
tenant_name: "nginx"
deployment_order:
[
"module.e2e-test.module.aws_vpc",
"module.e2e-test.module.eks-blueprints",
"module.e2e-test.module.eks-blueprints-kubernetes-addons",
"module.e2e-test.module.aws_load_balancer_controller",
"module.e2e-test.module.ingress_nginx",
"module.e2e_test.module.aws_vpc",
"module.e2e_test.module.eks_blueprints",
"module.e2e_test.module.eks_blueprints_kubernetes_addons",
"module.e2e_test.module.aws_load_balancer_controller",
"module.e2e_test.module.ingress_nginx",
]
- example_path: examples/karpenter
tenant_name: "karpenter"
Expand All @@ -76,17 +73,17 @@ jobs:
- name: Pre Setup
id: pre-setup
run: |
mkdir -p deploy/e2e/gh-e2e-test
mkdir -p deploy/e2e-test
if [[ ${{ matrix.example_path }} == deploy/* ]]
then
echo "Skipping pre-setup for ${{ matrix.example_path }}"
cp -R ${{ matrix.example_path }}/* deploy/e2e/gh-e2e-test/
cp -R ${{ matrix.example_path }}/* deploy/e2e-test/
else
echo "Running pre-setup for ${{ matrix.example_path }}"
cp -R deploy/e2e/gh-e2e-template/* deploy/e2e/gh-e2e-test/
sed -i "s!REPLACE_ME!${{ matrix.tenant_name }}!g" deploy/e2e/gh-e2e-test/base.tfvars
sed -i "s!TF_STATE_PATH!${{ matrix.example_path }}!g" deploy/e2e/gh-e2e-test/backend.conf
sed -i "s!EXAMPLE_PATH!${{ matrix.example_path }}!g" deploy/e2e/gh-e2e-test/main.tf
cp -R deploy/e2e-template/* deploy/e2e-test/
sed -i "s!REPLACE_ME!${{ matrix.tenant_name }}!g" deploy/e2e-test/base.tfvars
sed -i "s!TF_STATE_PATH!${{ matrix.example_path }}!g" deploy/e2e-test/backend.conf
sed -i "s!EXAMPLE_PATH!${{ matrix.example_path }}!g" deploy/e2e-test/main.tf
fi
continue-on-error: false

Expand Down Expand Up @@ -125,24 +122,24 @@ jobs:
- name: Terraform Init
id: init
run: terraform init -backend-config backend.conf -reconfigure
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
continue-on-error: false

- name: Terraform Validate
id: validate
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: terraform validate -no-color
continue-on-error: false

- name: Terraform Plan
id: plan
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: terraform plan -var-file base.tfvars -no-color
continue-on-error: false

- name: Terraform Apply
id: apply
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: |
IFS=',' read -r -a array <<< "${{ env.DEPLOYMENT_ORDER }}"
for element in "${array[@]}"
Expand All @@ -155,7 +152,7 @@ jobs:
- name: Terraform Destroy
if: github.event.inputs.TFDestroy == 'true' && (steps.apply.outcome == 'success' || steps.apply.outcome == 'failure')
id: destroy
working-directory: deploy/e2e/gh-e2e-test
working-directory: deploy/e2e-test
run: |
reverse_array=$(echo ${{ env.DEPLOYMENT_ORDER }} | awk -F, '{for (i=NF; i>0; --i) printf "%s%s", (i<NF ? "," : ""), $i; printf "\n"}')
IFS=',' read -r -a array <<< "$reverse_array"
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/e2e-test-cleanup.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/e2e-test.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/pr-test.yml

This file was deleted.

Loading

0 comments on commit deec7d5

Please sign in to comment.