Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services FindInMap内的云形成变换_Amazon Web Services_Amazon Cloudformation - Fatal编程技术网

Amazon web services FindInMap内的云形成变换

Amazon web services FindInMap内的云形成变换,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,我正在尝试转换传递给FindInMap的一个键。我试图遵循的示例如下所示: 我收到以下错误消息作为响应: mapping values are not allowed here in "<unicode string>", line 186, column 28: - 'Fn::Transform': ^ (line: 186) 此处不允许使用映射值 在“”第186行

我正在尝试转换传递给FindInMap的一个键。我试图遵循的示例如下所示:

我收到以下错误消息作为响应:

mapping values are not allowed here
  in "<unicode string>", line 186, column 28:
              - 'Fn::Transform':
                               ^ (line: 186)
此处不允许使用映射值 在“”第186行第28列中: -“Fn::Transform”: ^(第186行)
我的语法有问题吗?还是通常不可能执行此操作?

这是一个语法错误。给出了
Replace
操作的一个示例。这是一个我能够部署的模板,它在
FindInMap
中使用
Transform
,并创建一个带有
testkey:testvalue
标记的S3 bucket:

Parameters:
  Env:
    Type: String
    Default: env-dev

Mappings:
  envdev:
    us-east-1:
      AppSubnetIds: test-value

Resources:
  S3Bucket:
    Type: "AWS::S3::Bucket"
    Properties:
      Tags:
        - Key: test-key
          Value: 
            'Fn::FindInMap':
              - 'Fn::Transform':
                   Name: 'String'
                   Parameters:
                      InputString: !Ref Env
                      Operation: Replace
                      Old: "-"
                      New: ""
              - !Ref "AWS::Region"
              - AppSubnetIds
Parameters:
  Env:
    Type: String
    Default: env-dev

Mappings:
  envdev:
    us-east-1:
      AppSubnetIds: test-value

Resources:
  S3Bucket:
    Type: "AWS::S3::Bucket"
    Properties:
      Tags:
        - Key: test-key
          Value: 
            'Fn::FindInMap':
              - 'Fn::Transform':
                   Name: 'String'
                   Parameters:
                      InputString: !Ref Env
                      Operation: Replace
                      Old: "-"
                      New: ""
              - !Ref "AWS::Region"
              - AppSubnetIds