Skip to content

Instantly share code, notes, and snippets.

View mccahan's full-sized avatar

Ryan McCahan mccahan

View GitHub Profile
@mccahan
mccahan / ElasticBeanstalk Bug.md
Created March 3, 2022 04:29
'NoneType' object has no attribute 'is_default' using ElasticBeanstalk files

Not sure where else to put this, but if you're using ElasticBeanstalk .ebextension config files to download from S3 and load into your app and you're encountering an error "'NoneType' object has no attribute 'is_default' using ElasticBeanstalk files":

The endpoint deploy file in AWS Linux 2, /usr/lib/python3.7/site-packages/cfnbootstrap/endpoint_tool.py, has a bug where any S3 URLs matching this Regex will fail:

S3_WITH_BUCKET_PATTERN = r'https://([a-z0-9-\.]+)[\.-]s3(-fips)?([\.-][a-z0-9-]+){0,2}?\.amazonaws\.com(.*)$'

The fix is to make sure your S3 URLs look like https://s3.us-east-1.amazonaws.com/my-bucket-name/my-file-name.txt so they match the other regular expression, which does not fail on a bug.

Keybase proof

I hereby claim:

  • I am mccahan on github.
  • I am mccahan (https://keybase.io/mccahan) on keybase.
  • I have a public key whose fingerprint is B177 B2B0 842B 2495 8028 DC0C 8FA6 94D1 8734 BCF9

To claim this, I am signing this object: