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: local dev setup fixes #413

Merged
merged 5 commits into from
Oct 30, 2024
Merged

chore: local dev setup fixes #413

merged 5 commits into from
Oct 30, 2024

Conversation

aliziel
Copy link
Contributor

@aliziel aliziel commented Oct 29, 2024

What I am changing

I recently spun up a Cumulus instance in the CBA sandbox account to help test the CNM work and encountered a couple hiccups on a fresh install (nothing Cumulus-related on my machine before this).

This branch is mostly fixing typos + populating env vars for local dev — no functional changes to live code.

How I did it

  • Source $DOTENV in zip_lambda shell
  • Close double quotes on pre-deploy-setup target
  • Trim TF syntax on console output piped to script
  • Run terraspace fmt on post-deploy-mods/main.tf (blocking commit on unrelated files)

How you can test it

The following commands should run successfully

$ make pre-deploy-setup
# also verifies the zip_lambda target

$  make create-test-data

@@ -155,7 +155,7 @@ plan-%: install
## pre-deploy-setup: Setup resources prior to initial deployment (idempotent)
pre-deploy-setup: all-init
# Ensure buckets exist, grab the name of the "internal" bucket, and copy launchpad.pfx there.
$(DOCKER_RUN) --interactive $(IMAGE) -ic "bin/ensure-buckets-exist.sh 2>/dev/null
$(DOCKER_RUN) --interactive $(IMAGE) -ic "bin/ensure-buckets-exist.sh 2>/dev/null"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ make pre-deploy-setup

# ...

/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [pre-deploy-setup] Error 2

Makefile Outdated Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ git commit

Terraspace Format........................................................Failed
- hook id: terraspace-fmt
- exit code: 1
- files were modified by this hook

@@ -10,7 +10,8 @@ echo -n "Determining provider bucket..."
provider_bucket="$(
echo 'var.buckets["provider"]["name"]' |
terraspace console cumulus 2>/dev/null |
grep "${CUMULUS_PREFIX}"
grep "${CUMULUS_PREFIX}" |
sed -E 's/"(.+)"/\1/'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ make create-test-data

Determining provider bucket..."csda-cumulus-ali-provider-7894"

Syncing dummy files to provider bucket "csda-cumulus-ali-provider-7894"...fatal error: Parameter validation failed:
Invalid bucket name ""csda-cumulus-ali-provider-7894"": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$" or be an ARN matching the regex "^arn:(aws).*:(s3|s3-object-lambda):[a-z\-0-9]*:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-.]{1,63}$|^arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:][a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63}$"
make: *** [create-test-data] Error 1

Copy link
Collaborator

Choose a reason for hiding this comment

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

Strange. I wonder if output changed with a recent version of terraform or terraspace, since this didn't have this problem before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my guess, but I couldn't (easily) find Terraspace change history to confirm. I actually aligned with existing handling here, so it might've changed around that time since the DevEx work surrounding the sandbox tickets looked pretty thoroughly tested 🤷

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yes, perhaps just something missed back then.

Copy link
Collaborator

@chuckwondo chuckwondo left a comment

Choose a reason for hiding this comment

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

Thanks for tidying up! (I'm just lurking.)

Co-authored-by: Chuck Daniels <chuck@developmentseed.org>
@aliziel aliziel marked this pull request as ready for review October 29, 2024 19:27
Copy link
Collaborator

@jsrikish jsrikish left a comment

Choose a reason for hiding this comment

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

Thanks, Ali & Chuck for fixing this error

@aliziel aliziel merged commit d155caa into main Oct 30, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants