This message was deleted.
# general
s
This message was deleted.
g
Can you share your code?
s
Copy code
publicSecurityGroup, err := ec2.NewSecurityGroup(ctx, "sg1", &ec2.SecurityGroupArgs{
			Description: "For inter-security group traffic",
			VpcId:       vpc.ID(),
			Ingress: []map[string]interface{}{
				{
					"protocol":   "tcp",
					"fromPort":   22,
					"toPort":     22,
					"cidrBlocks": []string{"0.0.0.0/0"},
				},
			},
		})

		privateSecurityGroup, err := ec2.NewSecurityGroup(ctx, "sg2", &ec2.SecurityGroupArgs{
			Description: "For intra-security group traffic",
			Ingress: []map[string]interface{}{
				{
					"protocol": "tcp",
					"fromPort": 0,
					"toPort":   65535,
					"sourceSecurityGroupId": publicSecurityGroup.ID(),
				},
			},
		})
g
for inline ingress rules, I believe you want
securityGroups
instead of
sourceSecurityGroupId
sourceSecurityGroupId
is used for
SecurityGroupRule
resources
s
Awesome that worked - thanks!
👍 1