I'm trying to create an AWS S3 Bucket with cloud formation.
S3 bucket name needs to be lowercase but I want to use a paramenter to compound that name. This parameter comes uppercase.
I founded a way.
I read this.
This is my code:
Parameters:
# Global
ServiceName:
Type: String
Description: 'Service Name'
Default: content-input
Environment:
Type: String
Description: 'Environment Name'
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Join ['-',
[
content-input,
'Fn::Transform':
- Name: 'String'
Parameters:
InputString: !Ref Environment
Operation: Lower
]]
But I get this error.
while parsing a flow node
expected the node content, but found '-'
in "<unicode string>", line 157, column 11:
- Name: 'String'
I tried this other syntax referered here
Parameters:
# Global
ServiceName:
Type: String
Description: 'Service Name'
Default: content-input
Environment:
Type: String
Description: 'Environment Name'
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Join ['-',
[
content-input,
'Fn::Transform':
Name: 'String'
Parameters:
InputString: !Ref Environment
Operation: Lower
]]
But I get:
while parsing a flow sequence
in "<unicode string>", line 154, column 7:
[
^
expected ',' or ']', but got ':'
in "<unicode string>", line 157, column 15:
Name: 'String'
^
Of Course, this work perfectly.
Parameters:
# Global
ServiceName:
Type: String
Description: 'Service Name'
Default: content-input
Environment:
Type: String
Description: 'Environment Name'
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Join ['-',
[
content-input,
mytext
]]
How is the right syntax?