Skip to content

Commit

Permalink
Change back to component
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-taf committed Oct 18, 2024
1 parent 6ffb987 commit 1c6ef53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/datadog/apps/cpustress/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type EcsComponent struct {
}

func EcsAppDefinition(e aws.Environment, clusterArn pulumi.StringInput, opts ...pulumi.ResourceOption) (*ecsComp.Workload, error) {
namer := e.Namer.WithPrefix("cpustress")
namer := e.Namer.WithPrefix("cpustress").WithPrefix("ec2")
opts = append(opts, e.WithProviders(config.ProviderAWS, config.ProviderAWSX))

ecsComponent := &ecsComp.Workload{}
Expand Down
17 changes: 10 additions & 7 deletions components/datadog/apps/cpustress/ecsFargate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ package cpustress
import (
"github.com/DataDog/test-infra-definitions/common/config"
fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake"
ecsComp "github.com/DataDog/test-infra-definitions/components/ecs"
"github.com/DataDog/test-infra-definitions/resources/aws"
ecsClient "github.com/DataDog/test-infra-definitions/resources/aws/ecs"
classicECS "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
"github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func FargateAppDefinition(e aws.Environment, clusterArn pulumi.StringInput, apiKeySSMParamName pulumi.StringInput, fakeIntake *fakeintakeComp.Fakeintake, opts ...pulumi.ResourceOption) (*ecsComp.Workload, error) {
namer := e.Namer.WithPrefix("cpustress")
type EcsFargateComponent struct {
pulumi.ResourceState
}

func FargateAppDefinition(e aws.Environment, clusterArn pulumi.StringInput, apiKeySSMParamName pulumi.StringInput, fakeIntake *fakeintakeComp.Fakeintake, opts ...pulumi.ResourceOption) (*EcsFargateComponent, error) {
namer := e.Namer.WithPrefix("cpustress").WithPrefix("fg")
opts = append(opts, e.WithProviders(config.ProviderAWS, config.ProviderAWSX))

EcsFargateComponent := &ecsComp.Workload{}
if err := e.Ctx().RegisterComponentResource("dd:apps", namer.ResourceName("grp"), EcsFargateComponent, opts...); err != nil {
ecsFargateComponent := &EcsFargateComponent{}
if err := e.Ctx().RegisterComponentResource("dd:apps", namer.ResourceName("grp"), ecsFargateComponent, opts...); err != nil {
return nil, err
}

opts = append(opts, pulumi.Parent(EcsFargateComponent))
opts = append(opts, pulumi.Parent(ecsFargateComponent))

stressContainer := &ecs.TaskDefinitionContainerDefinitionArgs{
Name: pulumi.String("stress-ng"),
Expand Down Expand Up @@ -64,5 +67,5 @@ func FargateAppDefinition(e aws.Environment, clusterArn pulumi.StringInput, apiK
return nil, err
}

return EcsFargateComponent, nil
return ecsFargateComponent, nil
}

0 comments on commit 1c6ef53

Please sign in to comment.