【问题标题】:How do I get the file system id for aws-cdk EFS?如何获取 aws-cdk EFS 的文件系统 ID?
【发布时间】:2020-02-18 12:25:15
【问题描述】:
const fileSystem = new efs.CfnFileSystem(this, 'EFS', {}); //This creates the file system
new cdk.CfnOutput(this, 'FileSystemID', { value: fileSystem.???? }); 

我需要将 filesystemid 作为环境变量传递给其他资源

【问题讨论】:

    标签: amazon-web-services aws-cdk amazon-efs


    【解决方案1】:
    const fileSystem = new efs.CfnFileSystem(this, 'EFS', {
    
        });
    
    
        const mount = new efs.CfnMountTarget(this, 'MountTarget', {
    
          fileSystemId: fileSystem.ref,
          securityGroups: [vpc.vpcDefaultSecurityGroup],
          subnetId: vpc.publicSubnets[0].subnetId,
    
        });
    
        new cdk.CfnOutput(this, 'FileSystemId', { value: mount.fileSystemId });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-26
      • 1970-01-01
      • 1970-01-01
      • 2021-05-15
      相关资源
      最近更新 更多