2017-04-26 112 views
0

我在弄清楚为什么传递一个EFS卷ID为cloudformation模板时,这不起作用麻烦:如何正确地将EFS FileSystem 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 

我得到错误:

parameter type AWS::EFS::FileSystem::Id for parameter name EFSFileSystem does not exist

但是这确实传递ID(FS-XXXXXXX):

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

不应该将类型设置为AWS :: EFS :: FileSystem :: Id的工作?

回答

2

没有资源类型的AWS :: EFS :: FileSystem :: Id。只有FileSystem资源类型。如果您将参数传递到您的cloudformation中并且设置了'Type',那么您将设置参数的类型,该参数只能是String,Number,List,CommaDelimitedList。 Cloudformation将验证输入的值是否与这些类型中的一个匹配,而不是Cloudformation资源类型。

Cloudformation资源类型是您可以在AWS中创建的'东西'。参数Type是您期望的值是什么?这就是为什么使用类型字符串它传递了fs-xxxxxxx值。

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