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

fix: Automate init and pass Default Region for data-on-eks/streaming/kafka/install.sh #342

Closed
wants to merge 3 commits into from

Conversation

jakeskyaws
Copy link

In data-on-eks/streaming/kafka/install.sh

When using Terraform the AWS_DEFAULT_REGION is not recognised. We are fetching the default with the aws cli as it is a prerequisite. Then passing as a variable.

This caused the default variable to take presidence causing the cluster to be deployed to "us-west-2"

Added to cleanup.sh for consistency

default region not being taken from env vars. Default variable taking presidence.
consistent to install.sh passing var from aws config
automate terraform init
@jakeskyaws jakeskyaws temporarily deployed to DoEKS Test October 10, 2023 14:58 — with GitHub Actions Inactive
@jakeskyaws jakeskyaws changed the title Automate init and pass Default Region for data-on-eks/streaming/kafka/install.sh fix: Automate init and pass Default Region for data-on-eks/streaming/kafka/install.sh Oct 10, 2023
# Apply modules in sequence
for target in "${targets[@]}"
do
echo "Applying module $target..."
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
apply_output=$(terraform apply -target="$target" -var=region=$(aws configure get region) -auto-approve 2>&1 | tee /dev/tty)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially create issues for users who intend to deploy the cluster in a specific region as specified in the variables file.

Our install.sh script depends on the region variables defined in the blueprint. Users must take care to update the region within the variables file to match their intended deployment region. There are situations where their local region might be configured as eu-west-1, but their deployment target is us-west-2 or us-east-1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also not "sound" behavior for a declarative IaC tool/framework - you declare the value in code, and apply that. using a dynamic lookup could lead to destroying an entire regions worth of resources

Copy link
Contributor

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Nov 19, 2023
Copy link
Contributor

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants