Skip to content

Instantly share code, notes, and snippets.

@mccahan
Created March 3, 2022 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mccahan/99d89fbd127c10c65987f2534ac49754 to your computer and use it in GitHub Desktop.
Save mccahan/99d89fbd127c10c65987f2534ac49754 to your computer and use it in GitHub Desktop.
'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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment