如何正确地将EFS FileSystem ID传递给云信息模板?

时间:2017-04-26 17:47:26

标签: amazon-cloudformation amazon-efs aws-elasticfilesystem

在将EFS卷ID传递到云形态模板时,我无法弄清楚为什么这不起作用:

Parameters:
    EFSFileSystem:
        Description: EFS file system to mount
        Type: AWS::EFS::FileSystem::Id

这也不起作用:

Parameters:
    EFSFileSystem:
        Description: EFS file system to mount
        Type: AWS::EFS::FileSystem

我收到错误:

  

参数类型AWS :: EFS :: FileSystem :: Id参数名称EFSFileSystem不存在

但这确实传递了ID(fs-xxxxxxx):

Parameters:
    EFSFileSystem:
        Description: EFS file system to mount
        Type: String

不应该将类型设置为AWS :: EFS :: FileSystem :: Id吗?

1 个答案:

答案 0 :(得分:3)

没有AWS :: EFS :: FileSystem :: Id的资源类型。只有FileSystem资源类型。如果要将参数传递到cloudformation并设置“Type”,则设置的参数类型只能是String,Number,List,CommaDelimitedList。 Cloudformation将验证输入的值是否与这些类型之一匹配,而不是Cloudformation资源类型。

Cloudformation资源类型是您可以在AWS中创建的“事物”。参数类型是您期望的值是什么?这就是使用Type String传递fs-xxxxxxx值的原因。

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html