Skip to content

Commit

Permalink
Merge pull request #2026 from justinmir/tag-at-creation-time-sg
Browse files Browse the repository at this point in the history
ec2: Create security group with tags in the spec
  • Loading branch information
MisterMX authored Apr 8, 2024
2 parents 1fd494d + 653f8c0 commit ddd940a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/ec2/securitygroup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex
GroupName: aws.String(cr.Spec.ForProvider.GroupName),
VpcId: cr.Spec.ForProvider.VPCID,
Description: aws.String(cr.Spec.ForProvider.Description),
TagSpecifications: []awsec2types.TagSpecification{
{
ResourceType: awsec2types.ResourceTypeSecurityGroup,
Tags: ec2.GenerateEC2TagsV1Beta1(cr.Spec.ForProvider.Tags),
},
},
})
if err != nil {
return managed.ExternalCreation{}, errorutils.Wrap(err, errCreate)
Expand Down

0 comments on commit ddd940a

Please sign in to comment.