0

I am getting this error while using SAM template for deploying resources

below is the script - sam package --template-file test.json --s3-bucket $s3_bucket --s3-prefix packages/my_folder/ --output-template-file samtemplate.yml

getting this error even tried after rollbacking to previous working status

return any([url.startswith(prefix) for prefix in ["s3://", "http://", "https://"]]) File "/usr/local/lib/python3.8/site-packages/samcli/lib/providers/sam_stack_provider.py", line 250, in return any([url.startswith(prefix) for prefix in ["s3://", "http://", "https://"]]) AttributeError: 'collections.OrderedDict' object has no attribute 'startswith'

After adding some debug message I got this error 2021-04-22 06:42:32,820 | Unable to resolve property S3bucketname: OrderedDict([('Fn::Select', ['0', OrderedDict([('Fn::Split', ['/', OrderedDict([('Ref', 'TemplateS3BucketName')])])])])]). Leaving as is.

  • We can't see your template. At a guess, are there any places in your template where a URL string is required but you've provided a dictionary (an object within braces)? – jarmod Apr 21 '21 at 14:58
  • Yes we have this dynamic substitution everywhere in the script where we are using braces instead of direct url – Priya Garg Apr 21 '21 at 15:15
  • Can you add a minimal example of this template to your post? – jarmod Apr 21 '21 at 15:17
  • @jarmod After adding debug command in the script I am getting this error 2021-04-22 06:42:32,820 | Unable to resolve property S3bucketname: OrderedDict([('Fn::Select', ['0', OrderedDict([('Fn::Split', ['/', OrderedDict([('Ref', 'TemplateS3BucketName')])])])])]). Leaving as is. – Priya Garg Apr 22 '21 at 06:47

0 Answers0