我正在尝试为 SecurityGroup 创建 cloudformation 模板。我很难在文档 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-ingress.html 上查看正确的详细信息
附上我需要做什么的快照:
创建此 cloudformation 模板需要帮助
最佳答案
根据您的输入,这里有一个示例。
请随意调整您认为合适的名称和描述。
SimpleSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: "Sample description"
GroupName: "Sample-SG"
VpcId: 'INSERT_VPC_ID_HERE'
SecurityGroupIngress:
-
CidrIp: '10.X.X.X/24'
IpProtocol: "icmp"
-
SourceSecurityGroupId: 'sg-xxxxxxx'
IpProtocol: "tcp"
FromPort: 443
ToPort: 443
请引用AWS::EC2::SecurityGroupIngress有关更多详细信息的文档。
关于amazon-web-services - AWS 中 SecurityGroup 的 HTTPS 和 ICMP 入口规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76907663/