json - 在安全组中使用前缀列表

标签 json amazon-web-services aws-cloudformation aws-security-group

如果我要使用 AWS 文档来使用 CloudFormation ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html ) 创建安全组,那么它似乎缺乏我想要实现的目标。有很多示例可以将导出规则配置为使用 CIDR 值作为目的地,这一切都非常好。

但我想要实现的是使用前缀列表 id (pl-112233) 作为网络目的地

例如:

    "SecurityGroupEgress" : [{
        "IpProtocol" : "tcp",
        "FromPort" : 80,
        "ToPort" : 80,
        "CidrIp" : "0.0.0.0/0" # using prefix list example pl-112233
    }]

不幸的是,我找不到对此要求的任何支持,我想了解其他人是否遇到过这个困难。我应该指出,这些前缀列表是预先存在的,不需要作为此 CloudFormation 的一部分进行创建。

最佳答案

基于AWS::EC2::SecurityGroup Egress - AWS CloudFormation ,看来你可以使用:

 "SecurityGroupEgress" : [{
        "IpProtocol" : "tcp",
        "FromPort" : 80,
        "ToPort" : 80,
        "DestinationPrefixListId" : "pl-112233"
    }]

关于json - 在安全组中使用前缀列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71790547/

相关文章:

c# - 无法将当前 JSON 对象(例如 {"name":"value"})反序列化为类型 'System.Collections.Generic.List` 1

javascript - Django/AngularJS : How do I access my Python Context Items from my AngularJS Script

javascript - JSON 解析 - 内存依赖?

amazon-web-services - 使用 CloudFormation 创建的 EMR 集群未显示

amazon-web-services - 将Apache Camel集成到Amazon Kinesis Streaming Service

amazon-web-services - 将 lambda 附加到现有 API GW cloudform

amazon-web-services - 如何将 lambda 函数放入无服务器的嵌套堆栈中?

python - json.decoder.JSONDecodeError : Expecting value: line 1 column 1 (char 0)

node.js - 如何处理来自SQS的多条消息?

amazon-web-services - 如何通过 AWS SAM 提供 Lambda S3 策略