All the examples of using `ec2.NewSecurityGroup` o...
# golang
s
All the examples of using
ec2.NewSecurityGroup
only have a single ingress rule. What's the syntax for specifying multiple ingress rules?
l
To create additional entries in the array you would do something like the following:
Copy code
Ingress: ec2.SecurityGroupIngressArray{
	ec2.SecurityGroupIngressArgs{
		Protocol:   pulumi.String("tcp"),
		FromPort:   <http://pulumi.Int|pulumi.Int>(80),
		ToPort:     <http://pulumi.Int|pulumi.Int>(80),
		CidrBlocks: pulumi.StringArray{pulumi.String("0.0.0.0/0")},
	},
ec2.SecurityGroupIngressArgs{
		Protocol:   pulumi.String("tcp"),
		FromPort:   <http://pulumi.Int|pulumi.Int>(81),
		ToPort:     <http://pulumi.Int|pulumi.Int>(81),
		CidrBlocks: pulumi.StringArray{pulumi.String("0.0.0.0/0")},
	},
},
s
Thanks @lemon-agent-27707!