Skip to content

Commit b8b45c1

Browse files
flacatusadrianriobo
authored andcommitted
fix: expand the tags to all resources not only launch template
Signed-off-by: flacatus <[email protected]>
1 parent 91f27b8 commit b8b45c1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

pkg/provider/aws/constants/constants.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ const (
1212
ECSCredentialsRelativeURIENV = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
1313
DefaultAWSRegion = "us-east-1"
1414
)
15+
16+
const (
17+
PulumiAwsResourceInstance = "instance"
18+
PulumiAwsResourceVolume = "volume"
19+
PulumiAwsResourceNetworkInterface = "network-interface"
20+
PulumiAwsResourceSpotInstanceRequest = "spot-instances-request"
21+
)

pkg/provider/aws/modules/ec2/compute/compute.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/pulumi/pulumi-tls/sdk/v5/go/tls"
1313
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
1414
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
15+
"github.com/redhat-developer/mapt/pkg/provider/aws/constants"
1516
"github.com/redhat-developer/mapt/pkg/provider/aws/modules/bastion"
1617
"github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/keypair"
1718
"github.com/redhat-developer/mapt/pkg/provider/util/command"
@@ -136,6 +137,24 @@ func (r ComputeRequest) spotInstance(ctx *pulumi.Context) (*autoscaling.Group, e
136137
},
137138
},
138139
Tags: maptContext.ResourceTags(),
140+
TagSpecifications: ec2.LaunchTemplateTagSpecificationArray{
141+
&ec2.LaunchTemplateTagSpecificationArgs{
142+
ResourceType: pulumi.String(constants.PulumiAwsResourceInstance),
143+
Tags: maptContext.ResourceTags(),
144+
},
145+
&ec2.LaunchTemplateTagSpecificationArgs{
146+
ResourceType: pulumi.String(constants.PulumiAwsResourceVolume),
147+
Tags: maptContext.ResourceTags(),
148+
},
149+
&ec2.LaunchTemplateTagSpecificationArgs{
150+
ResourceType: pulumi.String(constants.PulumiAwsResourceNetworkInterface),
151+
Tags: maptContext.ResourceTags(),
152+
},
153+
&ec2.LaunchTemplateTagSpecificationArgs{
154+
ResourceType: pulumi.String(constants.PulumiAwsResourceSpotInstanceRequest),
155+
Tags: maptContext.ResourceTags(),
156+
},
157+
},
139158
}
140159
if r.InstanceProfile != nil {
141160
args.IamInstanceProfile = ec2.LaunchTemplateIamInstanceProfileArgs{

0 commit comments

Comments
 (0)