Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion internal/pkg/object/command/ecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type clusterContext struct {
type vpcConfig struct {
Subnets []string `yaml:"subnets,omitempty" json:"subnets,omitempty"`
SecurityGroups []string `yaml:"security_groups,omitempty" json:"security_groups,omitempty"`
AssignPublicIp bool `yaml:"assign_public_ip,omitempty" json:"assign_public_ip,omitempty"`
}

// Task definition wrapper with pre-computed essential containers map
Expand Down Expand Up @@ -649,7 +650,7 @@ func runTask(ctx context.Context, execCtx *executionContext, startedBy string, t
AwsvpcConfiguration: &types.AwsVpcConfiguration{
Subnets: execCtx.ClusterConfig.VPCConfig.Subnets,
SecurityGroups: execCtx.ClusterConfig.VPCConfig.SecurityGroups,
AssignPublicIp: types.AssignPublicIpDisabled,
AssignPublicIp: assignPublicIp(execCtx.ClusterConfig.VPCConfig.AssignPublicIp),
},
},
}
Expand Down Expand Up @@ -841,6 +842,14 @@ func retryWithBackoff(ctx context.Context, maxRetries int, op func() error) erro
return err
}

// assignPublicIp converts a bool to the ECS AssignPublicIp enum value.
func assignPublicIp(enabled bool) types.AssignPublicIp {
if enabled {
return types.AssignPublicIpEnabled
}
return types.AssignPublicIpDisabled
}

// isThrottlingError reports whether err is an AWS throttling error.
func isThrottlingError(err error) bool {
var apiErr smithy.APIError
Expand Down
Loading