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

chore(744): remove deprecated aws/eks #869

Merged
merged 2 commits into from
May 4, 2023
Merged
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
138 changes: 6 additions & 132 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,6 @@ commands:
export TF_LOG_PATH="./terraform-debug.log"
terraform init << parameters.terraform_arg >>

# Deprecated by terraform_init_oidc
terraform_init:
description: Run Terraform Init
parameters:
package:
type: string
terraform_arg:
description: provide terraform arguments
type: string
default: ''
steps:
- run:
name: Terraform init
command: |
source $BASH_ENV
cd terraform/<< parameters.package >>
terraform init << parameters.terraform_arg >>

terraform_plan_oidc:
description: Run Terraform Plan
parameters:
Expand Down Expand Up @@ -212,24 +194,6 @@ commands:
export TF_LOG_PATH="./terraform-debug.log"
terraform plan -out=tfplan -input=false << parameters.terraform_arg >>

# Deprecated by terraform_plan_oidc
terraform_plan:
description: Run Terraform Plan
parameters:
package:
type: string
terraform_arg:
description: provide terraform arguments
type: string
default: ''
steps:
- run:
name: Terraform plan
command: |
source $BASH_ENV
cd terraform/<< parameters.package >>
terraform plan -out=tfplan -input=false << parameters.terraform_arg >>

terraform_apply_oidc:
description: Run Terraform Apply
parameters:
Expand Down Expand Up @@ -270,77 +234,6 @@ commands:
export TF_LOG_PATH="./terraform-debug.log"
terraform apply -lock=false -input=false tfplan

# Deprecated by terraform_apply_oidc
terraform_apply:
description: Run Terraform Apply
parameters:
package:
type: string
steps:
- run:
name: Terraform apply
command: |
source $BASH_ENV
cd terraform/<< parameters.package >>
terraform apply -auto-approve -lock=false -input=false tfplan

aws_assume_role:
description: Assume AWS role
parameters:
aws_access_key_id:
description: AWS Access Key Id
type: string
default: '${AWS_ACCESS_KEY_ID}'
aws_secret_key:
description: AWS Secret Key
type: string
default: '${AWS_SECRET_ACCESS_KEY}'
aws_assume_role_arn:
description: AWS ARN For Assume Role
type: string
default: '${AWS_ASSUME_ROLE_ARN}'
job_type:
description: The job type to be used
type: string
default: 'default'
steps:
- run:
name: Assume role
command: |
export AWS_ACCESS_KEY_ID=<< parameters.aws_access_key_id >>
export AWS_SECRET_ACCESS_KEY=<< parameters.aws_secret_key >>
export temp_role=$(aws sts assume-role \
--role-arn "<< parameters.aws_assume_role_arn >>" \
--role-session-name "circle-ci-assume")
export AWS_ACCESS_KEY_ID_TEMP=$(echo $temp_role | jq .Credentials.AccessKeyId | xargs)
export AWS_SECRET_ACCESS_KEY_TEMP=$(echo $temp_role | jq .Credentials.SecretAccessKey | xargs)
export AWS_SESSION_TOKEN_TEMP=$(echo $temp_role | jq .Credentials.SessionToken | xargs)
echo "export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID_TEMP" >> $BASH_ENV
echo "export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY_TEMP" >> $BASH_ENV
echo "export AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN_TEMP" >> $BASH_ENV
source $BASH_ENV
cat $BASH_ENV | grep AWS_ACCESS_KEY_ID >> assume_role_creds_<< parameters.job_type >>.txt
cat $BASH_ENV | grep AWS_SECRET_ACCESS_KEY >> assume_role_creds_<< parameters.job_type >>.txt
cat $BASH_ENV | grep AWS_SESSION_TOKEN >> assume_role_creds_<< parameters.job_type >>.txt
- persist_to_workspace:
root: ./
paths:
- assume_role_creds_<< parameters.job_type >>.txt

aws_assume_role_file:
description: Assume AWS role from the workspace file
parameters:
job_type:
description: The job type to be used
type: string
default: 'default'
steps:
- run:
name: Assume role file
command: |
cat assume_role_creds_<< parameters.job_type >>.txt >> $BASH_ENV
source $BASH_ENV

# Best to remove "circleci-agent step halt" line while doing testing of CircleCI code
# to ensure that Terraform is validated at the pull_request stage
run_only_on_folder_change:
Expand Down Expand Up @@ -537,25 +430,6 @@ jobs:
- slack/notify:
<<: *slack_notify

# Deprecated by build_docs_with_no_base_url
build_docs_pr_with_no_base_url:
executor: node-xlarge
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: Build
command: |
export SITE_ENV=${SITE_ENV}
make build_docs_with_no_base_url
- persist_to_workspace:
root: ./
paths:
- public/*
- slack/notify:
<<: *slack_notify

build_docs_with_no_base_url:
executor: node-xlarge
steps:
Expand Down Expand Up @@ -1233,20 +1107,20 @@ workflows:
requires:
- build_test_e2e
- install_cypress
- build_docs_pr_with_no_base_url:
- build_docs_with_no_base_url:
context: ncu-product-platforms-context
requires:
- install_deps
- test_broken_links_docs:
name: test_broken_links_docs_pr
context: ncu-product-platforms-context
requires:
- build_docs_pr_with_no_base_url
- build_docs_with_no_base_url
- test_e2e_docs:
name: test_e2e_docs_pr
context: ncu-product-platforms-context
requires:
- build_docs_pr_with_no_base_url
- build_docs_with_no_base_url
- install_cypress
- build_storybook
- no_visual_changes:
Expand Down Expand Up @@ -1298,13 +1172,13 @@ workflows:
- test_visual_docs_percy:
context: ncu-product-platforms-context
requires:
- build_docs_pr_with_no_base_url
- build_docs_with_no_base_url
- install_cypress
- test_visual_comps_percy
- test_visual_docs_percy_2:
context: ncu-product-platforms-context
requires:
- build_docs_pr_with_no_base_url
- build_docs_with_no_base_url
- install_cypress
- docs_visual_changes
- skip_percy_comps_check_2:
Expand Down Expand Up @@ -1353,7 +1227,7 @@ workflows:
- deploy_terraform_oidc:
name: validate_deploy_terraform_s3_prod
package: s3/prod-newskit
context: ncu-newskit-site-stage
context: ncu-newskit-site-prod
apply: false # Can set true while doing testing of CircleCI code
tf_env: true
environment: prod
Expand Down