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

Upgrade boto to boto3 in deployment scripts #1377

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

rachelekm
Copy link
Collaborator

@rachelekm rachelekm commented Feb 23, 2024

Overview

Upgrades boto, used for our deployment scripts, with boto3 version 1.15.9, now at parity with boto3 used elsewhere in app.

Notes

  • There's one instance where we use boto outside of deployment scripts for the app vm, here, used to add the instance IP to ALLOWED_HOSTS for the ELBs. There's currently an open issue to add a comparable method to boto3 and until then the preferred solutions seem to continue to use boto.utils or a 3rd party package, ec2-metadata. There is a describe_instances method in boto3 that looks like we can get the public IP address from, but I'm not sure which instance we should be filtering for here that would be comparable to get_instance_metadata in production. Ultimately this is a pretty narrow use case for boto and it felt worth keeping this one utility in since it's not part of our deployment.

Testing Instructions

  • We're not able to test this locally since the actions affected by these updates don't actually run until launching a stack. I tried simulating launching a stack locally by manually running the action methods in a python script, but it raises a majorkirby.MKUnresolvableInputError when running the commands outside the context of a GlobalConfigNode. To test we will need to temporarily launch a web stack to confirm no issues and then delete once successful.

Checklist

  • No gulp lint warnings
  • No python lint warnings
  • Python tests pass
  • All TODOs have an accompanying issue link

Connects #1116


hosted_zone = client.create_hosted_zone(
Name=self.get_input("PrivateHostedZoneName"),
CallerReference=str(uuid.uuid4()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This method in boto had CallerReference (caller_ref) as an optional parameter and it would generate a Type 4 UUID to use by default. It is now required in boto3 and can be any unique string, so I'm continuing to use uuid by default here.

@rachelekm rachelekm marked this pull request as ready for review February 28, 2024 23:15
Copy link
Collaborator

@rajadain rajadain left a comment

Choose a reason for hiding this comment

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

+1 tested in pairing with @rachelekm. Spun up a new Green stack, confirmed that it worked, and tore it down. Great job!

Re: remaining boto issue, as long as the upcoming Python upgrades #1356 don't force an upgrade, I think it's fine to keep it.

@rajadain rajadain assigned rachelekm and unassigned rajadain Feb 29, 2024
@rachelekm
Copy link
Collaborator Author

Thanks the review and your help pairing!

@rachelekm rachelekm merged commit 84e9dcc into develop Feb 29, 2024
@rachelekm rachelekm deleted the rm/update-deployment-boto branch February 29, 2024 17:56
@rachelekm rachelekm mentioned this pull request Mar 28, 2024
4 tasks
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.

2 participants