Documentation ¶
Index ¶
- func AppProtocol_SetGrpc(val AppProtocol)
- func AppProtocol_SetHttp(val AppProtocol)
- func AppProtocol_SetHttp2(val AppProtocol)
- func AsgCapacityProvider_IsConstruct(x interface{}) *bool
- func BaseService_IsConstruct(x interface{}) *bool
- func BaseService_IsOwnedResource(construct constructs.IConstruct) *bool
- func BaseService_IsResource(construct constructs.IConstruct) *bool
- func BottleRocketImage_IsBottleRocketImage(x interface{}) *bool
- func BuiltInAttributes_AMI_ID() *string
- func BuiltInAttributes_AVAILABILITY_ZONE() *string
- func BuiltInAttributes_INSTANCE_ID() *string
- func BuiltInAttributes_INSTANCE_TYPE() *string
- func BuiltInAttributes_OS_TYPE() *string
- func CfnCapacityProvider_CFN_RESOURCE_TYPE_NAME() *string
- func CfnCapacityProvider_IsCfnElement(x interface{}) *bool
- func CfnCapacityProvider_IsCfnResource(x interface{}) *bool
- func CfnCapacityProvider_IsConstruct(x interface{}) *bool
- func CfnClusterCapacityProviderAssociations_CFN_RESOURCE_TYPE_NAME() *string
- func CfnClusterCapacityProviderAssociations_IsCfnElement(x interface{}) *bool
- func CfnClusterCapacityProviderAssociations_IsCfnResource(x interface{}) *bool
- func CfnClusterCapacityProviderAssociations_IsConstruct(x interface{}) *bool
- func CfnCluster_CFN_RESOURCE_TYPE_NAME() *string
- func CfnCluster_IsCfnElement(x interface{}) *bool
- func CfnCluster_IsCfnResource(x interface{}) *bool
- func CfnCluster_IsConstruct(x interface{}) *bool
- func CfnPrimaryTaskSet_CFN_RESOURCE_TYPE_NAME() *string
- func CfnPrimaryTaskSet_IsCfnElement(x interface{}) *bool
- func CfnPrimaryTaskSet_IsCfnResource(x interface{}) *bool
- func CfnPrimaryTaskSet_IsConstruct(x interface{}) *bool
- func CfnService_CFN_RESOURCE_TYPE_NAME() *string
- func CfnService_IsCfnElement(x interface{}) *bool
- func CfnService_IsCfnResource(x interface{}) *bool
- func CfnService_IsConstruct(x interface{}) *bool
- func CfnTaskDefinition_CFN_RESOURCE_TYPE_NAME() *string
- func CfnTaskDefinition_IsCfnElement(x interface{}) *bool
- func CfnTaskDefinition_IsCfnResource(x interface{}) *bool
- func CfnTaskDefinition_IsConstruct(x interface{}) *bool
- func CfnTaskSet_CFN_RESOURCE_TYPE_NAME() *string
- func CfnTaskSet_IsCfnElement(x interface{}) *bool
- func CfnTaskSet_IsCfnResource(x interface{}) *bool
- func CfnTaskSet_IsConstruct(x interface{}) *bool
- func Cluster_IsCluster(x interface{}) *bool
- func Cluster_IsConstruct(x interface{}) *bool
- func Cluster_IsOwnedResource(construct constructs.IConstruct) *bool
- func Cluster_IsResource(construct constructs.IConstruct) *bool
- func ContainerDefinition_CONTAINER_PORT_USE_RANGE() *float64
- func ContainerDefinition_IsConstruct(x interface{}) *bool
- func Ec2Service_IsConstruct(x interface{}) *bool
- func Ec2Service_IsOwnedResource(construct constructs.IConstruct) *bool
- func Ec2Service_IsResource(construct constructs.IConstruct) *bool
- func Ec2TaskDefinition_IsConstruct(x interface{}) *bool
- func Ec2TaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
- func Ec2TaskDefinition_IsResource(construct constructs.IConstruct) *bool
- func ExternalService_IsConstruct(x interface{}) *bool
- func ExternalService_IsOwnedResource(construct constructs.IConstruct) *bool
- func ExternalService_IsResource(construct constructs.IConstruct) *bool
- func ExternalTaskDefinition_IsConstruct(x interface{}) *bool
- func ExternalTaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
- func ExternalTaskDefinition_IsResource(construct constructs.IConstruct) *bool
- func FargateService_IsConstruct(x interface{}) *bool
- func FargateService_IsOwnedResource(construct constructs.IConstruct) *bool
- func FargateService_IsResource(construct constructs.IConstruct) *bool
- func FargateTaskDefinition_IsConstruct(x interface{}) *bool
- func FargateTaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
- func FargateTaskDefinition_IsResource(construct constructs.IConstruct) *bool
- func FirelensLogRouter_CONTAINER_PORT_USE_RANGE() *float64
- func FirelensLogRouter_IsConstruct(x interface{}) *bool
- func LinuxParameters_IsConstruct(x interface{}) *bool
- func NewAppMeshProxyConfiguration_Override(a AppMeshProxyConfiguration, props *AppMeshProxyConfigurationConfigProps)
- func NewAppProtocol_Override(a AppProtocol, value *string)
- func NewAsgCapacityProvider_Override(a AsgCapacityProvider, scope constructs.Construct, id *string, ...)
- func NewAssetEnvironmentFile_Override(a AssetEnvironmentFile, path *string, options *awss3assets.AssetOptions)
- func NewAssetImage_Override(a AssetImage, directory *string, props *AssetImageProps)
- func NewAwsLogDriver_Override(a AwsLogDriver, props *AwsLogDriverProps)
- func NewBaseService_Override(b BaseService, scope constructs.Construct, id *string, props *BaseServiceProps, ...)
- func NewBottleRocketImage_Override(b BottleRocketImage, props *BottleRocketImageProps)
- func NewBuiltInAttributes_Override(b BuiltInAttributes)
- func NewCfnCapacityProvider_Override(c CfnCapacityProvider, scope constructs.Construct, id *string, ...)
- func NewCfnClusterCapacityProviderAssociations_Override(c CfnClusterCapacityProviderAssociations, scope constructs.Construct, ...)
- func NewCfnCluster_Override(c CfnCluster, scope constructs.Construct, id *string, props *CfnClusterProps)
- func NewCfnPrimaryTaskSet_Override(c CfnPrimaryTaskSet, scope constructs.Construct, id *string, ...)
- func NewCfnService_Override(c CfnService, scope constructs.Construct, id *string, props *CfnServiceProps)
- func NewCfnTaskDefinition_Override(c CfnTaskDefinition, scope constructs.Construct, id *string, ...)
- func NewCfnTaskSet_Override(c CfnTaskSet, scope constructs.Construct, id *string, props *CfnTaskSetProps)
- func NewCluster_Override(c Cluster, scope constructs.Construct, id *string, props *ClusterProps)
- func NewContainerDefinition_Override(c ContainerDefinition, scope constructs.Construct, id *string, ...)
- func NewContainerImage_Override(c ContainerImage)
- func NewEc2Service_Override(e Ec2Service, scope constructs.Construct, id *string, props *Ec2ServiceProps)
- func NewEc2TaskDefinition_Override(e Ec2TaskDefinition, scope constructs.Construct, id *string, ...)
- func NewEcrImage_Override(e EcrImage, repository awsecr.IRepository, tagOrDigest *string)
- func NewEnvironmentFile_Override(e EnvironmentFile)
- func NewExternalService_Override(e ExternalService, scope constructs.Construct, id *string, ...)
- func NewExternalTaskDefinition_Override(e ExternalTaskDefinition, scope constructs.Construct, id *string, ...)
- func NewFargateService_Override(f FargateService, scope constructs.Construct, id *string, ...)
- func NewFargateTaskDefinition_Override(f FargateTaskDefinition, scope constructs.Construct, id *string, ...)
- func NewFireLensLogDriver_Override(f FireLensLogDriver, props *FireLensLogDriverProps)
- func NewFirelensLogRouter_Override(f FirelensLogRouter, scope constructs.Construct, id *string, ...)
- func NewFluentdLogDriver_Override(f FluentdLogDriver, props *FluentdLogDriverProps)
- func NewGelfLogDriver_Override(g GelfLogDriver, props *GelfLogDriverProps)
- func NewGenericLogDriver_Override(g GenericLogDriver, props *GenericLogDriverProps)
- func NewJournaldLogDriver_Override(j JournaldLogDriver, props *JournaldLogDriverProps)
- func NewJsonFileLogDriver_Override(j JsonFileLogDriver, props *JsonFileLogDriverProps)
- func NewLinuxParameters_Override(l LinuxParameters, scope constructs.Construct, id *string, ...)
- func NewListenerConfig_Override(l ListenerConfig)
- func NewLogDriver_Override(l LogDriver)
- func NewLogDrivers_Override(l LogDrivers)
- func NewPortMap_Override(p PortMap, networkmode NetworkMode, pm *PortMapping)
- func NewProxyConfiguration_Override(p ProxyConfiguration)
- func NewProxyConfigurations_Override(p ProxyConfigurations)
- func NewRepositoryImage_Override(r RepositoryImage, imageName *string, props *RepositoryImageProps)
- func NewS3EnvironmentFile_Override(s S3EnvironmentFile, bucket awss3.IBucket, key *string, objectVersion *string)
- func NewScalableTaskCount_Override(s ScalableTaskCount, scope constructs.Construct, id *string, ...)
- func NewSecret_Override(s Secret)
- func NewServiceConnect_Override(s ServiceConnect, networkmode NetworkMode, pm *PortMapping)
- func NewServiceManagedVolume_Override(s ServiceManagedVolume, scope constructs.Construct, id *string, ...)
- func NewSplunkLogDriver_Override(s SplunkLogDriver, props *SplunkLogDriverProps)
- func NewSyslogLogDriver_Override(s SyslogLogDriver, props *SyslogLogDriverProps)
- func NewTagParameterContainerImage_Override(t TagParameterContainerImage, repository awsecr.IRepository)
- func NewTaskDefinition_Override(t TaskDefinition, scope constructs.Construct, id *string, ...)
- func ScalableTaskCount_IsConstruct(x interface{}) *bool
- func ServiceManagedVolume_IsConstruct(x interface{}) *bool
- func TaskDefinition_IsConstruct(x interface{}) *bool
- func TaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
- func TaskDefinition_IsResource(construct constructs.IConstruct) *bool
- type AddAutoScalingGroupCapacityOptions
- type AddCapacityOptions
- type AlarmBehavior
- type AmiHardwareType
- type AppMeshProxyConfiguration
- type AppMeshProxyConfigurationConfigProps
- type AppMeshProxyConfigurationProps
- type AppProtocol
- type AsgCapacityProvider
- type AsgCapacityProviderProps
- type AssetEnvironmentFile
- func AssetEnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
- func EnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
- func NewAssetEnvironmentFile(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
- func S3EnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
- type AssetImage
- func AssetImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
- func ContainerImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
- func EcrImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
- func NewAssetImage(directory *string, props *AssetImageProps) AssetImage
- func RepositoryImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
- func TagParameterContainerImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
- type AssetImageProps
- type AssociateCloudMapServiceOptions
- type AuthorizationConfig
- type AwsLogDriver
- type AwsLogDriverMode
- type AwsLogDriverProps
- type BaseLogDriverProps
- type BaseMountPoint
- type BaseService
- type BaseServiceOptions
- type BaseServiceProps
- type BinPackResource
- type BottleRocketImage
- type BottleRocketImageProps
- type BottlerocketEcsVariant
- type BuiltInAttributes
- type Capability
- type CapacityProviderStrategy
- type CfnCapacityProvider
- type CfnCapacityProviderProps
- type CfnCapacityProvider_AutoScalingGroupProviderProperty
- type CfnCapacityProvider_ManagedScalingProperty
- type CfnCluster
- type CfnClusterCapacityProviderAssociations
- type CfnClusterCapacityProviderAssociationsProps
- type CfnClusterCapacityProviderAssociations_CapacityProviderStrategyProperty
- type CfnClusterProps
- type CfnCluster_CapacityProviderStrategyItemProperty
- type CfnCluster_ClusterConfigurationProperty
- type CfnCluster_ClusterSettingsProperty
- type CfnCluster_ExecuteCommandConfigurationProperty
- type CfnCluster_ExecuteCommandLogConfigurationProperty
- type CfnCluster_ServiceConnectDefaultsProperty
- type CfnPrimaryTaskSet
- type CfnPrimaryTaskSetProps
- type CfnService
- type CfnServiceProps
- type CfnService_AwsVpcConfigurationProperty
- type CfnService_CapacityProviderStrategyItemProperty
- type CfnService_DeploymentAlarmsProperty
- type CfnService_DeploymentCircuitBreakerProperty
- type CfnService_DeploymentConfigurationProperty
- type CfnService_DeploymentControllerProperty
- type CfnService_EBSTagSpecificationProperty
- type CfnService_LoadBalancerProperty
- type CfnService_LogConfigurationProperty
- type CfnService_NetworkConfigurationProperty
- type CfnService_PlacementConstraintProperty
- type CfnService_PlacementStrategyProperty
- type CfnService_SecretProperty
- type CfnService_ServiceConnectClientAliasProperty
- type CfnService_ServiceConnectConfigurationProperty
- type CfnService_ServiceConnectServiceProperty
- type CfnService_ServiceConnectTlsCertificateAuthorityProperty
- type CfnService_ServiceConnectTlsConfigurationProperty
- type CfnService_ServiceManagedEBSVolumeConfigurationProperty
- type CfnService_ServiceRegistryProperty
- type CfnService_ServiceVolumeConfigurationProperty
- type CfnService_TimeoutConfigurationProperty
- type CfnTaskDefinition
- type CfnTaskDefinitionProps
- type CfnTaskDefinition_AuthorizationConfigProperty
- type CfnTaskDefinition_ContainerDefinitionProperty
- type CfnTaskDefinition_ContainerDependencyProperty
- type CfnTaskDefinition_DeviceProperty
- type CfnTaskDefinition_DockerVolumeConfigurationProperty
- type CfnTaskDefinition_EFSVolumeConfigurationProperty
- type CfnTaskDefinition_EnvironmentFileProperty
- type CfnTaskDefinition_EphemeralStorageProperty
- type CfnTaskDefinition_FirelensConfigurationProperty
- type CfnTaskDefinition_HealthCheckProperty
- type CfnTaskDefinition_HostEntryProperty
- type CfnTaskDefinition_HostVolumePropertiesProperty
- type CfnTaskDefinition_InferenceAcceleratorProperty
- type CfnTaskDefinition_KernelCapabilitiesProperty
- type CfnTaskDefinition_KeyValuePairProperty
- type CfnTaskDefinition_LinuxParametersProperty
- type CfnTaskDefinition_LogConfigurationProperty
- type CfnTaskDefinition_MountPointProperty
- type CfnTaskDefinition_PortMappingProperty
- type CfnTaskDefinition_ProxyConfigurationProperty
- type CfnTaskDefinition_RepositoryCredentialsProperty
- type CfnTaskDefinition_ResourceRequirementProperty
- type CfnTaskDefinition_RuntimePlatformProperty
- type CfnTaskDefinition_SecretProperty
- type CfnTaskDefinition_SystemControlProperty
- type CfnTaskDefinition_TaskDefinitionPlacementConstraintProperty
- type CfnTaskDefinition_TmpfsProperty
- type CfnTaskDefinition_UlimitProperty
- type CfnTaskDefinition_VolumeFromProperty
- type CfnTaskDefinition_VolumeProperty
- type CfnTaskSet
- type CfnTaskSetProps
- type CfnTaskSet_AwsVpcConfigurationProperty
- type CfnTaskSet_LoadBalancerProperty
- type CfnTaskSet_NetworkConfigurationProperty
- type CfnTaskSet_ScaleProperty
- type CfnTaskSet_ServiceRegistryProperty
- type CloudMapNamespaceOptions
- type CloudMapOptions
- type Cluster
- type ClusterAttributes
- type ClusterProps
- type CommonTaskDefinitionAttributes
- type CommonTaskDefinitionProps
- type Compatibility
- type ContainerDefinition
- type ContainerDefinitionOptions
- type ContainerDefinitionProps
- type ContainerDependency
- type ContainerDependencyCondition
- type ContainerImage
- func AssetImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
- func AssetImage_FromTarball(tarballFile *string) ContainerImage
- func ContainerImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
- func ContainerImage_FromTarball(tarballFile *string) ContainerImage
- func EcrImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
- func EcrImage_FromTarball(tarballFile *string) ContainerImage
- func RepositoryImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
- func RepositoryImage_FromTarball(tarballFile *string) ContainerImage
- func TagParameterContainerImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
- func TagParameterContainerImage_FromTarball(tarballFile *string) ContainerImage
- type ContainerImageConfig
- type ContainerMountPoint
- type CpuArchitecture
- type CpuUtilizationScalingProps
- type DeploymentAlarmConfig
- type DeploymentAlarmOptions
- type DeploymentCircuitBreaker
- type DeploymentController
- type DeploymentControllerType
- type Device
- type DevicePermission
- type DockerVolumeConfiguration
- type EBSTagSpecification
- type EbsPropagatedTagSource
- type Ec2Service
- type Ec2ServiceAttributes
- type Ec2ServiceProps
- type Ec2TaskDefinition
- type Ec2TaskDefinitionAttributes
- type Ec2TaskDefinitionProps
- type EcrImage
- func AssetImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
- func ContainerImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
- func EcrImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
- func NewEcrImage(repository awsecr.IRepository, tagOrDigest *string) EcrImage
- func RepositoryImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
- func TagParameterContainerImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
- type EcsOptimizedImage
- func EcsOptimizedImage_AmazonLinux(options *EcsOptimizedImageOptions) EcsOptimizedImage
- func EcsOptimizedImage_AmazonLinux2(hardwareType AmiHardwareType, options *EcsOptimizedImageOptions) EcsOptimizedImage
- func EcsOptimizedImage_AmazonLinux2023(hardwareType AmiHardwareType, options *EcsOptimizedImageOptions) EcsOptimizedImage
- func EcsOptimizedImage_Windows(windowsVersion WindowsOptimizedVersion, options *EcsOptimizedImageOptions) EcsOptimizedImage
- type EcsOptimizedImageOptions
- type EcsTarget
- type EfsVolumeConfiguration
- type EnvironmentFile
- type EnvironmentFileConfig
- type EnvironmentFileType
- type ExecuteCommandConfiguration
- type ExecuteCommandLogConfiguration
- type ExecuteCommandLogging
- type ExternalService
- type ExternalServiceAttributes
- type ExternalServiceProps
- type ExternalTaskDefinition
- type ExternalTaskDefinitionAttributes
- type ExternalTaskDefinitionProps
- type FargatePlatformVersion
- type FargateService
- type FargateServiceAttributes
- type FargateServiceProps
- type FargateTaskDefinition
- type FargateTaskDefinitionAttributes
- type FargateTaskDefinitionProps
- type FileSystemType
- type FireLensLogDriver
- type FireLensLogDriverProps
- type FirelensConfig
- type FirelensConfigFileType
- type FirelensLogRouter
- type FirelensLogRouterDefinitionOptions
- type FirelensLogRouterProps
- type FirelensLogRouterType
- type FirelensOptions
- type FluentdLogDriver
- type FluentdLogDriverProps
- type GelfCompressionType
- type GelfLogDriver
- type GelfLogDriverProps
- type GenericLogDriver
- type GenericLogDriverProps
- type HealthCheck
- type Host
- type IBaseService
- func BaseService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
- func Ec2Service_FromEc2ServiceAttributes(scope constructs.Construct, id *string, attrs *Ec2ServiceAttributes) IBaseService
- func Ec2Service_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
- func ExternalService_FromExternalServiceAttributes(scope constructs.Construct, id *string, attrs *ExternalServiceAttributes) IBaseService
- func ExternalService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
- func FargateService_FromFargateServiceAttributes(scope constructs.Construct, id *string, attrs *FargateServiceAttributes) IBaseService
- func FargateService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
- type ICluster
- type IEc2Service
- type IEc2TaskDefinition
- type IEcsLoadBalancerTarget
- type IExternalService
- type IExternalTaskDefinition
- type IFargateService
- type IFargateTaskDefinition
- func FargateTaskDefinition_FromFargateTaskDefinitionArn(scope constructs.Construct, id *string, fargateTaskDefinitionArn *string) IFargateTaskDefinition
- func FargateTaskDefinition_FromFargateTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *FargateTaskDefinitionAttributes) IFargateTaskDefinition
- type IService
- type ITaskDefinition
- func Ec2TaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
- func Ec2TaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
- func ExternalTaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
- func ExternalTaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
- func FargateTaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
- func FargateTaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
- func TaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
- func TaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
- type ITaskDefinitionExtension
- type InferenceAccelerator
- type IpcMode
- type JournaldLogDriver
- type JournaldLogDriverProps
- type JsonFileLogDriver
- type JsonFileLogDriverProps
- type LaunchType
- type LinuxParameters
- type LinuxParametersProps
- type ListenerConfig
- type LoadBalancerTargetOptions
- type LogDriver
- func AwsLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func FireLensLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func FluentdLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func GelfLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func GenericLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func JournaldLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func JsonFileLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func LogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func LogDrivers_AwsLogs(props *AwsLogDriverProps) LogDriver
- func LogDrivers_Firelens(props *FireLensLogDriverProps) LogDriver
- func LogDrivers_Fluentd(props *FluentdLogDriverProps) LogDriver
- func LogDrivers_Gelf(props *GelfLogDriverProps) LogDriver
- func LogDrivers_Journald(props *JournaldLogDriverProps) LogDriver
- func LogDrivers_JsonFile(props *JsonFileLogDriverProps) LogDriver
- func LogDrivers_Splunk(props *SplunkLogDriverProps) LogDriver
- func LogDrivers_Syslog(props *SyslogLogDriverProps) LogDriver
- func SplunkLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- func SyslogLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
- type LogDriverConfig
- type LogDrivers
- type MachineImageType
- type MemoryUtilizationScalingProps
- type MountPoint
- type NetworkMode
- type OperatingSystemFamily
- func OperatingSystemFamily_LINUX() OperatingSystemFamily
- func OperatingSystemFamily_Of(family *string) OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2004_CORE() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2016_FULL() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2019_CORE() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2019_FULL() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2022_CORE() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_2022_FULL() OperatingSystemFamily
- func OperatingSystemFamily_WINDOWS_SERVER_20H2_CORE() OperatingSystemFamily
- type PidMode
- type PlacementConstraint
- type PlacementStrategy
- func PlacementStrategy_PackedBy(resource BinPackResource) PlacementStrategy
- func PlacementStrategy_PackedByCpu() PlacementStrategy
- func PlacementStrategy_PackedByMemory() PlacementStrategy
- func PlacementStrategy_Randomly() PlacementStrategy
- func PlacementStrategy_SpreadAcross(fields ...*string) PlacementStrategy
- func PlacementStrategy_SpreadAcrossInstances() PlacementStrategy
- type PortMap
- type PortMapping
- type PropagatedTagSource
- type Protocol
- type ProxyConfiguration
- type ProxyConfigurations
- type RepositoryImage
- func AssetImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
- func ContainerImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
- func EcrImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
- func NewRepositoryImage(imageName *string, props *RepositoryImageProps) RepositoryImage
- func RepositoryImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
- func TagParameterContainerImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
- type RepositoryImageProps
- type RequestCountScalingProps
- type RuntimePlatform
- type S3EnvironmentFile
- func AssetEnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
- func EnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
- func NewS3EnvironmentFile(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
- func S3EnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
- type ScalableTaskCount
- type ScalableTaskCountProps
- type Scope
- type ScratchSpace
- type Secret
- type SecretVersionInfo
- type ServiceConnect
- type ServiceConnectProps
- type ServiceConnectService
- type ServiceManagedEBSVolumeConfiguration
- type ServiceManagedVolume
- type ServiceManagedVolumeProps
- type SplunkLogDriver
- type SplunkLogDriverProps
- type SplunkLogFormat
- type SyslogLogDriver
- type SyslogLogDriverProps
- type SystemControl
- type TagParameterContainerImage
- type TaskDefinition
- type TaskDefinitionAttributes
- type TaskDefinitionProps
- type TaskDefinitionRevision
- type Tmpfs
- type TmpfsMountOption
- type TrackCustomMetricProps
- type Ulimit
- type UlimitName
- type Volume
- type VolumeFrom
- type WindowsOptimizedVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppProtocol_SetGrpc ¶ added in v2.52.0
func AppProtocol_SetGrpc(val AppProtocol)
func AppProtocol_SetHttp ¶ added in v2.52.0
func AppProtocol_SetHttp(val AppProtocol)
func AppProtocol_SetHttp2 ¶ added in v2.52.0
func AppProtocol_SetHttp2(val AppProtocol)
func AsgCapacityProvider_IsConstruct ¶
func AsgCapacityProvider_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func BaseService_IsConstruct ¶
func BaseService_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func BaseService_IsOwnedResource ¶ added in v2.32.0
func BaseService_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func BaseService_IsResource ¶
func BaseService_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func BottleRocketImage_IsBottleRocketImage ¶ added in v2.72.0
func BottleRocketImage_IsBottleRocketImage(x interface{}) *bool
Return whether the given object is a BottleRocketImage.
func BuiltInAttributes_AMI_ID ¶
func BuiltInAttributes_AMI_ID() *string
func BuiltInAttributes_AVAILABILITY_ZONE ¶
func BuiltInAttributes_AVAILABILITY_ZONE() *string
func BuiltInAttributes_INSTANCE_ID ¶
func BuiltInAttributes_INSTANCE_ID() *string
func BuiltInAttributes_INSTANCE_TYPE ¶
func BuiltInAttributes_INSTANCE_TYPE() *string
func BuiltInAttributes_OS_TYPE ¶
func BuiltInAttributes_OS_TYPE() *string
func CfnCapacityProvider_CFN_RESOURCE_TYPE_NAME ¶
func CfnCapacityProvider_CFN_RESOURCE_TYPE_NAME() *string
func CfnCapacityProvider_IsCfnElement ¶
func CfnCapacityProvider_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnCapacityProvider_IsCfnResource ¶
func CfnCapacityProvider_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnCapacityProvider_IsConstruct ¶
func CfnCapacityProvider_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnClusterCapacityProviderAssociations_CFN_RESOURCE_TYPE_NAME ¶
func CfnClusterCapacityProviderAssociations_CFN_RESOURCE_TYPE_NAME() *string
func CfnClusterCapacityProviderAssociations_IsCfnElement ¶
func CfnClusterCapacityProviderAssociations_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnClusterCapacityProviderAssociations_IsCfnResource ¶
func CfnClusterCapacityProviderAssociations_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnClusterCapacityProviderAssociations_IsConstruct ¶
func CfnClusterCapacityProviderAssociations_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnCluster_CFN_RESOURCE_TYPE_NAME ¶
func CfnCluster_CFN_RESOURCE_TYPE_NAME() *string
func CfnCluster_IsCfnElement ¶
func CfnCluster_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnCluster_IsCfnResource ¶
func CfnCluster_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnCluster_IsConstruct ¶
func CfnCluster_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnPrimaryTaskSet_CFN_RESOURCE_TYPE_NAME ¶
func CfnPrimaryTaskSet_CFN_RESOURCE_TYPE_NAME() *string
func CfnPrimaryTaskSet_IsCfnElement ¶
func CfnPrimaryTaskSet_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnPrimaryTaskSet_IsCfnResource ¶
func CfnPrimaryTaskSet_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnPrimaryTaskSet_IsConstruct ¶
func CfnPrimaryTaskSet_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnService_CFN_RESOURCE_TYPE_NAME ¶
func CfnService_CFN_RESOURCE_TYPE_NAME() *string
func CfnService_IsCfnElement ¶
func CfnService_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnService_IsCfnResource ¶
func CfnService_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnService_IsConstruct ¶
func CfnService_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnTaskDefinition_CFN_RESOURCE_TYPE_NAME ¶
func CfnTaskDefinition_CFN_RESOURCE_TYPE_NAME() *string
func CfnTaskDefinition_IsCfnElement ¶
func CfnTaskDefinition_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnTaskDefinition_IsCfnResource ¶
func CfnTaskDefinition_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnTaskDefinition_IsConstruct ¶
func CfnTaskDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnTaskSet_CFN_RESOURCE_TYPE_NAME ¶
func CfnTaskSet_CFN_RESOURCE_TYPE_NAME() *string
func CfnTaskSet_IsCfnElement ¶
func CfnTaskSet_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnTaskSet_IsCfnResource ¶
func CfnTaskSet_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnTaskSet_IsConstruct ¶
func CfnTaskSet_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Cluster_IsCluster ¶ added in v2.68.0
func Cluster_IsCluster(x interface{}) *bool
Return whether the given object is a Cluster.
func Cluster_IsConstruct ¶
func Cluster_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Cluster_IsOwnedResource ¶ added in v2.32.0
func Cluster_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Cluster_IsResource ¶
func Cluster_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func ContainerDefinition_CONTAINER_PORT_USE_RANGE ¶ added in v2.93.0
func ContainerDefinition_CONTAINER_PORT_USE_RANGE() *float64
func ContainerDefinition_IsConstruct ¶
func ContainerDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Ec2Service_IsConstruct ¶
func Ec2Service_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Ec2Service_IsOwnedResource ¶ added in v2.32.0
func Ec2Service_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Ec2Service_IsResource ¶
func Ec2Service_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func Ec2TaskDefinition_IsConstruct ¶
func Ec2TaskDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Ec2TaskDefinition_IsOwnedResource ¶ added in v2.32.0
func Ec2TaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Ec2TaskDefinition_IsResource ¶
func Ec2TaskDefinition_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func ExternalService_IsConstruct ¶
func ExternalService_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func ExternalService_IsOwnedResource ¶ added in v2.32.0
func ExternalService_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func ExternalService_IsResource ¶
func ExternalService_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func ExternalTaskDefinition_IsConstruct ¶
func ExternalTaskDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func ExternalTaskDefinition_IsOwnedResource ¶ added in v2.32.0
func ExternalTaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func ExternalTaskDefinition_IsResource ¶
func ExternalTaskDefinition_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func FargateService_IsConstruct ¶
func FargateService_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func FargateService_IsOwnedResource ¶ added in v2.32.0
func FargateService_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func FargateService_IsResource ¶
func FargateService_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func FargateTaskDefinition_IsConstruct ¶
func FargateTaskDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func FargateTaskDefinition_IsOwnedResource ¶ added in v2.32.0
func FargateTaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func FargateTaskDefinition_IsResource ¶
func FargateTaskDefinition_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func FirelensLogRouter_CONTAINER_PORT_USE_RANGE ¶ added in v2.93.0
func FirelensLogRouter_CONTAINER_PORT_USE_RANGE() *float64
func FirelensLogRouter_IsConstruct ¶
func FirelensLogRouter_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func LinuxParameters_IsConstruct ¶
func LinuxParameters_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func NewAppMeshProxyConfiguration_Override ¶
func NewAppMeshProxyConfiguration_Override(a AppMeshProxyConfiguration, props *AppMeshProxyConfigurationConfigProps)
Constructs a new instance of the AppMeshProxyConfiguration class.
func NewAppProtocol_Override ¶ added in v2.52.0
func NewAppProtocol_Override(a AppProtocol, value *string)
func NewAsgCapacityProvider_Override ¶
func NewAsgCapacityProvider_Override(a AsgCapacityProvider, scope constructs.Construct, id *string, props *AsgCapacityProviderProps)
func NewAssetEnvironmentFile_Override ¶
func NewAssetEnvironmentFile_Override(a AssetEnvironmentFile, path *string, options *awss3assets.AssetOptions)
func NewAssetImage_Override ¶
func NewAssetImage_Override(a AssetImage, directory *string, props *AssetImageProps)
Constructs a new instance of the AssetImage class.
func NewAwsLogDriver_Override ¶
func NewAwsLogDriver_Override(a AwsLogDriver, props *AwsLogDriverProps)
Constructs a new instance of the AwsLogDriver class.
func NewBaseService_Override ¶
func NewBaseService_Override(b BaseService, scope constructs.Construct, id *string, props *BaseServiceProps, additionalProps interface{}, taskDefinition TaskDefinition)
Constructs a new instance of the BaseService class.
func NewBottleRocketImage_Override ¶
func NewBottleRocketImage_Override(b BottleRocketImage, props *BottleRocketImageProps)
Constructs a new instance of the BottleRocketImage class.
func NewBuiltInAttributes_Override ¶
func NewBuiltInAttributes_Override(b BuiltInAttributes)
func NewCfnCapacityProvider_Override ¶
func NewCfnCapacityProvider_Override(c CfnCapacityProvider, scope constructs.Construct, id *string, props *CfnCapacityProviderProps)
func NewCfnClusterCapacityProviderAssociations_Override ¶
func NewCfnClusterCapacityProviderAssociations_Override(c CfnClusterCapacityProviderAssociations, scope constructs.Construct, id *string, props *CfnClusterCapacityProviderAssociationsProps)
func NewCfnCluster_Override ¶
func NewCfnCluster_Override(c CfnCluster, scope constructs.Construct, id *string, props *CfnClusterProps)
func NewCfnPrimaryTaskSet_Override ¶
func NewCfnPrimaryTaskSet_Override(c CfnPrimaryTaskSet, scope constructs.Construct, id *string, props *CfnPrimaryTaskSetProps)
func NewCfnService_Override ¶
func NewCfnService_Override(c CfnService, scope constructs.Construct, id *string, props *CfnServiceProps)
func NewCfnTaskDefinition_Override ¶
func NewCfnTaskDefinition_Override(c CfnTaskDefinition, scope constructs.Construct, id *string, props *CfnTaskDefinitionProps)
func NewCfnTaskSet_Override ¶
func NewCfnTaskSet_Override(c CfnTaskSet, scope constructs.Construct, id *string, props *CfnTaskSetProps)
func NewCluster_Override ¶
func NewCluster_Override(c Cluster, scope constructs.Construct, id *string, props *ClusterProps)
Constructs a new instance of the Cluster class.
func NewContainerDefinition_Override ¶
func NewContainerDefinition_Override(c ContainerDefinition, scope constructs.Construct, id *string, props *ContainerDefinitionProps)
Constructs a new instance of the ContainerDefinition class.
func NewContainerImage_Override ¶
func NewContainerImage_Override(c ContainerImage)
func NewEc2Service_Override ¶
func NewEc2Service_Override(e Ec2Service, scope constructs.Construct, id *string, props *Ec2ServiceProps)
Constructs a new instance of the Ec2Service class.
func NewEc2TaskDefinition_Override ¶
func NewEc2TaskDefinition_Override(e Ec2TaskDefinition, scope constructs.Construct, id *string, props *Ec2TaskDefinitionProps)
Constructs a new instance of the Ec2TaskDefinition class.
func NewEcrImage_Override ¶
func NewEcrImage_Override(e EcrImage, repository awsecr.IRepository, tagOrDigest *string)
Constructs a new instance of the EcrImage class.
func NewEnvironmentFile_Override ¶
func NewEnvironmentFile_Override(e EnvironmentFile)
func NewExternalService_Override ¶
func NewExternalService_Override(e ExternalService, scope constructs.Construct, id *string, props *ExternalServiceProps)
Constructs a new instance of the ExternalService class.
func NewExternalTaskDefinition_Override ¶
func NewExternalTaskDefinition_Override(e ExternalTaskDefinition, scope constructs.Construct, id *string, props *ExternalTaskDefinitionProps)
Constructs a new instance of the ExternalTaskDefinition class.
func NewFargateService_Override ¶
func NewFargateService_Override(f FargateService, scope constructs.Construct, id *string, props *FargateServiceProps)
Constructs a new instance of the FargateService class.
func NewFargateTaskDefinition_Override ¶
func NewFargateTaskDefinition_Override(f FargateTaskDefinition, scope constructs.Construct, id *string, props *FargateTaskDefinitionProps)
Constructs a new instance of the FargateTaskDefinition class.
func NewFireLensLogDriver_Override ¶
func NewFireLensLogDriver_Override(f FireLensLogDriver, props *FireLensLogDriverProps)
Constructs a new instance of the FireLensLogDriver class.
func NewFirelensLogRouter_Override ¶
func NewFirelensLogRouter_Override(f FirelensLogRouter, scope constructs.Construct, id *string, props *FirelensLogRouterProps)
Constructs a new instance of the FirelensLogRouter class.
func NewFluentdLogDriver_Override ¶
func NewFluentdLogDriver_Override(f FluentdLogDriver, props *FluentdLogDriverProps)
Constructs a new instance of the FluentdLogDriver class.
func NewGelfLogDriver_Override ¶
func NewGelfLogDriver_Override(g GelfLogDriver, props *GelfLogDriverProps)
Constructs a new instance of the GelfLogDriver class.
func NewGenericLogDriver_Override ¶
func NewGenericLogDriver_Override(g GenericLogDriver, props *GenericLogDriverProps)
Constructs a new instance of the GenericLogDriver class.
func NewJournaldLogDriver_Override ¶
func NewJournaldLogDriver_Override(j JournaldLogDriver, props *JournaldLogDriverProps)
Constructs a new instance of the JournaldLogDriver class.
func NewJsonFileLogDriver_Override ¶
func NewJsonFileLogDriver_Override(j JsonFileLogDriver, props *JsonFileLogDriverProps)
Constructs a new instance of the JsonFileLogDriver class.
func NewLinuxParameters_Override ¶
func NewLinuxParameters_Override(l LinuxParameters, scope constructs.Construct, id *string, props *LinuxParametersProps)
Constructs a new instance of the LinuxParameters class.
func NewListenerConfig_Override ¶
func NewListenerConfig_Override(l ListenerConfig)
func NewLogDriver_Override ¶
func NewLogDriver_Override(l LogDriver)
func NewLogDrivers_Override ¶
func NewLogDrivers_Override(l LogDrivers)
func NewPortMap_Override ¶ added in v2.67.0
func NewPortMap_Override(p PortMap, networkmode NetworkMode, pm *PortMapping)
func NewProxyConfiguration_Override ¶
func NewProxyConfiguration_Override(p ProxyConfiguration)
func NewProxyConfigurations_Override ¶
func NewProxyConfigurations_Override(p ProxyConfigurations)
func NewRepositoryImage_Override ¶
func NewRepositoryImage_Override(r RepositoryImage, imageName *string, props *RepositoryImageProps)
Constructs a new instance of the RepositoryImage class.
func NewS3EnvironmentFile_Override ¶
func NewS3EnvironmentFile_Override(s S3EnvironmentFile, bucket awss3.IBucket, key *string, objectVersion *string)
func NewScalableTaskCount_Override ¶
func NewScalableTaskCount_Override(s ScalableTaskCount, scope constructs.Construct, id *string, props *ScalableTaskCountProps)
Constructs a new instance of the ScalableTaskCount class.
func NewSecret_Override ¶
func NewSecret_Override(s Secret)
func NewServiceConnect_Override ¶ added in v2.67.0
func NewServiceConnect_Override(s ServiceConnect, networkmode NetworkMode, pm *PortMapping)
func NewServiceManagedVolume_Override ¶ added in v2.122.0
func NewServiceManagedVolume_Override(s ServiceManagedVolume, scope constructs.Construct, id *string, props *ServiceManagedVolumeProps)
func NewSplunkLogDriver_Override ¶
func NewSplunkLogDriver_Override(s SplunkLogDriver, props *SplunkLogDriverProps)
Constructs a new instance of the SplunkLogDriver class.
func NewSyslogLogDriver_Override ¶
func NewSyslogLogDriver_Override(s SyslogLogDriver, props *SyslogLogDriverProps)
Constructs a new instance of the SyslogLogDriver class.
func NewTagParameterContainerImage_Override ¶
func NewTagParameterContainerImage_Override(t TagParameterContainerImage, repository awsecr.IRepository)
func NewTaskDefinition_Override ¶
func NewTaskDefinition_Override(t TaskDefinition, scope constructs.Construct, id *string, props *TaskDefinitionProps)
Constructs a new instance of the TaskDefinition class.
func ScalableTaskCount_IsConstruct ¶
func ScalableTaskCount_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func ServiceManagedVolume_IsConstruct ¶ added in v2.122.0
func ServiceManagedVolume_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func TaskDefinition_IsConstruct ¶
func TaskDefinition_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func TaskDefinition_IsOwnedResource ¶ added in v2.32.0
func TaskDefinition_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func TaskDefinition_IsResource ¶
func TaskDefinition_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
Types ¶
type AddAutoScalingGroupCapacityOptions ¶
type AddAutoScalingGroupCapacityOptions struct { // Specifies whether the containers can access the container instance role. // Default: false. // CanContainersAccessInstanceRole *bool `field:"optional" json:"canContainersAccessInstanceRole" yaml:"canContainersAccessInstanceRole"` // What type of machine image this is. // // Depending on the setting, different UserData will automatically be added // to the `AutoScalingGroup` to configure it properly for use with ECS. // // If you create an `AutoScalingGroup` yourself and are adding it via // `addAutoScalingGroup()`, you must specify this value. If you are adding an // `autoScalingGroup` via `addCapacity`, this value will be determined // from the `machineImage` you pass. // Default: - Automatically determined from `machineImage`, if available, otherwise `MachineImageType.AMAZON_LINUX_2`. // MachineImageType MachineImageType `field:"optional" json:"machineImageType" yaml:"machineImageType"` // Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. // // For more information, see [Using Spot Instances](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html). // Default: false. // SpotInstanceDraining *bool `field:"optional" json:"spotInstanceDraining" yaml:"spotInstanceDraining"` // If `AddAutoScalingGroupCapacityOptions.taskDrainTime` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information. // Default: The SNS Topic will not be encrypted. // TopicEncryptionKey awskms.IKey `field:"optional" json:"topicEncryptionKey" yaml:"topicEncryptionKey"` }
The properties for adding an AutoScalingGroup.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var key key addAutoScalingGroupCapacityOptions := &AddAutoScalingGroupCapacityOptions{ CanContainersAccessInstanceRole: jsii.Boolean(false), MachineImageType: awscdk.Aws_ecs.MachineImageType_AMAZON_LINUX_2, SpotInstanceDraining: jsii.Boolean(false), TopicEncryptionKey: key, }
type AddCapacityOptions ¶
type AddCapacityOptions struct { // Specifies whether the containers can access the container instance role. // Default: false. // CanContainersAccessInstanceRole *bool `field:"optional" json:"canContainersAccessInstanceRole" yaml:"canContainersAccessInstanceRole"` // What type of machine image this is. // // Depending on the setting, different UserData will automatically be added // to the `AutoScalingGroup` to configure it properly for use with ECS. // // If you create an `AutoScalingGroup` yourself and are adding it via // `addAutoScalingGroup()`, you must specify this value. If you are adding an // `autoScalingGroup` via `addCapacity`, this value will be determined // from the `machineImage` you pass. // Default: - Automatically determined from `machineImage`, if available, otherwise `MachineImageType.AMAZON_LINUX_2`. // MachineImageType MachineImageType `field:"optional" json:"machineImageType" yaml:"machineImageType"` // Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. // // For more information, see [Using Spot Instances](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html). // Default: false. // SpotInstanceDraining *bool `field:"optional" json:"spotInstanceDraining" yaml:"spotInstanceDraining"` // If `AddAutoScalingGroupCapacityOptions.taskDrainTime` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information. // Default: The SNS Topic will not be encrypted. // TopicEncryptionKey awskms.IKey `field:"optional" json:"topicEncryptionKey" yaml:"topicEncryptionKey"` // Whether the instances can initiate connections to anywhere by default. // Default: true. // AllowAllOutbound *bool `field:"optional" json:"allowAllOutbound" yaml:"allowAllOutbound"` // Whether instances in the Auto Scaling Group should have public IP addresses associated with them. // // `launchTemplate` and `mixedInstancesPolicy` must not be specified when this property is specified. // Default: - Use subnet setting. // AssociatePublicIpAddress *bool `field:"optional" json:"associatePublicIpAddress" yaml:"associatePublicIpAddress"` // The name of the Auto Scaling group. // // This name must be unique per Region per account. // Default: - Auto generated by CloudFormation. // AutoScalingGroupName *string `field:"optional" json:"autoScalingGroupName" yaml:"autoScalingGroupName"` // Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes. // // Each instance that is launched has an associated root device volume, // either an Amazon EBS volume or an instance store volume. // You can use block device mappings to specify additional EBS volumes or // instance store volumes to attach to an instance when it is launched. // // `launchTemplate` and `mixedInstancesPolicy` must not be specified when this property is specified. // See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html // // Default: - Uses the block device mapping of the AMI. // BlockDevices *[]*awsautoscaling.BlockDevice `field:"optional" json:"blockDevices" yaml:"blockDevices"` // Indicates whether Capacity Rebalancing is enabled. // // When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling // attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of // interruption. After launching a new instance, it then terminates an old instance. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-capacityrebalance // // Default: false. // CapacityRebalance *bool `field:"optional" json:"capacityRebalance" yaml:"capacityRebalance"` // Default scaling cooldown for this AutoScalingGroup. // Default: Duration.minutes(5) // Cooldown awscdk.Duration `field:"optional" json:"cooldown" yaml:"cooldown"` // The amount of time, in seconds, until a newly launched instance can contribute to the Amazon CloudWatch metrics. // // This delay lets an instance finish initializing before Amazon EC2 Auto Scaling aggregates instance metrics, // resulting in more reliable usage data. Set this value equal to the amount of time that it takes for resource // consumption to become stable after an instance reaches the InService state. // // To optimize the performance of scaling policies that scale continuously, such as target tracking and // step scaling policies, we strongly recommend that you enable the default instance warmup, even if its value is set to 0 seconds // // Default instance warmup will not be added if no value is specified. // See: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html // // Default: None. // DefaultInstanceWarmup awscdk.Duration `field:"optional" json:"defaultInstanceWarmup" yaml:"defaultInstanceWarmup"` // Initial amount of instances in the fleet. // // If this is set to a number, every deployment will reset the amount of // instances to this number. It is recommended to leave this value blank. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-desiredcapacity // // Default: minCapacity, and leave unchanged during deployment. // DesiredCapacity *float64 `field:"optional" json:"desiredCapacity" yaml:"desiredCapacity"` // Enable monitoring for group metrics, these metrics describe the group rather than any of its instances. // // To report all group metrics use `GroupMetrics.all()` // Group metrics are reported in a granularity of 1 minute at no additional charge. // Default: - no group metrics will be reported. // GroupMetrics *[]awsautoscaling.GroupMetrics `field:"optional" json:"groupMetrics" yaml:"groupMetrics"` // Configuration for health checks. // Default: - HealthCheck.ec2 with no grace period // HealthCheck awsautoscaling.HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // If the ASG has scheduled actions, don't reset unchanged group sizes. // // Only used if the ASG has scheduled actions (which may scale your ASG up // or down regardless of cdk deployments). If true, the size of the group // will only be reset if it has been changed in the CDK app. If false, the // sizes will always be changed back to what they were in the CDK app // on deployment. // Default: true. // IgnoreUnmodifiedSizeProperties *bool `field:"optional" json:"ignoreUnmodifiedSizeProperties" yaml:"ignoreUnmodifiedSizeProperties"` // Controls whether instances in this group are launched with detailed or basic monitoring. // // When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account // is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. // // `launchTemplate` and `mixedInstancesPolicy` must not be specified when this property is specified. // See: https://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-monitoring.html#enable-as-instance-metrics // // Default: - Monitoring.DETAILED // InstanceMonitoring awsautoscaling.Monitoring `field:"optional" json:"instanceMonitoring" yaml:"instanceMonitoring"` // Name of SSH keypair to grant access to instances. // // `launchTemplate` and `mixedInstancesPolicy` must not be specified when this property is specified. // Default: - No SSH access will be possible. // KeyName *string `field:"optional" json:"keyName" yaml:"keyName"` // Maximum number of instances in the fleet. // Default: desiredCapacity. // MaxCapacity *float64 `field:"optional" json:"maxCapacity" yaml:"maxCapacity"` // The maximum amount of time that an instance can be in service. // // The maximum duration applies // to all current and future instances in the group. As an instance approaches its maximum duration, // it is terminated and replaced, and cannot be used again. // // You must specify a value of at least 604,800 seconds (7 days). To clear a previously set value, // leave this property undefined. // See: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html // // Default: none. // MaxInstanceLifetime awscdk.Duration `field:"optional" json:"maxInstanceLifetime" yaml:"maxInstanceLifetime"` // Minimum number of instances in the fleet. // Default: 1. // MinCapacity *float64 `field:"optional" json:"minCapacity" yaml:"minCapacity"` // Whether newly-launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. // // By default, Auto Scaling can terminate an instance at any time after launch // when scaling in an Auto Scaling Group, subject to the group's termination // policy. However, you may wish to protect newly-launched instances from // being scaled in if they are going to run critical applications that should // not be prematurely terminated. // // This flag must be enabled if the Auto Scaling Group will be associated with // an ECS Capacity Provider with managed termination protection. // Default: false. // NewInstancesProtectedFromScaleIn *bool `field:"optional" json:"newInstancesProtectedFromScaleIn" yaml:"newInstancesProtectedFromScaleIn"` // Configure autoscaling group to send notifications about fleet changes to an SNS topic(s). // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-notificationconfigurations // // Default: - No fleet change notifications will be sent. // Notifications *[]*awsautoscaling.NotificationConfiguration `field:"optional" json:"notifications" yaml:"notifications"` // Configure waiting for signals during deployment. // // Use this to pause the CloudFormation deployment to wait for the instances // in the AutoScalingGroup to report successful startup during // creation and updates. The UserData script needs to invoke `cfn-signal` // with a success or failure code after it is done setting up the instance. // // Without waiting for signals, the CloudFormation deployment will proceed as // soon as the AutoScalingGroup has been created or updated but before the // instances in the group have been started. // // For example, to have instances wait for an Elastic Load Balancing health check before // they signal success, add a health-check verification by using the // cfn-init helper script. For an example, see the verify_instance_health // command in the Auto Scaling rolling updates sample template: // // https://github.com/awslabs/aws-cloudformation-templates/blob/master/aws/services/AutoScaling/AutoScalingRollingUpdates.yaml // Default: - Do not wait for signals. // Signals awsautoscaling.Signals `field:"optional" json:"signals" yaml:"signals"` // The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request. // // Spot Instances are // launched when the price you specify exceeds the current Spot market price. // // `launchTemplate` and `mixedInstancesPolicy` must not be specified when this property is specified. // Default: none. // SpotPrice *string `field:"optional" json:"spotPrice" yaml:"spotPrice"` // Add SSM session permissions to the instance role. // // Setting this to `true` adds the necessary permissions to connect // to the instance using SSM Session Manager. You can do this // from the AWS Console. // // NOTE: Setting this flag to `true` may not be enough by itself. // You must also use an AMI that comes with the SSM Agent, or install // the SSM Agent yourself. See // [Working with SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html) // in the SSM Developer Guide. // Default: false. // SsmSessionPermissions *bool `field:"optional" json:"ssmSessionPermissions" yaml:"ssmSessionPermissions"` // A policy or a list of policies that are used to select the instances to terminate. // // The policies are executed in the order that you list them. // See: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html // // Default: - `TerminationPolicy.DEFAULT` // TerminationPolicies *[]awsautoscaling.TerminationPolicy `field:"optional" json:"terminationPolicies" yaml:"terminationPolicies"` // What to do when an AutoScalingGroup's instance configuration is changed. // // This is applied when any of the settings on the ASG are changed that // affect how the instances should be created (VPC, instance type, startup // scripts, etc.). It indicates how the existing instances should be // replaced with new instances matching the new config. By default, nothing // is done and only new instances are launched with the new config. // Default: - `UpdatePolicy.rollingUpdate()` if using `init`, `UpdatePolicy.none()` otherwise // UpdatePolicy awsautoscaling.UpdatePolicy `field:"optional" json:"updatePolicy" yaml:"updatePolicy"` // Where to place instances within the VPC. // Default: - All Private subnets. // VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` // The EC2 instance type to use when launching instances into the AutoScalingGroup. InstanceType awsec2.InstanceType `field:"required" json:"instanceType" yaml:"instanceType"` // The ECS-optimized AMI variant to use. // // The default is to use an ECS-optimized AMI of Amazon Linux 2 which is // automatically updated to the latest version on every deployment. This will // replace the instances in the AutoScalingGroup. Make sure you have not disabled // task draining, to avoid downtime when the AMI updates. // // To use an image that does not update on every deployment, pass: // // “`ts // const machineImage = ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.STANDARD, { // cachedInContext: true, // }); // “` // // For more information, see [Amazon ECS-optimized // AMIs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html). // // You must define either `machineImage` or `machineImageType`, not both. // Default: - Automatically updated, ECS-optimized Amazon Linux 2. // MachineImage awsec2.IMachineImage `field:"optional" json:"machineImage" yaml:"machineImage"` }
The properties for adding instance capacity to an AutoScalingGroup.
Example:
var cluster cluster cluster.AddCapacity(jsii.String("graviton-cluster"), &AddCapacityOptions{ MinCapacity: jsii.Number(2), InstanceType: ec2.NewInstanceType(jsii.String("c6g.large")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux2(ecs.AmiHardwareType_ARM), })
type AlarmBehavior ¶ added in v2.87.0
type AlarmBehavior string
Deployment behavior when an ECS Service Deployment Alarm is triggered.
Example:
import cw "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var taskDefinition taskDefinition var elbAlarm alarm service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DeploymentAlarms: &DeploymentAlarmConfig{ AlarmNames: []*string{ elbAlarm.AlarmName, }, Behavior: ecs.AlarmBehavior_ROLLBACK_ON_ALARM, }, }) // Defining a deployment alarm after the service has been created cpuAlarmName := "MyCpuMetricAlarm" cw.NewAlarm(this, jsii.String("CPUAlarm"), &AlarmProps{ AlarmName: cpuAlarmName, Metric: service.MetricCpuUtilization(), EvaluationPeriods: jsii.Number(2), Threshold: jsii.Number(80), }) service.EnableDeploymentAlarms([]*string{ cpuAlarmName, }, &DeploymentAlarmOptions{ Behavior: ecs.AlarmBehavior_FAIL_ON_ALARM, })
const ( // ROLLBACK_ON_ALARM causes the service to roll back to the previous deployment when any deployment alarm enters the 'Alarm' state. // // The Cloudformation stack // will be rolled back and enter state "UPDATE_ROLLBACK_COMPLETE". AlarmBehavior_ROLLBACK_ON_ALARM AlarmBehavior = "ROLLBACK_ON_ALARM" // FAIL_ON_ALARM causes the deployment to fail immediately when any deployment alarm enters the 'Alarm' state. // // In order to restore functionality, you must // roll the stack forward by pushing a new version of the ECS service. AlarmBehavior_FAIL_ON_ALARM AlarmBehavior = "FAIL_ON_ALARM" )
type AmiHardwareType ¶
type AmiHardwareType string
The ECS-optimized AMI variant to use.
For more information, see [Amazon ECS-optimized AMIs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html).
Example:
var cluster cluster cluster.AddCapacity(jsii.String("graviton-cluster"), &AddCapacityOptions{ MinCapacity: jsii.Number(2), InstanceType: ec2.NewInstanceType(jsii.String("c6g.large")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux2(ecs.AmiHardwareType_ARM), })
const ( // Use the standard Amazon ECS-optimized AMI. AmiHardwareType_STANDARD AmiHardwareType = "STANDARD" // Use the Amazon ECS GPU-optimized AMI. AmiHardwareType_GPU AmiHardwareType = "GPU" // Use the Amazon ECS-optimized Amazon Linux 2 (arm64) AMI. AmiHardwareType_ARM AmiHardwareType = "ARM" // Use the Amazon ECS-optimized Amazon Linux 2 (Neuron) AMI. AmiHardwareType_NEURON AmiHardwareType = "NEURON" )
type AppMeshProxyConfiguration ¶
type AppMeshProxyConfiguration interface { ProxyConfiguration // Called when the proxy configuration is configured on a task definition. Bind(_scope constructs.Construct, _taskDefinition TaskDefinition) *CfnTaskDefinition_ProxyConfigurationProperty }
The class for App Mesh proxy configurations.
For tasks using the EC2 launch type, the container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see [Amazon ECS-optimized AMIs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html).
For tasks using the Fargate launch type, the task or service requires platform version 1.3.0 or later.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" appMeshProxyConfiguration := awscdk.Aws_ecs.NewAppMeshProxyConfiguration(&AppMeshProxyConfigurationConfigProps{ ContainerName: jsii.String("containerName"), Properties: &AppMeshProxyConfigurationProps{ AppPorts: []*f64{ jsii.Number(123), }, ProxyEgressPort: jsii.Number(123), ProxyIngressPort: jsii.Number(123), // the properties below are optional EgressIgnoredIPs: []*string{ jsii.String("egressIgnoredIPs"), }, EgressIgnoredPorts: []*f64{ jsii.Number(123), }, IgnoredGID: jsii.Number(123), IgnoredUID: jsii.Number(123), }, })
func NewAppMeshProxyConfiguration ¶
func NewAppMeshProxyConfiguration(props *AppMeshProxyConfigurationConfigProps) AppMeshProxyConfiguration
Constructs a new instance of the AppMeshProxyConfiguration class.
type AppMeshProxyConfigurationConfigProps ¶
type AppMeshProxyConfigurationConfigProps struct { // The name of the container that will serve as the App Mesh proxy. ContainerName *string `field:"required" json:"containerName" yaml:"containerName"` // The set of network configuration parameters to provide the Container Network Interface (CNI) plugin. Properties *AppMeshProxyConfigurationProps `field:"required" json:"properties" yaml:"properties"` }
The configuration to use when setting an App Mesh proxy configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" appMeshProxyConfigurationConfigProps := &AppMeshProxyConfigurationConfigProps{ ContainerName: jsii.String("containerName"), Properties: &AppMeshProxyConfigurationProps{ AppPorts: []*f64{ jsii.Number(123), }, ProxyEgressPort: jsii.Number(123), ProxyIngressPort: jsii.Number(123), // the properties below are optional EgressIgnoredIPs: []*string{ jsii.String("egressIgnoredIPs"), }, EgressIgnoredPorts: []*f64{ jsii.Number(123), }, IgnoredGID: jsii.Number(123), IgnoredUID: jsii.Number(123), }, }
type AppMeshProxyConfigurationProps ¶
type AppMeshProxyConfigurationProps struct { // The list of ports that the application uses. // // Network traffic to these ports is forwarded to the ProxyIngressPort and ProxyEgressPort. AppPorts *[]*float64 `field:"required" json:"appPorts" yaml:"appPorts"` // Specifies the port that outgoing traffic from the AppPorts is directed to. ProxyEgressPort *float64 `field:"required" json:"proxyEgressPort" yaml:"proxyEgressPort"` // Specifies the port that incoming traffic to the AppPorts is directed to. ProxyIngressPort *float64 `field:"required" json:"proxyIngressPort" yaml:"proxyIngressPort"` // The egress traffic going to these specified IP addresses is ignored and not redirected to the ProxyEgressPort. // // It can be an empty list. EgressIgnoredIPs *[]*string `field:"optional" json:"egressIgnoredIPs" yaml:"egressIgnoredIPs"` // The egress traffic going to these specified ports is ignored and not redirected to the ProxyEgressPort. // // It can be an empty list. EgressIgnoredPorts *[]*float64 `field:"optional" json:"egressIgnoredPorts" yaml:"egressIgnoredPorts"` // The group ID (GID) of the proxy container as defined by the user parameter in a container definition. // // This is used to ensure the proxy ignores its own traffic. If IgnoredUID is specified, this field can be empty. IgnoredGID *float64 `field:"optional" json:"ignoredGID" yaml:"ignoredGID"` // The user ID (UID) of the proxy container as defined by the user parameter in a container definition. // // This is used to ensure the proxy ignores its own traffic. If IgnoredGID is specified, this field can be empty. IgnoredUID *float64 `field:"optional" json:"ignoredUID" yaml:"ignoredUID"` }
Interface for setting the properties of proxy configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" appMeshProxyConfigurationProps := &AppMeshProxyConfigurationProps{ AppPorts: []*f64{ jsii.Number(123), }, ProxyEgressPort: jsii.Number(123), ProxyIngressPort: jsii.Number(123), // the properties below are optional EgressIgnoredIPs: []*string{ jsii.String("egressIgnoredIPs"), }, EgressIgnoredPorts: []*f64{ jsii.Number(123), }, IgnoredGID: jsii.Number(123), IgnoredUID: jsii.Number(123), }
type AppProtocol ¶ added in v2.52.0
type AppProtocol interface { // Custom value. Value() *string }
Service connect app protocol.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" appProtocol := awscdk.Aws_ecs.AppProtocol_Grpc()
func AppProtocol_Grpc ¶ added in v2.52.0
func AppProtocol_Grpc() AppProtocol
func AppProtocol_Http ¶ added in v2.52.0
func AppProtocol_Http() AppProtocol
func AppProtocol_Http2 ¶ added in v2.52.0
func AppProtocol_Http2() AppProtocol
func NewAppProtocol ¶ added in v2.52.0
func NewAppProtocol(value *string) AppProtocol
type AsgCapacityProvider ¶
type AsgCapacityProvider interface { constructs.Construct // Auto Scaling Group. AutoScalingGroup() awsautoscaling.AutoScalingGroup // Specifies whether the containers can access the container instance role. // Default: false. // CanContainersAccessInstanceRole() *bool // Capacity provider name. // Default: Chosen by CloudFormation. // CapacityProviderName() *string // Whether managed draining is enabled. EnableManagedDraining() *bool // Whether managed termination protection is enabled. EnableManagedTerminationProtection() *bool // Auto Scaling Group machineImageType. MachineImageType() MachineImageType // The tree node. Node() constructs.Node // Returns a string representation of this construct. ToString() *string }
An Auto Scaling Group Capacity Provider.
This allows an ECS cluster to target a specific EC2 Auto Scaling Group for the placement of tasks. Optionally (and recommended), ECS can manage the number of instances in the ASG to fit the tasks, and can ensure that instances are not prematurely terminated while there are still tasks running on them.
Example:
var vpc vpc cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, }) // Either add default capacity cluster.AddCapacity(jsii.String("DefaultAutoScalingGroupCapacity"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.xlarge")), DesiredCapacity: jsii.Number(3), }) // Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI. autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ Vpc: Vpc, InstanceType: ec2.NewInstanceType(jsii.String("t2.xlarge")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux(), // Or use Amazon ECS-Optimized Amazon Linux 2 AMI // machineImage: EcsOptimizedImage.amazonLinux2(), DesiredCapacity: jsii.Number(3), }) capacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String("AsgCapacityProvider"), &AsgCapacityProviderProps{ AutoScalingGroup: AutoScalingGroup, }) cluster.AddAsgCapacityProvider(capacityProvider)
func NewAsgCapacityProvider ¶
func NewAsgCapacityProvider(scope constructs.Construct, id *string, props *AsgCapacityProviderProps) AsgCapacityProvider
type AsgCapacityProviderProps ¶
type AsgCapacityProviderProps struct { // Specifies whether the containers can access the container instance role. // Default: false. // CanContainersAccessInstanceRole *bool `field:"optional" json:"canContainersAccessInstanceRole" yaml:"canContainersAccessInstanceRole"` // What type of machine image this is. // // Depending on the setting, different UserData will automatically be added // to the `AutoScalingGroup` to configure it properly for use with ECS. // // If you create an `AutoScalingGroup` yourself and are adding it via // `addAutoScalingGroup()`, you must specify this value. If you are adding an // `autoScalingGroup` via `addCapacity`, this value will be determined // from the `machineImage` you pass. // Default: - Automatically determined from `machineImage`, if available, otherwise `MachineImageType.AMAZON_LINUX_2`. // MachineImageType MachineImageType `field:"optional" json:"machineImageType" yaml:"machineImageType"` // Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. // // For more information, see [Using Spot Instances](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html). // Default: false. // SpotInstanceDraining *bool `field:"optional" json:"spotInstanceDraining" yaml:"spotInstanceDraining"` // If `AddAutoScalingGroupCapacityOptions.taskDrainTime` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information. // Default: The SNS Topic will not be encrypted. // TopicEncryptionKey awskms.IKey `field:"optional" json:"topicEncryptionKey" yaml:"topicEncryptionKey"` // The autoscaling group to add as a Capacity Provider. AutoScalingGroup awsautoscaling.IAutoScalingGroup `field:"required" json:"autoScalingGroup" yaml:"autoScalingGroup"` // The name of the capacity provider. // // If a name is specified, // it cannot start with `aws`, `ecs`, or `fargate`. If no name is specified, // a default name in the CFNStackName-CFNResourceName-RandomString format is used. // Default: CloudFormation-generated name. // CapacityProviderName *string `field:"optional" json:"capacityProviderName" yaml:"capacityProviderName"` // Managed instance draining facilitates graceful termination of Amazon ECS instances. // // This allows your service workloads to stop safely and be rescheduled to non-terminating instances. // Infrastructure maintenance and updates are preformed without disruptions to workloads. // To use managed instance draining, set enableManagedDraining to true. // Default: true. // EnableManagedDraining *bool `field:"optional" json:"enableManagedDraining" yaml:"enableManagedDraining"` // When enabled the scale-in and scale-out actions of the cluster's Auto Scaling Group will be managed for you. // // This means your cluster will automatically scale instances based on the load your tasks put on the cluster. // For more information, see [Using Managed Scaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling) in the ECS Developer Guide. // Default: true. // EnableManagedScaling *bool `field:"optional" json:"enableManagedScaling" yaml:"enableManagedScaling"` // When enabled the Auto Scaling Group will only terminate EC2 instances that no longer have running non-daemon tasks. // // Scale-in protection will be automatically enabled on instances. When all non-daemon tasks are // stopped on an instance, ECS initiates the scale-in process and turns off scale-in protection for the // instance. The Auto Scaling Group can then terminate the instance. For more information see [Managed termination // protection](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-auto-scaling.html#managed-termination-protection) // in the ECS Developer Guide. // // Managed scaling must also be enabled. // Default: true. // EnableManagedTerminationProtection *bool `field:"optional" json:"enableManagedTerminationProtection" yaml:"enableManagedTerminationProtection"` // The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group. // // Must be between 0 and 10000. // Default: 300. // InstanceWarmupPeriod *float64 `field:"optional" json:"instanceWarmupPeriod" yaml:"instanceWarmupPeriod"` // Maximum scaling step size. // // In most cases this should be left alone. // Default: 1000. // MaximumScalingStepSize *float64 `field:"optional" json:"maximumScalingStepSize" yaml:"maximumScalingStepSize"` // Minimum scaling step size. // // In most cases this should be left alone. // Default: 1. // MinimumScalingStepSize *float64 `field:"optional" json:"minimumScalingStepSize" yaml:"minimumScalingStepSize"` // Target capacity percent. // // In most cases this should be left alone. // Default: 100. // TargetCapacityPercent *float64 `field:"optional" json:"targetCapacityPercent" yaml:"targetCapacityPercent"` }
The options for creating an Auto Scaling Group Capacity Provider.
Example:
var vpc vpc launchTemplate := ec2.NewLaunchTemplate(this, jsii.String("ASG-LaunchTemplate"), &LaunchTemplateProps{ InstanceType: ec2.NewInstanceType(jsii.String("t3.medium")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux2(), UserData: ec2.UserData_ForLinux(), }) autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ Vpc: Vpc, MixedInstancesPolicy: &MixedInstancesPolicy{ InstancesDistribution: &InstancesDistribution{ OnDemandPercentageAboveBaseCapacity: jsii.Number(50), }, LaunchTemplate: launchTemplate, }, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, }) capacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String("AsgCapacityProvider"), &AsgCapacityProviderProps{ AutoScalingGroup: AutoScalingGroup, MachineImageType: ecs.MachineImageType_AMAZON_LINUX_2, }) cluster.AddAsgCapacityProvider(capacityProvider)
type AssetEnvironmentFile ¶
type AssetEnvironmentFile interface { EnvironmentFile // The path to the asset file or directory. Path() *string // Called when the container is initialized to allow this object to bind to the stack. Bind(scope constructs.Construct) *EnvironmentFileConfig }
Environment file from a local directory.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var dockerImage dockerImage var grantable iGrantable var localBundling iLocalBundling assetEnvironmentFile := awscdk.Aws_ecs.NewAssetEnvironmentFile(jsii.String("path"), &AssetOptions{ AssetHash: jsii.String("assetHash"), AssetHashType: cdk.AssetHashType_SOURCE, Bundling: &BundlingOptions{ Image: dockerImage, // the properties below are optional BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY, Command: []*string{ jsii.String("command"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, Local: localBundling, Network: jsii.String("network"), OutputType: cdk.BundlingOutput_ARCHIVED, Platform: jsii.String("platform"), SecurityOpt: jsii.String("securityOpt"), User: jsii.String("user"), Volumes: []dockerVolume{ &dockerVolume{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), // the properties below are optional Consistency: cdk.DockerVolumeConsistency_CONSISTENT, }, }, VolumesFrom: []*string{ jsii.String("volumesFrom"), }, WorkingDirectory: jsii.String("workingDirectory"), }, DeployTime: jsii.Boolean(false), Exclude: []*string{ jsii.String("exclude"), }, FollowSymlinks: cdk.SymlinkFollowMode_NEVER, IgnoreMode: cdk.IgnoreMode_GLOB, Readers: []*iGrantable{ grantable, }, })
func AssetEnvironmentFile_FromAsset ¶
func AssetEnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
Loads the environment file from a local disk path.
func EnvironmentFile_FromAsset ¶
func EnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
Loads the environment file from a local disk path.
func NewAssetEnvironmentFile ¶
func NewAssetEnvironmentFile(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
func S3EnvironmentFile_FromAsset ¶
func S3EnvironmentFile_FromAsset(path *string, options *awss3assets.AssetOptions) AssetEnvironmentFile
Loads the environment file from a local disk path.
type AssetImage ¶
type AssetImage interface { ContainerImage // Called when the image is used by a ContainerDefinition. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *ContainerImageConfig }
An image that will be built from a local directory with a Dockerfile.
Example:
import "github.com/aws/constructs-go/constructs" import "github.com/aws/aws-cdk-go/awscdk" import ec2 "github.com/aws/aws-cdk-go/awscdk" import ecs "github.com/aws/aws-cdk-go/awscdk" import ecsPatterns "github.com/aws/aws-cdk-go/awscdk" import cxapi "github.com/aws/aws-cdk-go/awscdk" import path "github.com/aws-samples/dummy/path" type myStack struct { stack } func newMyStack(scope construct, id *string) *myStack { this := &myStack{} newStack_Override(this, scope, id) this.Node.SetContext(cxapi.eCS_REMOVE_DEFAULT_DESIRED_COUNT, jsii.Boolean(true)) vpc := ec2.NewVpc(this, jsii.String("VPC"), &VpcProps{ MaxAzs: jsii.Number(2), }) ecsPatterns.NewQueueProcessingFargateService(this, jsii.String("QueueProcessingService"), &QueueProcessingFargateServiceProps{ Vpc: Vpc, MemoryLimitMiB: jsii.Number(512), Image: ecs.NewAssetImage(path.join(__dirname, jsii.String(".."), jsii.String("sqs-reader"))), }) return this }
func AssetImage_FromAsset ¶
func AssetImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
Reference an image that's constructed directly from sources on disk.
If you already have a `DockerImageAsset` instance, you can use the `ContainerImage.fromDockerImageAsset` method instead.
func ContainerImage_FromAsset ¶
func ContainerImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
Reference an image that's constructed directly from sources on disk.
If you already have a `DockerImageAsset` instance, you can use the `ContainerImage.fromDockerImageAsset` method instead.
func EcrImage_FromAsset ¶
func EcrImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
Reference an image that's constructed directly from sources on disk.
If you already have a `DockerImageAsset` instance, you can use the `ContainerImage.fromDockerImageAsset` method instead.
func NewAssetImage ¶
func NewAssetImage(directory *string, props *AssetImageProps) AssetImage
Constructs a new instance of the AssetImage class.
func RepositoryImage_FromAsset ¶
func RepositoryImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
Reference an image that's constructed directly from sources on disk.
If you already have a `DockerImageAsset` instance, you can use the `ContainerImage.fromDockerImageAsset` method instead.
func TagParameterContainerImage_FromAsset ¶
func TagParameterContainerImage_FromAsset(directory *string, props *AssetImageProps) AssetImage
Reference an image that's constructed directly from sources on disk.
If you already have a `DockerImageAsset` instance, you can use the `ContainerImage.fromDockerImageAsset` method instead.
type AssetImageProps ¶
type AssetImageProps struct { // File paths matching the patterns will be excluded. // // See `ignoreMode` to set the matching behavior. // Has no effect on Assets bundled using the `bundling` property. // Default: - nothing is excluded. // Exclude *[]*string `field:"optional" json:"exclude" yaml:"exclude"` // A strategy for how to handle symlinks. // Default: SymlinkFollowMode.NEVER // FollowSymlinks awscdk.SymlinkFollowMode `field:"optional" json:"followSymlinks" yaml:"followSymlinks"` // The ignore behavior to use for `exclude` patterns. // Default: IgnoreMode.GLOB // IgnoreMode awscdk.IgnoreMode `field:"optional" json:"ignoreMode" yaml:"ignoreMode"` // Extra information to encode into the fingerprint (e.g. build instructions and other inputs). // Default: - hash is only based on source content. // ExtraHash *string `field:"optional" json:"extraHash" yaml:"extraHash"` // Unique identifier of the docker image asset and its potential revisions. // // Required if using AppScopedStagingSynthesizer. // Default: - no asset name. // AssetName *string `field:"optional" json:"assetName" yaml:"assetName"` // Build args to pass to the `docker build` command. // // Since Docker build arguments are resolved before deployment, keys and // values cannot refer to unresolved tokens (such as `lambda.functionArn` or // `queue.queueUrl`). // Default: - no build args are passed. // BuildArgs *map[string]*string `field:"optional" json:"buildArgs" yaml:"buildArgs"` // Build secrets. // // Docker BuildKit must be enabled to use build secrets. // // Example: // import { DockerBuildSecret } from 'aws-cdk-lib'; // // const buildSecrets = { // 'MY_SECRET': DockerBuildSecret.fromSrc('file.txt') // }; // // See: https://docs.docker.com/build/buildkit/ // // Default: - no build secrets. // BuildSecrets *map[string]*string `field:"optional" json:"buildSecrets" yaml:"buildSecrets"` // SSH agent socket or keys to pass to the `docker build` command. // // Docker BuildKit must be enabled to use the ssh flag. // See: https://docs.docker.com/build/buildkit/ // // Default: - no --ssh flag. // BuildSsh *string `field:"optional" json:"buildSsh" yaml:"buildSsh"` // Disable the cache and pass `--no-cache` to the `docker build` command. // Default: - cache is used. // CacheDisabled *bool `field:"optional" json:"cacheDisabled" yaml:"cacheDisabled"` // Cache from options to pass to the `docker build` command. // See: https://docs.docker.com/build/cache/backends/ // // Default: - no cache from options are passed to the build command. // CacheFrom *[]*awsecrassets.DockerCacheOption `field:"optional" json:"cacheFrom" yaml:"cacheFrom"` // Cache to options to pass to the `docker build` command. // See: https://docs.docker.com/build/cache/backends/ // // Default: - no cache to options are passed to the build command. // CacheTo *awsecrassets.DockerCacheOption `field:"optional" json:"cacheTo" yaml:"cacheTo"` // Path to the Dockerfile (relative to the directory). // Default: 'Dockerfile'. // File *string `field:"optional" json:"file" yaml:"file"` // Options to control which parameters are used to invalidate the asset hash. // Default: - hash all parameters. // Invalidation *awsecrassets.DockerImageAssetInvalidationOptions `field:"optional" json:"invalidation" yaml:"invalidation"` // Networking mode for the RUN commands during build. // // Support docker API 1.25+. // Default: - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used) // NetworkMode awsecrassets.NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // Outputs to pass to the `docker build` command. // See: https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs // // Default: - no outputs are passed to the build command (default outputs are used). // Outputs *[]*string `field:"optional" json:"outputs" yaml:"outputs"` // Platform to build for. // // _Requires Docker Buildx_. // Default: - no platform specified (the current machine architecture will be used). // Platform awsecrassets.Platform `field:"optional" json:"platform" yaml:"platform"` // Docker target to build to. // Default: - no target. // Target *string `field:"optional" json:"target" yaml:"target"` }
The properties for building an AssetImage.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var networkMode networkMode var platform platform assetImageProps := &AssetImageProps{ AssetName: jsii.String("assetName"), BuildArgs: map[string]*string{ "buildArgsKey": jsii.String("buildArgs"), }, BuildSecrets: map[string]*string{ "buildSecretsKey": jsii.String("buildSecrets"), }, BuildSsh: jsii.String("buildSsh"), CacheDisabled: jsii.Boolean(false), CacheFrom: []dockerCacheOption{ &dockerCacheOption{ Type: jsii.String("type"), // the properties below are optional Params: map[string]*string{ "paramsKey": jsii.String("params"), }, }, }, CacheTo: &dockerCacheOption{ Type: jsii.String("type"), // the properties below are optional Params: map[string]*string{ "paramsKey": jsii.String("params"), }, }, Exclude: []*string{ jsii.String("exclude"), }, ExtraHash: jsii.String("extraHash"), File: jsii.String("file"), FollowSymlinks: cdk.SymlinkFollowMode_NEVER, IgnoreMode: cdk.IgnoreMode_GLOB, Invalidation: &DockerImageAssetInvalidationOptions{ BuildArgs: jsii.Boolean(false), BuildSecrets: jsii.Boolean(false), BuildSsh: jsii.Boolean(false), ExtraHash: jsii.Boolean(false), File: jsii.Boolean(false), NetworkMode: jsii.Boolean(false), Outputs: jsii.Boolean(false), Platform: jsii.Boolean(false), RepositoryName: jsii.Boolean(false), Target: jsii.Boolean(false), }, NetworkMode: networkMode, Outputs: []*string{ jsii.String("outputs"), }, Platform: platform, Target: jsii.String("target"), }
type AssociateCloudMapServiceOptions ¶
type AssociateCloudMapServiceOptions struct { // The cloudmap service to register with. Service awsservicediscovery.IService `field:"required" json:"service" yaml:"service"` // The container to point to for a SRV record. // Default: - the task definition's default container. // Container ContainerDefinition `field:"optional" json:"container" yaml:"container"` // The port to point to for a SRV record. // Default: - the default port of the task definition's default container. // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` }
The options for using a cloudmap service.
Example:
var cloudMapService service var ecsService fargateService ecsService.AssociateCloudMapService(&AssociateCloudMapServiceOptions{ Service: cloudMapService, })
type AuthorizationConfig ¶
type AuthorizationConfig struct { // The access point ID to use. // // If an access point is specified, the root directory value will be // relative to the directory set for the access point. // If specified, transit encryption must be enabled in the EFSVolumeConfiguration. // Default: No id. // AccessPointId *string `field:"optional" json:"accessPointId" yaml:"accessPointId"` // Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. // // If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. // // Valid values: ENABLED | DISABLED. // Default: If this parameter is omitted, the default value of DISABLED is used. // Iam *string `field:"optional" json:"iam" yaml:"iam"` }
The authorization configuration details for the Amazon EFS file system.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" authorizationConfig := &AuthorizationConfig{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }
type AwsLogDriver ¶
type AwsLogDriver interface { LogDriver // The log group to send log streams to. // // Only available after the LogDriver has been bound to a ContainerDefinition. LogGroup() awslogs.ILogGroup SetLogGroup(val awslogs.ILogGroup) // Called when the log driver is configured on a container. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to CloudWatch Logs.
Example:
var cluster cluster // Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromAsset(path.resolve(__dirname, jsii.String(".."), jsii.String("eventhandler-image"))), MemoryLimitMiB: jsii.Number(256), Logging: ecs.NewAwsLogDriver(&AwsLogDriverProps{ StreamPrefix: jsii.String("EventDemo"), Mode: ecs.AwsLogDriverMode_NON_BLOCKING, }), }) // An Rule that describes the event trigger (in this case a scheduled run) rule := events.NewRule(this, jsii.String("Rule"), &RuleProps{ Schedule: events.Schedule_Expression(jsii.String("rate(1 min)")), }) // Pass an environment variable to the container 'TheContainer' in the task rule.AddTarget(targets.NewEcsTask(&EcsTaskProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, TaskCount: jsii.Number(1), ContainerOverrides: []containerOverride{ &containerOverride{ ContainerName: jsii.String("TheContainer"), Environment: []taskEnvironmentVariable{ &taskEnvironmentVariable{ Name: jsii.String("I_WAS_TRIGGERED"), Value: jsii.String("From CloudWatch Events"), }, }, }, }, }))
func NewAwsLogDriver ¶
func NewAwsLogDriver(props *AwsLogDriverProps) AwsLogDriver
Constructs a new instance of the AwsLogDriver class.
type AwsLogDriverMode ¶
type AwsLogDriverMode string
awslogs provides two modes for delivering messages from the container to the log driver.
Example:
var cluster cluster // Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromAsset(path.resolve(__dirname, jsii.String(".."), jsii.String("eventhandler-image"))), MemoryLimitMiB: jsii.Number(256), Logging: ecs.NewAwsLogDriver(&AwsLogDriverProps{ StreamPrefix: jsii.String("EventDemo"), Mode: ecs.AwsLogDriverMode_NON_BLOCKING, }), }) // An Rule that describes the event trigger (in this case a scheduled run) rule := events.NewRule(this, jsii.String("Rule"), &RuleProps{ Schedule: events.Schedule_Expression(jsii.String("rate(1 min)")), }) // Pass an environment variable to the container 'TheContainer' in the task rule.AddTarget(targets.NewEcsTask(&EcsTaskProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, TaskCount: jsii.Number(1), ContainerOverrides: []containerOverride{ &containerOverride{ ContainerName: jsii.String("TheContainer"), Environment: []taskEnvironmentVariable{ &taskEnvironmentVariable{ Name: jsii.String("I_WAS_TRIGGERED"), Value: jsii.String("From CloudWatch Events"), }, }, }, }, }))
const ( // (default) direct, blocking delivery from container to driver. AwsLogDriverMode_BLOCKING AwsLogDriverMode = "BLOCKING" // The non-blocking message delivery mode prevents applications from blocking due to logging back pressure. // // Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block. AwsLogDriverMode_NON_BLOCKING AwsLogDriverMode = "NON_BLOCKING" )
type AwsLogDriverProps ¶
type AwsLogDriverProps struct { // Prefix for the log streams. // // The awslogs-stream-prefix option allows you to associate a log stream // with the specified prefix, the container name, and the ID of the Amazon // ECS task to which the container belongs. If you specify a prefix with // this option, then the log stream takes the following format: // // prefix-name/container-name/ecs-task-id. StreamPrefix *string `field:"required" json:"streamPrefix" yaml:"streamPrefix"` // This option defines a multiline start pattern in Python strftime format. // // A log message consists of a line that matches the pattern and any // following lines that don’t match the pattern. Thus the matched line is // the delimiter between log messages. // Default: - No multiline matching. // DatetimeFormat *string `field:"optional" json:"datetimeFormat" yaml:"datetimeFormat"` // The log group to log to. // Default: - A log group is automatically created. // LogGroup awslogs.ILogGroup `field:"optional" json:"logGroup" yaml:"logGroup"` // The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct. // Default: - Logs never expire. // LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"` // When AwsLogDriverMode.NON_BLOCKING is configured, this parameter controls the size of the non-blocking buffer used to temporarily store messages. This parameter is not valid with AwsLogDriverMode.BLOCKING. // Default: - 1 megabyte if driver mode is non-blocking, otherwise this property is not set. // MaxBufferSize awscdk.Size `field:"optional" json:"maxBufferSize" yaml:"maxBufferSize"` // The delivery mode of log messages from the container to awslogs. // Default: - AwsLogDriverMode.BLOCKING // Mode AwsLogDriverMode `field:"optional" json:"mode" yaml:"mode"` // This option defines a multiline start pattern using a regular expression. // // A log message consists of a line that matches the pattern and any // following lines that don’t match the pattern. Thus the matched line is // the delimiter between log messages. // // This option is ignored if datetimeFormat is also configured. // Default: - No multiline matching. // MultilinePattern *string `field:"optional" json:"multilinePattern" yaml:"multilinePattern"` }
Specifies the awslogs log driver configuration options.
Example:
// Create a Task Definition for the Windows container to start taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{ RuntimePlatform: &RuntimePlatform{ OperatingSystemFamily: ecs.OperatingSystemFamily_WINDOWS_SERVER_2019_CORE(), CpuArchitecture: ecs.CpuArchitecture_X86_64(), }, Cpu: jsii.Number(1024), MemoryLimitMiB: jsii.Number(2048), }) taskDefinition.AddContainer(jsii.String("windowsservercore"), &ContainerDefinitionOptions{ Logging: ecs.LogDriver_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("win-iis-on-fargate"), }), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), }, }, Image: ecs.ContainerImage_FromRegistry(jsii.String("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")), })
type BaseLogDriverProps ¶
type BaseLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" baseLogDriverProps := &BaseLogDriverProps{ Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), }
type BaseMountPoint ¶ added in v2.122.0
type BaseMountPoint struct { // The path on the container to mount the host volume at. ContainerPath *string `field:"required" json:"containerPath" yaml:"containerPath"` // Specifies whether to give the container read-only access to the volume. // // If this value is true, the container has read-only access to the volume. // If this value is false, then the container can write to the volume. ReadOnly *bool `field:"required" json:"readOnly" yaml:"readOnly"` }
The base details of where a volume will be mounted within a container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" baseMountPoint := &BaseMountPoint{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), }
type BaseService ¶
type BaseService interface { awscdk.Resource IBaseService awselasticloadbalancing.ILoadBalancerTarget awselasticloadbalancingv2.IApplicationLoadBalancerTarget awselasticloadbalancingv2.INetworkLoadBalancerTarget // The details of the AWS Cloud Map service. CloudmapService() awsservicediscovery.Service SetCloudmapService(val awsservicediscovery.Service) // The CloudMap service created for this service, if any. CloudMapService() awsservicediscovery.IService // The cluster that hosts the service. Cluster() ICluster // The security groups which manage the allowed network traffic for the service. Connections() awsec2.Connections // The deployment alarms property - this will be rendered directly and lazily as the CfnService.alarms property. DeploymentAlarms() *CfnService_DeploymentAlarmsProperty SetDeploymentAlarms(val *CfnService_DeploymentAlarmsProperty) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. LoadBalancers() *[]*CfnService_LoadBalancerProperty SetLoadBalancers(val *[]*CfnService_LoadBalancerProperty) // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. NetworkConfiguration() *CfnService_NetworkConfigurationProperty SetNetworkConfiguration(val *CfnService_NetworkConfigurationProperty) // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The Amazon Resource Name (ARN) of the service. ServiceArn() *string // The name of the service. ServiceName() *string // The details of the service discovery registries to assign to this service. // // For more information, see Service Discovery. ServiceRegistries() *[]*CfnService_ServiceRegistryProperty SetServiceRegistries(val *[]*CfnService_ServiceRegistryProperty) // The stack in which this resource is defined. Stack() awscdk.Stack // The task definition to use for tasks in the service. TaskDefinition() TaskDefinition // Adds a volume to the Service. AddVolume(volume ServiceManagedVolume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Associates this service with a CloudMap service. AssociateCloudMapService(options *AssociateCloudMapServiceOptions) // This method is called to attach this service to an Application Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToApplicationTargetGroup(targetGroup awselasticloadbalancingv2.IApplicationTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // Registers the service as a target of a Classic Load Balancer (CLB). // // Don't call this. Call `loadBalancer.addTarget()` instead. AttachToClassicLB(loadBalancer awselasticloadbalancing.LoadBalancer) // This method is called to attach this service to a Network Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToNetworkTargetGroup(targetGroup awselasticloadbalancingv2.INetworkTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // An attribute representing the minimum and maximum task count for an AutoScalingGroup. AutoScaleTaskCount(props *awsapplicationautoscaling.EnableScalingProps) ScalableTaskCount // This method is called to create a networkConfiguration. ConfigureAwsVpcNetworkingWithSecurityGroups(vpc awsec2.IVpc, assignPublicIp *bool, vpcSubnets *awsec2.SubnetSelection, securityGroups *[]awsec2.ISecurityGroup) // Enable CloudMap service discovery for the service. // // Returns: The created CloudMap service. EnableCloudMap(options *CloudMapOptions) awsservicediscovery.Service // Enable Deployment Alarms which take advantage of arbitrary alarms and configure them after service initialization. // // If you have already enabled deployment alarms, this function can be used to tell ECS about additional alarms that // should interrupt a deployment. // // New alarms specified in subsequent calls of this function will be appended to the existing list of alarms. // // The same Alarm Behavior must be used on all deployment alarms. If you specify different AlarmBehavior values in // multiple calls to this function, or the Alarm Behavior used here doesn't match the one used in the service // constructor, an error will be thrown. // // If the alarm's metric references the service, you cannot pass `Alarm.alarmName` here. That will cause a circular // dependency between the service and its deployment alarm. See this package's README for options to alarm on service // metrics, and avoid this circular dependency. EnableDeploymentAlarms(alarmNames *[]*string, options *DeploymentAlarmOptions) // Enable Service Connect on this service. EnableServiceConnect(config *ServiceConnectProps) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Return a load balancing target for a specific container and port. // // Use this function to create a load balancer target if you want to load balance to // another container than the first essential container or the first mapped port on // the container. // // Use the return value of this function where you would normally use a load balancer // target, instead of the `Service` object itself. // // Example: // var listener applicationListener // var service baseService // // listener.AddTargets(jsii.String("ECS"), &AddApplicationTargetsProps{ // Port: jsii.Number(80), // Targets: []iApplicationLoadBalancerTarget{ // service.LoadBalancerTarget(&LoadBalancerTargetOptions{ // ContainerName: jsii.String("MyContainer"), // ContainerPort: jsii.Number(1234), // }), // }, // }) // LoadBalancerTarget(options *LoadBalancerTargetOptions) IEcsLoadBalancerTarget // This method returns the specified CloudWatch metric name for this service. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's CPU utilization. // Default: average over 5 minutes. // MetricCpuUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's memory utilization. // Default: average over 5 minutes. // MetricMemoryUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Use this function to create all load balancer targets to be registered in this service, add them to target groups, and attach target groups to listeners accordingly. // // Alternatively, you can use `listener.addTargets()` to create targets and add them to target groups. // // Example: // var listener applicationListener // var service baseService // // service.RegisterLoadBalancerTargets(&EcsTarget{ // ContainerName: jsii.String("web"), // ContainerPort: jsii.Number(80), // NewTargetGroupId: jsii.String("ECS"), // Listener: ecs.ListenerConfig_ApplicationListener(listener, &AddApplicationTargetsProps{ // Protocol: elbv2.ApplicationProtocol_HTTPS, // }), // }) // RegisterLoadBalancerTargets(targets ...*EcsTarget) // Returns a string representation of this construct. ToString() *string }
The base class for Ec2Service and FargateService services.
Example:
import ecs "github.com/aws/aws-cdk-go/awscdk" service := ecs.BaseService_FromServiceArnWithCluster(this, jsii.String("EcsService"), jsii.String("arn:aws:ecs:us-east-1:123456789012:service/myClusterName/myServiceName")) pipeline := codepipeline.NewPipeline(this, jsii.String("MyPipeline")) buildOutput := codepipeline.NewArtifact() // add source and build stages to the pipeline as usual... deployStage := pipeline.AddStage(&StageOptions{ StageName: jsii.String("Deploy"), Actions: []iAction{ codepipeline_actions.NewEcsDeployAction(&EcsDeployActionProps{ ActionName: jsii.String("DeployAction"), Service: service, Input: buildOutput, }), }, })
type BaseServiceOptions ¶
type BaseServiceOptions struct { // The name of the cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // A list of Capacity Provider strategies used to place a service. // Default: - undefined. // CapacityProviderStrategies *[]*CapacityProviderStrategy `field:"optional" json:"capacityProviderStrategies" yaml:"capacityProviderStrategies"` // Whether to enable the deployment circuit breaker. // // If this property is defined, circuit breaker will be implicitly // enabled. // Default: - disabled. // CircuitBreaker *DeploymentCircuitBreaker `field:"optional" json:"circuitBreaker" yaml:"circuitBreaker"` // The options for configuring an Amazon ECS service to use service discovery. // Default: - AWS Cloud Map service discovery is not enabled. // CloudMapOptions *CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. // Default: - No alarms will be monitored during deployment. // DeploymentAlarms *DeploymentAlarmConfig `field:"optional" json:"deploymentAlarms" yaml:"deploymentAlarms"` // Specifies which deployment controller to use for the service. // // For more information, see // [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // Default: - Rolling update (ECS). // DeploymentController *DeploymentController `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to enable Amazon ECS managed tags for the tasks within the service. // // For more information, see // [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) // Default: false. // EnableECSManagedTags *bool `field:"optional" json:"enableECSManagedTags" yaml:"enableECSManagedTags"` // Whether to enable the ability to execute into a container. // Default: - undefined. // EnableExecuteCommand *bool `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set. // HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. // Default: - 100 if daemon, otherwise 200. // MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. // Default: - 0 if daemon, otherwise 50. // MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE // Default: PropagatedTagSource.NONE // PropagateTags PropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // Configuration for Service Connect. // Default: No ports are advertised via Service Connect on this service, and the service // cannot make requests to other services via Service Connect. // ServiceConnectConfiguration *ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of the service. // Default: - CloudFormation-generated name. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // Revision number for the task definition or `latest` to use the latest active task revision. // Default: - Uses the revision of the passed task definition deployed by CloudFormation. // TaskDefinitionRevision TaskDefinitionRevision `field:"optional" json:"taskDefinitionRevision" yaml:"taskDefinitionRevision"` // Configuration details for a volume used by the service. // // This allows you to specify // details about the EBS volume that can be attched to ECS tasks. // Default: - undefined. // VolumeConfigurations *[]ServiceManagedVolume `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` }
The properties for the base Ec2Service or FargateService service.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var containerDefinition containerDefinition var logDriver logDriver var namespace iNamespace var serviceManagedVolume serviceManagedVolume var taskDefinitionRevision taskDefinitionRevision baseServiceOptions := &BaseServiceOptions{ Cluster: cluster, // the properties below are optional CapacityProviderStrategies: []capacityProviderStrategy{ &capacityProviderStrategy{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }, }, CircuitBreaker: &DeploymentCircuitBreaker{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, CloudMapOptions: &CloudMapOptions{ CloudMapNamespace: namespace, Container: containerDefinition, ContainerPort: jsii.Number(123), DnsRecordType: awscdk.Aws_servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Minutes(jsii.Number(30)), FailureThreshold: jsii.Number(123), Name: jsii.String("name"), }, DeploymentAlarms: &DeploymentAlarmConfig{ AlarmNames: []*string{ jsii.String("alarmNames"), }, // the properties below are optional Behavior: awscdk.Aws_ecs.AlarmBehavior_ROLLBACK_ON_ALARM, }, DeploymentController: &DeploymentController{ Type: awscdk.*Aws_ecs.DeploymentControllerType_ECS, }, DesiredCount: jsii.Number(123), EnableECSManagedTags: jsii.Boolean(false), EnableExecuteCommand: jsii.Boolean(false), HealthCheckGracePeriod: cdk.Duration_*Minutes(jsii.Number(30)), MaxHealthyPercent: jsii.Number(123), MinHealthyPercent: jsii.Number(123), PropagateTags: awscdk.*Aws_ecs.PropagatedTagSource_SERVICE, ServiceConnectConfiguration: &ServiceConnectProps{ LogDriver: logDriver, Namespace: jsii.String("namespace"), Services: []serviceConnectService{ &serviceConnectService{ PortMappingName: jsii.String("portMappingName"), // the properties below are optional DiscoveryName: jsii.String("discoveryName"), DnsName: jsii.String("dnsName"), IngressPortOverride: jsii.Number(123), Port: jsii.Number(123), }, }, }, ServiceName: jsii.String("serviceName"), TaskDefinitionRevision: taskDefinitionRevision, VolumeConfigurations: []*serviceManagedVolume{ serviceManagedVolume, }, }
type BaseServiceProps ¶
type BaseServiceProps struct { // The name of the cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // A list of Capacity Provider strategies used to place a service. // Default: - undefined. // CapacityProviderStrategies *[]*CapacityProviderStrategy `field:"optional" json:"capacityProviderStrategies" yaml:"capacityProviderStrategies"` // Whether to enable the deployment circuit breaker. // // If this property is defined, circuit breaker will be implicitly // enabled. // Default: - disabled. // CircuitBreaker *DeploymentCircuitBreaker `field:"optional" json:"circuitBreaker" yaml:"circuitBreaker"` // The options for configuring an Amazon ECS service to use service discovery. // Default: - AWS Cloud Map service discovery is not enabled. // CloudMapOptions *CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. // Default: - No alarms will be monitored during deployment. // DeploymentAlarms *DeploymentAlarmConfig `field:"optional" json:"deploymentAlarms" yaml:"deploymentAlarms"` // Specifies which deployment controller to use for the service. // // For more information, see // [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // Default: - Rolling update (ECS). // DeploymentController *DeploymentController `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to enable Amazon ECS managed tags for the tasks within the service. // // For more information, see // [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) // Default: false. // EnableECSManagedTags *bool `field:"optional" json:"enableECSManagedTags" yaml:"enableECSManagedTags"` // Whether to enable the ability to execute into a container. // Default: - undefined. // EnableExecuteCommand *bool `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set. // HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. // Default: - 100 if daemon, otherwise 200. // MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. // Default: - 0 if daemon, otherwise 50. // MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE // Default: PropagatedTagSource.NONE // PropagateTags PropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // Configuration for Service Connect. // Default: No ports are advertised via Service Connect on this service, and the service // cannot make requests to other services via Service Connect. // ServiceConnectConfiguration *ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of the service. // Default: - CloudFormation-generated name. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // Revision number for the task definition or `latest` to use the latest active task revision. // Default: - Uses the revision of the passed task definition deployed by CloudFormation. // TaskDefinitionRevision TaskDefinitionRevision `field:"optional" json:"taskDefinitionRevision" yaml:"taskDefinitionRevision"` // Configuration details for a volume used by the service. // // This allows you to specify // details about the EBS volume that can be attched to ECS tasks. // Default: - undefined. // VolumeConfigurations *[]ServiceManagedVolume `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` // The launch type on which to run your service. // // LaunchType will be omitted if capacity provider strategies are specified on the service. // See: - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-capacityproviderstrategy // // Valid values are: LaunchType.ECS or LaunchType.FARGATE or LaunchType.EXTERNAL // LaunchType LaunchType `field:"required" json:"launchType" yaml:"launchType"` }
Complete base service properties that are required to be supplied by the implementation of the BaseService class.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var containerDefinition containerDefinition var logDriver logDriver var namespace iNamespace var serviceManagedVolume serviceManagedVolume var taskDefinitionRevision taskDefinitionRevision baseServiceProps := &BaseServiceProps{ Cluster: cluster, LaunchType: awscdk.Aws_ecs.LaunchType_EC2, // the properties below are optional CapacityProviderStrategies: []capacityProviderStrategy{ &capacityProviderStrategy{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }, }, CircuitBreaker: &DeploymentCircuitBreaker{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, CloudMapOptions: &CloudMapOptions{ CloudMapNamespace: namespace, Container: containerDefinition, ContainerPort: jsii.Number(123), DnsRecordType: awscdk.Aws_servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Minutes(jsii.Number(30)), FailureThreshold: jsii.Number(123), Name: jsii.String("name"), }, DeploymentAlarms: &DeploymentAlarmConfig{ AlarmNames: []*string{ jsii.String("alarmNames"), }, // the properties below are optional Behavior: awscdk.*Aws_ecs.AlarmBehavior_ROLLBACK_ON_ALARM, }, DeploymentController: &DeploymentController{ Type: awscdk.*Aws_ecs.DeploymentControllerType_ECS, }, DesiredCount: jsii.Number(123), EnableECSManagedTags: jsii.Boolean(false), EnableExecuteCommand: jsii.Boolean(false), HealthCheckGracePeriod: cdk.Duration_*Minutes(jsii.Number(30)), MaxHealthyPercent: jsii.Number(123), MinHealthyPercent: jsii.Number(123), PropagateTags: awscdk.*Aws_ecs.PropagatedTagSource_SERVICE, ServiceConnectConfiguration: &ServiceConnectProps{ LogDriver: logDriver, Namespace: jsii.String("namespace"), Services: []serviceConnectService{ &serviceConnectService{ PortMappingName: jsii.String("portMappingName"), // the properties below are optional DiscoveryName: jsii.String("discoveryName"), DnsName: jsii.String("dnsName"), IngressPortOverride: jsii.Number(123), Port: jsii.Number(123), }, }, }, ServiceName: jsii.String("serviceName"), TaskDefinitionRevision: taskDefinitionRevision, VolumeConfigurations: []*serviceManagedVolume{ serviceManagedVolume, }, }
type BinPackResource ¶
type BinPackResource string
Instance resource used for bin packing.
const ( // Fill up hosts' CPU allocations first. BinPackResource_CPU BinPackResource = "CPU" // Fill up hosts' memory allocations first. BinPackResource_MEMORY BinPackResource = "MEMORY" )
type BottleRocketImage ¶
type BottleRocketImage interface { awsec2.IMachineImage // Return the correct image. GetImage(scope constructs.Construct) *awsec2.MachineImageConfig }
Construct an Bottlerocket image from the latest AMI published in SSM.
Example:
var cluster cluster cluster.AddCapacity(jsii.String("bottlerocket-asg"), &AddCapacityOptions{ MinCapacity: jsii.Number(2), InstanceType: ec2.NewInstanceType(jsii.String("c5.large")), MachineImage: ecs.NewBottleRocketImage(), })
func NewBottleRocketImage ¶
func NewBottleRocketImage(props *BottleRocketImageProps) BottleRocketImage
Constructs a new instance of the BottleRocketImage class.
type BottleRocketImageProps ¶
type BottleRocketImageProps struct { // The CPU architecture. // Default: - x86_64. // Architecture awsec2.InstanceArchitecture `field:"optional" json:"architecture" yaml:"architecture"` // Whether the AMI ID is cached to be stable between deployments. // // By default, the newest image is used on each deployment. This will cause // instances to be replaced whenever a new version is released, and may cause // downtime if there aren't enough running instances in the AutoScalingGroup // to reschedule the tasks on. // // If set to true, the AMI ID will be cached in `cdk.context.json` and the // same value will be used on future runs. Your instances will not be replaced // but your AMI version will grow old over time. To refresh the AMI lookup, // you will have to evict the value from the cache using the `cdk context` // command. See https://docs.aws.amazon.com/cdk/latest/guide/context.html for // more information. // // Can not be set to `true` in environment-agnostic stacks. // Default: false. // CachedInContext *bool `field:"optional" json:"cachedInContext" yaml:"cachedInContext"` // The Amazon ECS variant to use. // Default: - BottlerocketEcsVariant.AWS_ECS_1 // Variant BottlerocketEcsVariant `field:"optional" json:"variant" yaml:"variant"` }
Properties for BottleRocketImage.
Example:
var cluster cluster cluster.AddCapacity(jsii.String("bottlerocket-asg"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("p3.2xlarge")), MachineImage: ecs.NewBottleRocketImage(&BottleRocketImageProps{ Variant: ecs.BottlerocketEcsVariant_AWS_ECS_2_NVIDIA, }), })
type BottlerocketEcsVariant ¶
type BottlerocketEcsVariant string
Amazon ECS variant.
Example:
var cluster cluster cluster.AddCapacity(jsii.String("bottlerocket-asg"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("p3.2xlarge")), MachineImage: ecs.NewBottleRocketImage(&BottleRocketImageProps{ Variant: ecs.BottlerocketEcsVariant_AWS_ECS_2_NVIDIA, }), })
const ( // aws-ecs-1 variant. BottlerocketEcsVariant_AWS_ECS_1 BottlerocketEcsVariant = "AWS_ECS_1" // aws-ecs-1-nvidia variant. BottlerocketEcsVariant_AWS_ECS_1_NVIDIA BottlerocketEcsVariant = "AWS_ECS_1_NVIDIA" // aws-ecs-2 variant. BottlerocketEcsVariant_AWS_ECS_2 BottlerocketEcsVariant = "AWS_ECS_2" // aws-ecs-2-nvidia variant. BottlerocketEcsVariant_AWS_ECS_2_NVIDIA BottlerocketEcsVariant = "AWS_ECS_2_NVIDIA" )
type BuiltInAttributes ¶
type BuiltInAttributes interface { }
The built-in container instance attributes.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" builtInAttributes := awscdk.Aws_ecs.NewBuiltInAttributes()
func NewBuiltInAttributes ¶
func NewBuiltInAttributes() BuiltInAttributes
type Capability ¶
type Capability string
A Linux capability.
const ( Capability_ALL Capability = "ALL" Capability_AUDIT_CONTROL Capability = "AUDIT_CONTROL" Capability_AUDIT_WRITE Capability = "AUDIT_WRITE" Capability_BLOCK_SUSPEND Capability = "BLOCK_SUSPEND" Capability_CHOWN Capability = "CHOWN" Capability_DAC_OVERRIDE Capability = "DAC_OVERRIDE" Capability_DAC_READ_SEARCH Capability = "DAC_READ_SEARCH" Capability_FOWNER Capability = "FOWNER" Capability_FSETID Capability = "FSETID" Capability_IPC_LOCK Capability = "IPC_LOCK" Capability_IPC_OWNER Capability = "IPC_OWNER" Capability_KILL Capability = "KILL" Capability_LEASE Capability = "LEASE" Capability_LINUX_IMMUTABLE Capability = "LINUX_IMMUTABLE" Capability_MAC_ADMIN Capability = "MAC_ADMIN" Capability_MAC_OVERRIDE Capability = "MAC_OVERRIDE" Capability_MKNOD Capability = "MKNOD" Capability_NET_ADMIN Capability = "NET_ADMIN" Capability_NET_BIND_SERVICE Capability = "NET_BIND_SERVICE" Capability_NET_BROADCAST Capability = "NET_BROADCAST" Capability_NET_RAW Capability = "NET_RAW" Capability_SETFCAP Capability = "SETFCAP" Capability_SETGID Capability = "SETGID" Capability_SETPCAP Capability = "SETPCAP" Capability_SETUID Capability = "SETUID" Capability_SYS_ADMIN Capability = "SYS_ADMIN" Capability_SYS_BOOT Capability = "SYS_BOOT" Capability_SYS_CHROOT Capability = "SYS_CHROOT" Capability_SYS_MODULE Capability = "SYS_MODULE" Capability_SYS_NICE Capability = "SYS_NICE" Capability_SYS_PACCT Capability = "SYS_PACCT" Capability_SYS_PTRACE Capability = "SYS_PTRACE" Capability_SYS_RAWIO Capability = "SYS_RAWIO" Capability_SYS_RESOURCE Capability = "SYS_RESOURCE" Capability_SYS_TIME Capability = "SYS_TIME" Capability_SYS_TTY_CONFIG Capability = "SYS_TTY_CONFIG" Capability_SYSLOG Capability = "SYSLOG" Capability_WAKE_ALARM Capability = "WAKE_ALARM" )
type CapacityProviderStrategy ¶
type CapacityProviderStrategy struct { // The name of the capacity provider. CapacityProvider *string `field:"required" json:"capacityProvider" yaml:"capacityProvider"` // The base value designates how many tasks, at a minimum, to run on the specified capacity provider. // // Only one // capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default // value of 0 is used. // Default: - none. // Base *float64 `field:"optional" json:"base" yaml:"base"` // The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. // // The weight value is taken into consideration after the base value, if defined, is satisfied. // Default: - 0. // Weight *float64 `field:"optional" json:"weight" yaml:"weight"` }
A Capacity Provider strategy to use for the service.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" capacityProviderStrategy := &CapacityProviderStrategy{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }
type CfnCapacityProvider ¶
type CfnCapacityProvider interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Auto Scaling group settings for the capacity provider. AutoScalingGroupProvider() interface{} SetAutoScalingGroupProvider(val interface{}) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The name of the capacity provider. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The metadata that you apply to the capacity provider to help you categorize and organize it. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Creates a new capacity provider.
Capacity providers are associated with an Amazon ECS cluster and are used in capacity provider strategies to facilitate cluster auto scaling.
Only capacity providers that use an Auto Scaling group can be created. Amazon ECS tasks on AWS Fargate use the `FARGATE` and `FARGATE_SPOT` capacity providers. These providers are available to all accounts in the AWS Regions that AWS Fargate supports.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnCapacityProvider := awscdk.Aws_ecs.NewCfnCapacityProvider(this, jsii.String("MyCfnCapacityProvider"), &CfnCapacityProviderProps{ AutoScalingGroupProvider: &AutoScalingGroupProviderProperty{ AutoScalingGroupArn: jsii.String("autoScalingGroupArn"), // the properties below are optional ManagedDraining: jsii.String("managedDraining"), ManagedScaling: &ManagedScalingProperty{ InstanceWarmupPeriod: jsii.Number(123), MaximumScalingStepSize: jsii.Number(123), MinimumScalingStepSize: jsii.Number(123), Status: jsii.String("status"), TargetCapacity: jsii.Number(123), }, ManagedTerminationProtection: jsii.String("managedTerminationProtection"), }, // the properties below are optional Name: jsii.String("name"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html
func NewCfnCapacityProvider ¶
func NewCfnCapacityProvider(scope constructs.Construct, id *string, props *CfnCapacityProviderProps) CfnCapacityProvider
type CfnCapacityProviderProps ¶
type CfnCapacityProviderProps struct { // The Auto Scaling group settings for the capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html#cfn-ecs-capacityprovider-autoscalinggroupprovider // AutoScalingGroupProvider interface{} `field:"required" json:"autoScalingGroupProvider" yaml:"autoScalingGroupProvider"` // The name of the capacity provider. // // If a name is specified, it cannot start with `aws` , `ecs` , or `fargate` . If no name is specified, a default name in the `CFNStackName-CFNResourceName-RandomString` format is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html#cfn-ecs-capacityprovider-name // Name *string `field:"optional" json:"name" yaml:"name"` // The metadata that you apply to the capacity provider to help you categorize and organize it. // // Each tag consists of a key and an optional value. You define both. // // The following basic restrictions apply to tags: // // - Maximum number of tags per resource - 50 // - For each resource, each tag key must be unique, and each tag key can have only one value. // - Maximum key length - 128 Unicode characters in UTF-8 // - Maximum value length - 256 Unicode characters in UTF-8 // - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html#cfn-ecs-capacityprovider-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnCapacityProvider`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnCapacityProviderProps := &CfnCapacityProviderProps{ AutoScalingGroupProvider: &AutoScalingGroupProviderProperty{ AutoScalingGroupArn: jsii.String("autoScalingGroupArn"), // the properties below are optional ManagedDraining: jsii.String("managedDraining"), ManagedScaling: &ManagedScalingProperty{ InstanceWarmupPeriod: jsii.Number(123), MaximumScalingStepSize: jsii.Number(123), MinimumScalingStepSize: jsii.Number(123), Status: jsii.String("status"), TargetCapacity: jsii.Number(123), }, ManagedTerminationProtection: jsii.String("managedTerminationProtection"), }, // the properties below are optional Name: jsii.String("name"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html
type CfnCapacityProvider_AutoScalingGroupProviderProperty ¶
type CfnCapacityProvider_AutoScalingGroupProviderProperty struct { // The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-autoscalinggroupprovider.html#cfn-ecs-capacityprovider-autoscalinggroupprovider-autoscalinggrouparn // AutoScalingGroupArn *string `field:"required" json:"autoScalingGroupArn" yaml:"autoScalingGroupArn"` // The managed draining option for the Auto Scaling group capacity provider. // // When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-autoscalinggroupprovider.html#cfn-ecs-capacityprovider-autoscalinggroupprovider-manageddraining // ManagedDraining *string `field:"optional" json:"managedDraining" yaml:"managedDraining"` // The managed scaling settings for the Auto Scaling group capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-autoscalinggroupprovider.html#cfn-ecs-capacityprovider-autoscalinggroupprovider-managedscaling // ManagedScaling interface{} `field:"optional" json:"managedScaling" yaml:"managedScaling"` // The managed termination protection setting to use for the Auto Scaling group capacity provider. // // This determines whether the Auto Scaling group has managed termination protection. The default is off. // // > When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work. // // When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see [Instance Protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) in the *AWS Auto Scaling User Guide* . // // When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-autoscalinggroupprovider.html#cfn-ecs-capacityprovider-autoscalinggroupprovider-managedterminationprotection // ManagedTerminationProtection *string `field:"optional" json:"managedTerminationProtection" yaml:"managedTerminationProtection"` }
The details of the Auto Scaling group for the capacity provider.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" autoScalingGroupProviderProperty := &AutoScalingGroupProviderProperty{ AutoScalingGroupArn: jsii.String("autoScalingGroupArn"), // the properties below are optional ManagedDraining: jsii.String("managedDraining"), ManagedScaling: &ManagedScalingProperty{ InstanceWarmupPeriod: jsii.Number(123), MaximumScalingStepSize: jsii.Number(123), MinimumScalingStepSize: jsii.Number(123), Status: jsii.String("status"), TargetCapacity: jsii.Number(123), }, ManagedTerminationProtection: jsii.String("managedTerminationProtection"), }
type CfnCapacityProvider_ManagedScalingProperty ¶
type CfnCapacityProvider_ManagedScalingProperty struct { // The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group. // // If this parameter is omitted, the default value of `300` seconds is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-instancewarmupperiod // InstanceWarmupPeriod *float64 `field:"optional" json:"instanceWarmupPeriod" yaml:"instanceWarmupPeriod"` // The maximum number of Amazon EC2 instances that Amazon ECS will scale out at one time. // // The scale in process is not affected by this parameter. If this parameter is omitted, the default value of `10000` is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-maximumscalingstepsize // MaximumScalingStepSize *float64 `field:"optional" json:"maximumScalingStepSize" yaml:"maximumScalingStepSize"` // The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time. // // The scale in process is not affected by this parameter If this parameter is omitted, the default value of `1` is used. // // When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size. // // If you use a capacity provider with an Auto Scaling group configured with more than one Amazon EC2 instance type or Availability Zone, Amazon ECS will scale up by the exact minimum scaling step size value and will ignore both the maximum scaling step size as well as the capacity demand. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-minimumscalingstepsize // MinimumScalingStepSize *float64 `field:"optional" json:"minimumScalingStepSize" yaml:"minimumScalingStepSize"` // Determines whether to use managed scaling for the capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-status // Status *string `field:"optional" json:"status" yaml:"status"` // The target capacity utilization as a percentage for the capacity provider. // // The specified value must be greater than `0` and less than or equal to `100` . For example, if you want the capacity provider to maintain 10% spare capacity, then that means the utilization is 90%, so use a `targetCapacity` of `90` . The default value of `100` percent results in the Amazon EC2 instances in your Auto Scaling group being completely used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-targetcapacity // TargetCapacity *float64 `field:"optional" json:"targetCapacity" yaml:"targetCapacity"` }
The managed scaling settings for the Auto Scaling group capacity provider.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" managedScalingProperty := &ManagedScalingProperty{ InstanceWarmupPeriod: jsii.Number(123), MaximumScalingStepSize: jsii.Number(123), MinimumScalingStepSize: jsii.Number(123), Status: jsii.String("status"), TargetCapacity: jsii.Number(123), }
type CfnCluster ¶
type CfnCluster interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as `arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster` . AttrArn() *string // The short name of one or more capacity providers to associate with the cluster. CapacityProviders() *[]*string SetCapacityProviders(val *[]*string) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // A user-generated string that you use to identify your cluster. ClusterName() *string SetClusterName(val *string) // The settings to use when creating a cluster. ClusterSettings() interface{} SetClusterSettings(val interface{}) // The execute command configuration for the cluster. Configuration() interface{} SetConfiguration(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The default capacity provider strategy for the cluster. DefaultCapacityProviderStrategy() interface{} SetDefaultCapacityProviderStrategy(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // Use this parameter to set a default Service Connect namespace. ServiceConnectDefaults() interface{} SetServiceConnectDefaults(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The metadata that you apply to the cluster to help you categorize and organize them. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
The `AWS::ECS::Cluster` resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnCluster := awscdk.Aws_ecs.NewCfnCluster(this, jsii.String("MyCfnCluster"), &CfnClusterProps{ CapacityProviders: []*string{ jsii.String("capacityProviders"), }, ClusterName: jsii.String("clusterName"), ClusterSettings: []interface{}{ &ClusterSettingsProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, Configuration: &ClusterConfigurationProperty{ ExecuteCommandConfiguration: &ExecuteCommandConfigurationProperty{ KmsKeyId: jsii.String("kmsKeyId"), LogConfiguration: &ExecuteCommandLogConfigurationProperty{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"), S3BucketName: jsii.String("s3BucketName"), S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }, Logging: jsii.String("logging"), }, }, DefaultCapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }, }, ServiceConnectDefaults: &ServiceConnectDefaultsProperty{ Namespace: jsii.String("namespace"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html
func NewCfnCluster ¶
func NewCfnCluster(scope constructs.Construct, id *string, props *CfnClusterProps) CfnCluster
type CfnClusterCapacityProviderAssociations ¶
type CfnClusterCapacityProviderAssociations interface { awscdk.CfnResource awscdk.IInspectable // The capacity providers to associate with the cluster. CapacityProviders() *[]*string SetCapacityProviders(val *[]*string) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // The cluster the capacity provider association is the target of. Cluster() *string SetCluster(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The default capacity provider strategy to associate with the cluster. DefaultCapacityProviderStrategy() interface{} SetDefaultCapacityProviderStrategy(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
The `AWS::ECS::ClusterCapacityProviderAssociations` resource associates one or more capacity providers and a default capacity provider strategy with a cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnClusterCapacityProviderAssociations := awscdk.Aws_ecs.NewCfnClusterCapacityProviderAssociations(this, jsii.String("MyCfnClusterCapacityProviderAssociations"), &CfnClusterCapacityProviderAssociationsProps{ CapacityProviders: []*string{ jsii.String("capacityProviders"), }, Cluster: jsii.String("cluster"), DefaultCapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyProperty{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }, }, })
func NewCfnClusterCapacityProviderAssociations ¶
func NewCfnClusterCapacityProviderAssociations(scope constructs.Construct, id *string, props *CfnClusterCapacityProviderAssociationsProps) CfnClusterCapacityProviderAssociations
type CfnClusterCapacityProviderAssociationsProps ¶
type CfnClusterCapacityProviderAssociationsProps struct { // The capacity providers to associate with the cluster. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders // CapacityProviders *[]*string `field:"required" json:"capacityProviders" yaml:"capacityProviders"` // The cluster the capacity provider association is the target of. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-cluster // Cluster *string `field:"required" json:"cluster" yaml:"cluster"` // The default capacity provider strategy to associate with the cluster. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-defaultcapacityproviderstrategy // DefaultCapacityProviderStrategy interface{} `field:"required" json:"defaultCapacityProviderStrategy" yaml:"defaultCapacityProviderStrategy"` }
Properties for defining a `CfnClusterCapacityProviderAssociations`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnClusterCapacityProviderAssociationsProps := &CfnClusterCapacityProviderAssociationsProps{ CapacityProviders: []*string{ jsii.String("capacityProviders"), }, Cluster: jsii.String("cluster"), DefaultCapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyProperty{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }, }, }
type CfnClusterCapacityProviderAssociations_CapacityProviderStrategyProperty ¶
type CfnClusterCapacityProviderAssociations_CapacityProviderStrategyProperty struct { // The short name of the capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-clustercapacityproviderassociations-capacityproviderstrategy.html#cfn-ecs-clustercapacityproviderassociations-capacityproviderstrategy-capacityprovider // CapacityProvider *string `field:"required" json:"capacityProvider" yaml:"capacityProvider"` // The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider. // // Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is specified, the default value of `0` is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-clustercapacityproviderassociations-capacityproviderstrategy.html#cfn-ecs-clustercapacityproviderassociations-capacityproviderstrategy-base // Base *float64 `field:"optional" json:"base" yaml:"base"` // The *weight* value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. // // The `weight` value is taken into consideration after the `base` value, if defined, is satisfied. // // If no `weight` value is specified, the default value of `0` is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of `0` will not be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of `0` , any `RunTask` or `CreateService` actions using the capacity provider strategy will fail. // // An example scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of `1` , then when the `base` is satisfied, the tasks will be split evenly across the two capacity providers. Using that same logic, if you specify a weight of `1` for *capacityProviderA* and a weight of `4` for *capacityProviderB* , then for every one task that is run using *capacityProviderA* , four tasks would use *capacityProviderB* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-clustercapacityproviderassociations-capacityproviderstrategy.html#cfn-ecs-clustercapacityproviderassociations-capacityproviderstrategy-weight // Weight *float64 `field:"optional" json:"weight" yaml:"weight"` }
The `CapacityProviderStrategy` property specifies the details of the default capacity provider strategy for the cluster.
When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" capacityProviderStrategyProperty := &CapacityProviderStrategyProperty{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }
type CfnClusterProps ¶
type CfnClusterProps struct { // The short name of one or more capacity providers to associate with the cluster. // // A capacity provider must be associated with a cluster before it can be included as part of the default capacity provider strategy of the cluster or used in a capacity provider strategy when calling the [CreateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html) or [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) actions. // // If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with another cluster. New Auto Scaling group capacity providers can be created with the [CreateCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) API operation. // // To use a AWS Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used. // // The [PutCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutCapacityProvider.html) API operation is used to update the list of available capacity providers for a cluster after the cluster is created. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders // CapacityProviders *[]*string `field:"optional" json:"capacityProviders" yaml:"capacityProviders"` // A user-generated string that you use to identify your cluster. // // If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-clustername // ClusterName *string `field:"optional" json:"clusterName" yaml:"clusterName"` // The settings to use when creating a cluster. // // This parameter is used to turn on CloudWatch Container Insights for a cluster. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-clustersettings // ClusterSettings interface{} `field:"optional" json:"clusterSettings" yaml:"clusterSettings"` // The execute command configuration for the cluster. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-configuration // Configuration interface{} `field:"optional" json:"configuration" yaml:"configuration"` // The default capacity provider strategy for the cluster. // // When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-defaultcapacityproviderstrategy // DefaultCapacityProviderStrategy interface{} `field:"optional" json:"defaultCapacityProviderStrategy" yaml:"defaultCapacityProviderStrategy"` // Use this parameter to set a default Service Connect namespace. // // After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the `enabled` parameter to `true` in the `ServiceConnectConfiguration` . You can set the namespace of each service individually in the `ServiceConnectConfiguration` to override this default parameter. // // Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-serviceconnectdefaults // ServiceConnectDefaults interface{} `field:"optional" json:"serviceConnectDefaults" yaml:"serviceConnectDefaults"` // The metadata that you apply to the cluster to help you categorize and organize them. // // Each tag consists of a key and an optional value. You define both. // // The following basic restrictions apply to tags: // // - Maximum number of tags per resource - 50 // - For each resource, each tag key must be unique, and each tag key can have only one value. // - Maximum key length - 128 Unicode characters in UTF-8 // - Maximum value length - 256 Unicode characters in UTF-8 // - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnCluster`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnClusterProps := &CfnClusterProps{ CapacityProviders: []*string{ jsii.String("capacityProviders"), }, ClusterName: jsii.String("clusterName"), ClusterSettings: []interface{}{ &ClusterSettingsProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, Configuration: &ClusterConfigurationProperty{ ExecuteCommandConfiguration: &ExecuteCommandConfigurationProperty{ KmsKeyId: jsii.String("kmsKeyId"), LogConfiguration: &ExecuteCommandLogConfigurationProperty{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"), S3BucketName: jsii.String("s3BucketName"), S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }, Logging: jsii.String("logging"), }, }, DefaultCapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }, }, ServiceConnectDefaults: &ServiceConnectDefaultsProperty{ Namespace: jsii.String("namespace"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html
type CfnCluster_CapacityProviderStrategyItemProperty ¶
type CfnCluster_CapacityProviderStrategyItemProperty struct { // The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider. // // Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is specified, the default value of `0` is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-capacityproviderstrategyitem.html#cfn-ecs-cluster-capacityproviderstrategyitem-base // Base *float64 `field:"optional" json:"base" yaml:"base"` // The short name of the capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-capacityproviderstrategyitem.html#cfn-ecs-cluster-capacityproviderstrategyitem-capacityprovider // CapacityProvider *string `field:"optional" json:"capacityProvider" yaml:"capacityProvider"` // The *weight* value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. // // The `weight` value is taken into consideration after the `base` value, if defined, is satisfied. // // If no `weight` value is specified, the default value of `0` is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of `0` can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of `0` , any `RunTask` or `CreateService` actions using the capacity provider strategy will fail. // // An example scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of `1` , then when the `base` is satisfied, the tasks will be split evenly across the two capacity providers. Using that same logic, if you specify a weight of `1` for *capacityProviderA* and a weight of `4` for *capacityProviderB* , then for every one task that's run using *capacityProviderA* , four tasks would use *capacityProviderB* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-capacityproviderstrategyitem.html#cfn-ecs-cluster-capacityproviderstrategyitem-weight // Weight *float64 `field:"optional" json:"weight" yaml:"weight"` }
The `CapacityProviderStrategyItem` property specifies the details of the default capacity provider strategy for the cluster.
When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" capacityProviderStrategyItemProperty := &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }
type CfnCluster_ClusterConfigurationProperty ¶
type CfnCluster_ClusterConfigurationProperty struct { // The details of the execute command configuration. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clusterconfiguration.html#cfn-ecs-cluster-clusterconfiguration-executecommandconfiguration // ExecuteCommandConfiguration interface{} `field:"optional" json:"executeCommandConfiguration" yaml:"executeCommandConfiguration"` }
The execute command configuration for the cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" clusterConfigurationProperty := &ClusterConfigurationProperty{ ExecuteCommandConfiguration: &ExecuteCommandConfigurationProperty{ KmsKeyId: jsii.String("kmsKeyId"), LogConfiguration: &ExecuteCommandLogConfigurationProperty{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"), S3BucketName: jsii.String("s3BucketName"), S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }, Logging: jsii.String("logging"), }, }
type CfnCluster_ClusterSettingsProperty ¶
type CfnCluster_ClusterSettingsProperty struct { // The name of the cluster setting. // // The value is `containerInsights` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clustersettings.html#cfn-ecs-cluster-clustersettings-name // Name *string `field:"optional" json:"name" yaml:"name"` // The value to set for the cluster setting. The supported values are `enabled` and `disabled` . // // If you set `name` to `containerInsights` and `value` to `enabled` , CloudWatch Container Insights will be on for the cluster, otherwise it will be off unless the `containerInsights` account setting is turned on. If a cluster value is specified, it will override the `containerInsights` value set with [PutAccountSetting](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or [PutAccountSettingDefault](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clustersettings.html#cfn-ecs-cluster-clustersettings-value // Value *string `field:"optional" json:"value" yaml:"value"` }
The settings to use when creating a cluster.
This parameter is used to turn on CloudWatch Container Insights for a cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" clusterSettingsProperty := &ClusterSettingsProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }
type CfnCluster_ExecuteCommandConfigurationProperty ¶
type CfnCluster_ExecuteCommandConfigurationProperty struct { // Specify an AWS Key Management Service key ID to encrypt the data between the local client and the container. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-kmskeyid // KmsKeyId *string `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // The log configuration for the results of the execute command actions. // // The logs can be sent to CloudWatch Logs or an Amazon S3 bucket. When `logging=OVERRIDE` is specified, a `logConfiguration` must be provided. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logconfiguration // LogConfiguration interface{} `field:"optional" json:"logConfiguration" yaml:"logConfiguration"` // The log setting to use for redirecting logs for your execute command results. The following log settings are available. // // - `NONE` : The execute command session is not logged. // - `DEFAULT` : The `awslogs` configuration in the task definition is used. If no logging parameter is specified, it defaults to this value. If no `awslogs` log driver is configured in the task definition, the output won't be logged. // - `OVERRIDE` : Specify the logging details as a part of `logConfiguration` . If the `OVERRIDE` logging option is specified, the `logConfiguration` is required. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logging // Logging *string `field:"optional" json:"logging" yaml:"logging"` }
The details of the execute command configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" executeCommandConfigurationProperty := &ExecuteCommandConfigurationProperty{ KmsKeyId: jsii.String("kmsKeyId"), LogConfiguration: &ExecuteCommandLogConfigurationProperty{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"), S3BucketName: jsii.String("s3BucketName"), S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }, Logging: jsii.String("logging"), }
type CfnCluster_ExecuteCommandLogConfigurationProperty ¶
type CfnCluster_ExecuteCommandLogConfigurationProperty struct { // Determines whether to use encryption on the CloudWatch logs. // // If not specified, encryption will be off. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-cloudwatchencryptionenabled // CloudWatchEncryptionEnabled interface{} `field:"optional" json:"cloudWatchEncryptionEnabled" yaml:"cloudWatchEncryptionEnabled"` // The name of the CloudWatch log group to send logs to. // // > The CloudWatch log group must already be created. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-cloudwatchloggroupname // CloudWatchLogGroupName *string `field:"optional" json:"cloudWatchLogGroupName" yaml:"cloudWatchLogGroupName"` // The name of the S3 bucket to send logs to. // // > The S3 bucket must already be created. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3bucketname // S3BucketName *string `field:"optional" json:"s3BucketName" yaml:"s3BucketName"` // Determines whether to use encryption on the S3 logs. // // If not specified, encryption is not used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3encryptionenabled // S3EncryptionEnabled interface{} `field:"optional" json:"s3EncryptionEnabled" yaml:"s3EncryptionEnabled"` // An optional folder in the S3 bucket to place logs in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3keyprefix // S3KeyPrefix *string `field:"optional" json:"s3KeyPrefix" yaml:"s3KeyPrefix"` }
The log configuration for the results of the execute command actions.
The logs can be sent to CloudWatch Logs or an Amazon S3 bucket.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" executeCommandLogConfigurationProperty := &ExecuteCommandLogConfigurationProperty{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"), S3BucketName: jsii.String("s3BucketName"), S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }
type CfnCluster_ServiceConnectDefaultsProperty ¶ added in v2.52.0
type CfnCluster_ServiceConnectDefaultsProperty struct { // The namespace name or full Amazon Resource Name (ARN) of the AWS Cloud Map namespace that's used when you create a service and don't specify a Service Connect configuration. // // The namespace name can include up to 1024 characters. The name is case-sensitive. The name can't include hyphens (-), tilde (~), greater than (>), less than (<), or slash (/). // // If you enter an existing namespace name or ARN, then that namespace will be used. Any namespace type is supported. The namespace must be in this account and this AWS Region. // // If you enter a new name, a AWS Cloud Map namespace will be created. Amazon ECS creates a AWS Cloud Map namespace with the "API calls" method of instance discovery only. This instance discovery method is the "HTTP" namespace type in the AWS Command Line Interface . Other types of instance discovery aren't used by Service Connect. // // If you update the cluster with an empty string `""` for the namespace name, the cluster configuration for Service Connect is removed. Note that the namespace will remain in AWS Cloud Map and must be deleted separately. // // For more information about AWS Cloud Map , see [Working with Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *AWS Cloud Map Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-serviceconnectdefaults.html#cfn-ecs-cluster-serviceconnectdefaults-namespace // Namespace *string `field:"optional" json:"namespace" yaml:"namespace"` }
Use this parameter to set a default Service Connect namespace.
After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the `enabled` parameter to `true` in the `ServiceConnectConfiguration` . You can set the namespace of each service individually in the `ServiceConnectConfiguration` to override this default parameter.
Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectDefaultsProperty := &ServiceConnectDefaultsProperty{ Namespace: jsii.String("namespace"), }
type CfnPrimaryTaskSet ¶
type CfnPrimaryTaskSet interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task set exists in. Cluster() *string SetCluster(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The short name or full Amazon Resource Name (ARN) of the service that the task set exists in. Service() *string SetService(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The short name or full Amazon Resource Name (ARN) of the task set to set as the primary task set in the deployment. TaskSetId() *string SetTaskSetId(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Modifies which task set in a service is the primary task set.
Any parameters that are updated on the primary task set in a service will transition to the service. This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPrimaryTaskSet := awscdk.Aws_ecs.NewCfnPrimaryTaskSet(this, jsii.String("MyCfnPrimaryTaskSet"), &CfnPrimaryTaskSetProps{ Cluster: jsii.String("cluster"), Service: jsii.String("service"), TaskSetId: jsii.String("taskSetId"), })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html
func NewCfnPrimaryTaskSet ¶
func NewCfnPrimaryTaskSet(scope constructs.Construct, id *string, props *CfnPrimaryTaskSetProps) CfnPrimaryTaskSet
type CfnPrimaryTaskSetProps ¶
type CfnPrimaryTaskSetProps struct { // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task set exists in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html#cfn-ecs-primarytaskset-cluster // Cluster *string `field:"required" json:"cluster" yaml:"cluster"` // The short name or full Amazon Resource Name (ARN) of the service that the task set exists in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html#cfn-ecs-primarytaskset-service // Service *string `field:"required" json:"service" yaml:"service"` // The short name or full Amazon Resource Name (ARN) of the task set to set as the primary task set in the deployment. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html#cfn-ecs-primarytaskset-tasksetid // TaskSetId *string `field:"required" json:"taskSetId" yaml:"taskSetId"` }
Properties for defining a `CfnPrimaryTaskSet`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPrimaryTaskSetProps := &CfnPrimaryTaskSetProps{ Cluster: jsii.String("cluster"), Service: jsii.String("service"), TaskSetId: jsii.String("taskSetId"), }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html
type CfnService ¶
type CfnService interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The name of the Amazon ECS service, such as `sample-webapp` . AttrName() *string // Not currently supported in AWS CloudFormation . AttrServiceArn() *string // The capacity provider strategy to use for the service. CapacityProviderStrategy() interface{} SetCapacityProviderStrategy(val interface{}) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. Cluster() *string SetCluster(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks. DeploymentConfiguration() interface{} SetDeploymentConfiguration(val interface{}) // The deployment controller to use for the service. DeploymentController() interface{} SetDeploymentController(val interface{}) // The number of instantiations of the specified task definition to place and keep running in your service. DesiredCount() *float64 SetDesiredCount(val *float64) // Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. EnableEcsManagedTags() interface{} SetEnableEcsManagedTags(val interface{}) // Determines whether the execute command functionality is turned on for the service. EnableExecuteCommand() interface{} SetEnableExecuteCommand(val interface{}) // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. HealthCheckGracePeriodSeconds() *float64 SetHealthCheckGracePeriodSeconds(val *float64) // The launch type on which to run your service. LaunchType() *string SetLaunchType(val *string) // A list of load balancer objects to associate with the service. LoadBalancers() interface{} SetLoadBalancers(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The network configuration for the service. NetworkConfiguration() interface{} SetNetworkConfiguration(val interface{}) // The tree node. Node() constructs.Node // An array of placement constraint objects to use for tasks in your service. PlacementConstraints() interface{} SetPlacementConstraints(val interface{}) // The placement strategy objects to use for tasks in your service. PlacementStrategies() interface{} SetPlacementStrategies(val interface{}) // The platform version that your tasks in the service are running on. PlatformVersion() *string SetPlatformVersion(val *string) // Specifies whether to propagate the tags from the task definition to the task. PropagateTags() *string SetPropagateTags(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. Role() *string SetRole(val *string) // The scheduling strategy to use for the service. // // For more information, see [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) . SchedulingStrategy() *string SetSchedulingStrategy(val *string) // The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. ServiceConnectConfiguration() interface{} SetServiceConnectConfiguration(val interface{}) // The name of your service. ServiceName() *string SetServiceName(val *string) // The details of the service discovery registry to associate with this service. // // For more information, see [Service discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) . ServiceRegistries() interface{} SetServiceRegistries(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The metadata that you apply to the service to help you categorize and organize them. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // The `family` and `revision` ( `family:revision` ) or full ARN of the task definition to run in your service. TaskDefinition() *string SetTaskDefinition(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // The configuration for a volume specified in the task definition as a volume that is configured at launch time. VolumeConfigurations() interface{} SetVolumeConfigurations(val interface{}) // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
The `AWS::ECS::Service` resource creates an Amazon Elastic Container Service (Amazon ECS) service that runs and maintains the requested number of tasks and associated load balancers.
> The stack update fails if you change any properties that require replacement and at least one Amazon ECS Service Connect `ServiceConnectService` is configured. This is because AWS CloudFormation creates the replacement service first, but each `ServiceConnectService` must have a name that is unique in the namespace. > Starting April 15, 2023, AWS ; will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS , or Amazon EC2 . However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnService := awscdk.Aws_ecs.NewCfnService(this, jsii.String("MyCfnService"), &CfnServiceProps{ CapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }, }, Cluster: jsii.String("cluster"), DeploymentConfiguration: &DeploymentConfigurationProperty{ Alarms: &DeploymentAlarmsProperty{ AlarmNames: []*string{ jsii.String("alarmNames"), }, Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, DeploymentCircuitBreaker: &DeploymentCircuitBreakerProperty{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, MaximumPercent: jsii.Number(123), MinimumHealthyPercent: jsii.Number(123), }, DeploymentController: &DeploymentControllerProperty{ Type: jsii.String("type"), }, DesiredCount: jsii.Number(123), EnableEcsManagedTags: jsii.Boolean(false), EnableExecuteCommand: jsii.Boolean(false), HealthCheckGracePeriodSeconds: jsii.Number(123), LaunchType: jsii.String("launchType"), LoadBalancers: []interface{}{ &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), LoadBalancerName: jsii.String("loadBalancerName"), TargetGroupArn: jsii.String("targetGroupArn"), }, }, NetworkConfiguration: &NetworkConfigurationProperty{ AwsvpcConfiguration: &AwsVpcConfigurationProperty{ AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, }, }, PlacementConstraints: []interface{}{ &PlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }, }, PlacementStrategies: []interface{}{ &PlacementStrategyProperty{ Type: jsii.String("type"), // the properties below are optional Field: jsii.String("field"), }, }, PlatformVersion: jsii.String("platformVersion"), PropagateTags: jsii.String("propagateTags"), Role: jsii.String("role"), SchedulingStrategy: jsii.String("schedulingStrategy"), ServiceConnectConfiguration: &ServiceConnectConfigurationProperty{ Enabled: jsii.Boolean(false), // the properties below are optional LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Namespace: jsii.String("namespace"), Services: []interface{}{ &ServiceConnectServiceProperty{ PortName: jsii.String("portName"), // the properties below are optional ClientAliases: []interface{}{ &ServiceConnectClientAliasProperty{ Port: jsii.Number(123), // the properties below are optional DnsName: jsii.String("dnsName"), }, }, DiscoveryName: jsii.String("discoveryName"), IngressPortOverride: jsii.Number(123), Timeout: &TimeoutConfigurationProperty{ IdleTimeoutSeconds: jsii.Number(123), PerRequestTimeoutSeconds: jsii.Number(123), }, Tls: &ServiceConnectTlsConfigurationProperty{ IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }, // the properties below are optional KmsKey: jsii.String("kmsKey"), RoleArn: jsii.String("roleArn"), }, }, }, }, ServiceName: jsii.String("serviceName"), ServiceRegistries: []interface{}{ &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TaskDefinition: jsii.String("taskDefinition"), VolumeConfigurations: []interface{}{ &ServiceVolumeConfigurationProperty{ Name: jsii.String("name"), // the properties below are optional ManagedEbsVolume: &ServiceManagedEBSVolumeConfigurationProperty{ RoleArn: jsii.String("roleArn"), // the properties below are optional Encrypted: jsii.Boolean(false), FilesystemType: jsii.String("filesystemType"), Iops: jsii.Number(123), KmsKeyId: jsii.String("kmsKeyId"), SizeInGiB: jsii.Number(123), SnapshotId: jsii.String("snapshotId"), TagSpecifications: []interface{}{ &EBSTagSpecificationProperty{ ResourceType: jsii.String("resourceType"), // the properties below are optional PropagateTags: jsii.String("propagateTags"), Tags: []*cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }, }, Throughput: jsii.Number(123), VolumeType: jsii.String("volumeType"), }, }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
func NewCfnService ¶
func NewCfnService(scope constructs.Construct, id *string, props *CfnServiceProps) CfnService
type CfnServiceProps ¶
type CfnServiceProps struct { // The capacity provider strategy to use for the service. // // If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or `launchType` is specified, the `defaultCapacityProviderStrategy` for the cluster is used. // // A capacity provider strategy may contain a maximum of 6 capacity providers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-capacityproviderstrategy // CapacityProviderStrategy interface{} `field:"optional" json:"capacityProviderStrategy" yaml:"capacityProviderStrategy"` // The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. // // If you do not specify a cluster, the default cluster is assumed. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-cluster // Cluster *string `field:"optional" json:"cluster" yaml:"cluster"` // Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-deploymentconfiguration // DeploymentConfiguration interface{} `field:"optional" json:"deploymentConfiguration" yaml:"deploymentConfiguration"` // The deployment controller to use for the service. // // If no deployment controller is specified, the default value of `ECS` is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-deploymentcontroller // DeploymentController interface{} `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The number of instantiations of the specified task definition to place and keep running in your service. // // For new services, if a desired count is not specified, a default value of `1` is used. When using the `DAEMON` scheduling strategy, the desired count is not required. // // For existing services, if a desired count is not specified, it is omitted from the operation. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-desiredcount // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. // // For more information, see [Tagging your Amazon ECS resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide* . // // When you use Amazon ECS managed tags, you need to set the `propagateTags` request parameter. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-enableecsmanagedtags // EnableEcsManagedTags interface{} `field:"optional" json:"enableEcsManagedTags" yaml:"enableEcsManagedTags"` // Determines whether the execute command functionality is turned on for the service. // // If `true` , the execute command functionality is turned on for all containers in tasks as part of the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-enableexecutecommand // EnableExecuteCommand interface{} `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // // This is only used when your service is configured to use a load balancer. If your service has a load balancer defined and you don't specify a health check grace period value, the default value of `0` is used. // // If you do not use an Elastic Load Balancing, we recommend that you use the `startPeriod` in the task definition health check parameters. For more information, see [Health check](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html) . // // If your service's tasks take a while to start and respond to Elastic Load Balancing health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-healthcheckgraceperiodseconds // HealthCheckGracePeriodSeconds *float64 `field:"optional" json:"healthCheckGracePeriodSeconds" yaml:"healthCheckGracePeriodSeconds"` // The launch type on which to run your service. // // For more information, see [Amazon ECS Launch Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-launchtype // LaunchType *string `field:"optional" json:"launchType" yaml:"launchType"` // A list of load balancer objects to associate with the service. // // If you specify the `Role` property, `LoadBalancers` must be specified as well. For information about the number of load balancers that you can specify per service, see [Service Load Balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-loadbalancers // LoadBalancers interface{} `field:"optional" json:"loadBalancers" yaml:"loadBalancers"` // The network configuration for the service. // // This parameter is required for task definitions that use the `awsvpc` network mode to receive their own elastic network interface, and it is not supported for other network modes. For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-networkconfiguration // NetworkConfiguration interface{} `field:"optional" json:"networkConfiguration" yaml:"networkConfiguration"` // An array of placement constraint objects to use for tasks in your service. // // You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-placementconstraints // PlacementConstraints interface{} `field:"optional" json:"placementConstraints" yaml:"placementConstraints"` // The placement strategy objects to use for tasks in your service. // // You can specify a maximum of 5 strategy rules for each service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-placementstrategies // PlacementStrategies interface{} `field:"optional" json:"placementStrategies" yaml:"placementStrategies"` // The platform version that your tasks in the service are running on. // // A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the `LATEST` platform version is used. For more information, see [AWS Fargate platform versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-platformversion // // Default: - "LATEST". // PlatformVersion *string `field:"optional" json:"platformVersion" yaml:"platformVersion"` // Specifies whether to propagate the tags from the task definition to the task. // // If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the [TagResource](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) API action. // // The default is `NONE` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-propagatetags // PropagateTags *string `field:"optional" json:"propagateTags" yaml:"propagateTags"` // The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. // // This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the `awsvpc` network mode. If you specify the `role` parameter, you must also specify a load balancer object with the `loadBalancers` parameter. // // > If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the `awsvpc` network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see [Using service-linked roles for Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide* . // // If your specified role has a path other than `/` , then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name `bar` has a path of `/foo/` then you would specify `/foo/bar` as the role name. For more information, see [Friendly names and paths](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in the *IAM User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-role // Role *string `field:"optional" json:"role" yaml:"role"` // The scheduling strategy to use for the service. For more information, see [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) . // // There are two service scheduler strategies available: // // - `REPLICA` -The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the `CODE_DEPLOY` or `EXTERNAL` deployment controller types. // - `DAEMON` -The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies. // // > Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-schedulingstrategy // SchedulingStrategy *string `field:"optional" json:"schedulingStrategy" yaml:"schedulingStrategy"` // The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. // // Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-serviceconnectconfiguration // ServiceConnectConfiguration interface{} `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of your service. // // Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions. // // > The stack update fails if you change any properties that require replacement and the `ServiceName` is configured. This is because AWS CloudFormation creates the replacement service first, but each `ServiceName` must be unique in the cluster. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-servicename // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // The details of the service discovery registry to associate with this service. For more information, see [Service discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) . // // > Each service may be associated with one service registry. Multiple service registries for each service isn't supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-serviceregistries // ServiceRegistries interface{} `field:"optional" json:"serviceRegistries" yaml:"serviceRegistries"` // The metadata that you apply to the service to help you categorize and organize them. // // Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well. // // The following basic restrictions apply to tags: // // - Maximum number of tags per resource - 50 // - For each resource, each tag key must be unique, and each tag key can have only one value. // - Maximum key length - 128 Unicode characters in UTF-8 // - Maximum value length - 256 Unicode characters in UTF-8 // - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // The `family` and `revision` ( `family:revision` ) or full ARN of the task definition to run in your service. // // If a `revision` isn't specified, the latest `ACTIVE` revision is used. // // A task definition must be specified if the service uses either the `ECS` or `CODE_DEPLOY` deployment controllers. // // For more information about deployment types, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-taskdefinition // TaskDefinition *string `field:"optional" json:"taskDefinition" yaml:"taskDefinition"` // The configuration for a volume specified in the task definition as a volume that is configured at launch time. // // Currently, the only supported volume type is an Amazon EBS volume. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-volumeconfigurations // VolumeConfigurations interface{} `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` }
Properties for defining a `CfnService`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnServiceProps := &CfnServiceProps{ CapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }, }, Cluster: jsii.String("cluster"), DeploymentConfiguration: &DeploymentConfigurationProperty{ Alarms: &DeploymentAlarmsProperty{ AlarmNames: []*string{ jsii.String("alarmNames"), }, Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, DeploymentCircuitBreaker: &DeploymentCircuitBreakerProperty{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, MaximumPercent: jsii.Number(123), MinimumHealthyPercent: jsii.Number(123), }, DeploymentController: &DeploymentControllerProperty{ Type: jsii.String("type"), }, DesiredCount: jsii.Number(123), EnableEcsManagedTags: jsii.Boolean(false), EnableExecuteCommand: jsii.Boolean(false), HealthCheckGracePeriodSeconds: jsii.Number(123), LaunchType: jsii.String("launchType"), LoadBalancers: []interface{}{ &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), LoadBalancerName: jsii.String("loadBalancerName"), TargetGroupArn: jsii.String("targetGroupArn"), }, }, NetworkConfiguration: &NetworkConfigurationProperty{ AwsvpcConfiguration: &AwsVpcConfigurationProperty{ AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, }, }, PlacementConstraints: []interface{}{ &PlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }, }, PlacementStrategies: []interface{}{ &PlacementStrategyProperty{ Type: jsii.String("type"), // the properties below are optional Field: jsii.String("field"), }, }, PlatformVersion: jsii.String("platformVersion"), PropagateTags: jsii.String("propagateTags"), Role: jsii.String("role"), SchedulingStrategy: jsii.String("schedulingStrategy"), ServiceConnectConfiguration: &ServiceConnectConfigurationProperty{ Enabled: jsii.Boolean(false), // the properties below are optional LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Namespace: jsii.String("namespace"), Services: []interface{}{ &ServiceConnectServiceProperty{ PortName: jsii.String("portName"), // the properties below are optional ClientAliases: []interface{}{ &ServiceConnectClientAliasProperty{ Port: jsii.Number(123), // the properties below are optional DnsName: jsii.String("dnsName"), }, }, DiscoveryName: jsii.String("discoveryName"), IngressPortOverride: jsii.Number(123), Timeout: &TimeoutConfigurationProperty{ IdleTimeoutSeconds: jsii.Number(123), PerRequestTimeoutSeconds: jsii.Number(123), }, Tls: &ServiceConnectTlsConfigurationProperty{ IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }, // the properties below are optional KmsKey: jsii.String("kmsKey"), RoleArn: jsii.String("roleArn"), }, }, }, }, ServiceName: jsii.String("serviceName"), ServiceRegistries: []interface{}{ &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TaskDefinition: jsii.String("taskDefinition"), VolumeConfigurations: []interface{}{ &ServiceVolumeConfigurationProperty{ Name: jsii.String("name"), // the properties below are optional ManagedEbsVolume: &ServiceManagedEBSVolumeConfigurationProperty{ RoleArn: jsii.String("roleArn"), // the properties below are optional Encrypted: jsii.Boolean(false), FilesystemType: jsii.String("filesystemType"), Iops: jsii.Number(123), KmsKeyId: jsii.String("kmsKeyId"), SizeInGiB: jsii.Number(123), SnapshotId: jsii.String("snapshotId"), TagSpecifications: []interface{}{ &EBSTagSpecificationProperty{ ResourceType: jsii.String("resourceType"), // the properties below are optional PropagateTags: jsii.String("propagateTags"), Tags: []*cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }, }, Throughput: jsii.Number(123), VolumeType: jsii.String("volumeType"), }, }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
type CfnService_AwsVpcConfigurationProperty ¶
type CfnService_AwsVpcConfigurationProperty struct { // Whether the task's elastic network interface receives a public IP address. // // The default value is `DISABLED` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-assignpublicip // AssignPublicIp *string `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"` // The IDs of the security groups associated with the task or service. // // If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified per `AwsVpcConfiguration` . // // > All specified security groups must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-securitygroups // SecurityGroups *[]*string `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The IDs of the subnets associated with the task or service. // // There's a limit of 16 subnets that can be specified per `AwsVpcConfiguration` . // // > All specified subnets must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-subnets // Subnets *[]*string `field:"optional" json:"subnets" yaml:"subnets"` }
An object representing the networking details for a task or service.
For example `awsvpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]}`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" awsVpcConfigurationProperty := &AwsVpcConfigurationProperty{ AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, }
type CfnService_CapacityProviderStrategyItemProperty ¶
type CfnService_CapacityProviderStrategyItemProperty struct { // The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider. // // Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is specified, the default value of `0` is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-capacityproviderstrategyitem.html#cfn-ecs-service-capacityproviderstrategyitem-base // Base *float64 `field:"optional" json:"base" yaml:"base"` // The short name of the capacity provider. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-capacityproviderstrategyitem.html#cfn-ecs-service-capacityproviderstrategyitem-capacityprovider // CapacityProvider *string `field:"optional" json:"capacityProvider" yaml:"capacityProvider"` // The *weight* value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. // // The `weight` value is taken into consideration after the `base` value, if defined, is satisfied. // // If no `weight` value is specified, the default value of `0` is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of `0` can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of `0` , any `RunTask` or `CreateService` actions using the capacity provider strategy will fail. // // An example scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of `1` , then when the `base` is satisfied, the tasks will be split evenly across the two capacity providers. Using that same logic, if you specify a weight of `1` for *capacityProviderA* and a weight of `4` for *capacityProviderB* , then for every one task that's run using *capacityProviderA* , four tasks would use *capacityProviderB* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-capacityproviderstrategyitem.html#cfn-ecs-service-capacityproviderstrategyitem-weight // Weight *float64 `field:"optional" json:"weight" yaml:"weight"` }
The details of a capacity provider strategy.
A capacity provider strategy can be set when using the `RunTask` or `CreateService` APIs or as the default capacity provider strategy for a cluster with the `CreateCluster` API.
Only capacity providers that are already associated with a cluster and have an `ACTIVE` or `UPDATING` status can be used in a capacity provider strategy. The `PutClusterCapacityProviders` API is used to associate a capacity provider with a cluster.
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New Auto Scaling group capacity providers can be created with the `CreateCapacityProvider` API operation.
To use an AWS Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used in a capacity provider strategy.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" capacityProviderStrategyItemProperty := &CapacityProviderStrategyItemProperty{ Base: jsii.Number(123), CapacityProvider: jsii.String("capacityProvider"), Weight: jsii.Number(123), }
type CfnService_DeploymentAlarmsProperty ¶ added in v2.56.0
type CfnService_DeploymentAlarmsProperty struct { // One or more CloudWatch alarm names. // // Use a "," to separate the alarms. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentalarms.html#cfn-ecs-service-deploymentalarms-alarmnames // AlarmNames *[]*string `field:"required" json:"alarmNames" yaml:"alarmNames"` // Determines whether to use the CloudWatch alarm option in the service deployment process. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentalarms.html#cfn-ecs-service-deploymentalarms-enable // Enable interface{} `field:"required" json:"enable" yaml:"enable"` // Determines whether to configure Amazon ECS to roll back the service if a service deployment fails. // // If rollback is used, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentalarms.html#cfn-ecs-service-deploymentalarms-rollback // Rollback interface{} `field:"required" json:"rollback" yaml:"rollback"` }
One of the methods which provide a way for you to quickly identify when a deployment has failed, and then to optionally roll back the failure to the last working deployment.
When the alarms are generated, Amazon ECS sets the service deployment to failed. Set the rollback parameter to have Amazon ECS to roll back your service to the last completed deployment after a failure.
You can only use the `DeploymentAlarms` method to detect failures when the `DeploymentController` is set to `ECS` (rolling update).
For more information, see [Rolling update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the **Amazon Elastic Container Service Developer Guide** .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deploymentAlarmsProperty := &DeploymentAlarmsProperty{ AlarmNames: []*string{ jsii.String("alarmNames"), }, Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }
type CfnService_DeploymentCircuitBreakerProperty ¶
type CfnService_DeploymentCircuitBreakerProperty struct { // Determines whether to use the deployment circuit breaker logic for the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcircuitbreaker.html#cfn-ecs-service-deploymentcircuitbreaker-enable // Enable interface{} `field:"required" json:"enable" yaml:"enable"` // Determines whether to configure Amazon ECS to roll back the service if a service deployment fails. // // If rollback is on, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcircuitbreaker.html#cfn-ecs-service-deploymentcircuitbreaker-rollback // Rollback interface{} `field:"required" json:"rollback" yaml:"rollback"` }
> The deployment circuit breaker can only be used for services using the rolling update ( `ECS` ) deployment type.
The *deployment circuit breaker* determines whether a service deployment will fail if the service can't reach a steady state. If it is turned on, a service deployment will transition to a failed state and stop launching new tasks. You can also configure Amazon ECS to roll back your service to the last completed deployment after a failure. For more information, see [Rolling update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon Elastic Container Service Developer Guide* .
For more information about API failure reasons, see [API failure reasons](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deploymentCircuitBreakerProperty := &DeploymentCircuitBreakerProperty{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }
type CfnService_DeploymentConfigurationProperty ¶
type CfnService_DeploymentConfigurationProperty struct { // Information about the CloudWatch alarms. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-alarms // Alarms interface{} `field:"optional" json:"alarms" yaml:"alarms"` // > The deployment circuit breaker can only be used for services using the rolling update ( `ECS` ) deployment type. // // The *deployment circuit breaker* determines whether a service deployment will fail if the service can't reach a steady state. If you use the deployment circuit breaker, a service deployment will transition to a failed state and stop launching new tasks. If you use the rollback option, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. For more information, see [Rolling update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon Elastic Container Service Developer Guide* // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-deploymentcircuitbreaker // DeploymentCircuitBreaker interface{} `field:"optional" json:"deploymentCircuitBreaker" yaml:"deploymentCircuitBreaker"` // If a service is using the rolling update ( `ECS` ) deployment type, the `maximumPercent` parameter represents an upper limit on the number of your service's tasks that are allowed in the `RUNNING` or `PENDING` state during a deployment, as a percentage of the `desiredCount` (rounded down to the nearest integer). // // This parameter enables you to define the deployment batch size. For example, if your service is using the `REPLICA` service scheduler and has a `desiredCount` of four tasks and a `maximumPercent` value of 200%, the scheduler may start four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default `maximumPercent` value for a service using the `REPLICA` service scheduler is 200%. // // If a service is using either the blue/green ( `CODE_DEPLOY` ) or `EXTERNAL` deployment types and tasks that use the EC2 launch type, the *maximum percent* value is set to the default value and is used to define the upper limit on the number of the tasks in the service that remain in the `RUNNING` state while the container instances are in the `DRAINING` state. If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-maximumpercent // MaximumPercent *float64 `field:"optional" json:"maximumPercent" yaml:"maximumPercent"` // If a service is using the rolling update ( `ECS` ) deployment type, the `minimumHealthyPercent` represents a lower limit on the number of your service's tasks that must remain in the `RUNNING` state during a deployment, as a percentage of the `desiredCount` (rounded up to the nearest integer). // // This parameter enables you to deploy without using additional cluster capacity. For example, if your service has a `desiredCount` of four tasks and a `minimumHealthyPercent` of 50%, the service scheduler may stop two existing tasks to free up cluster capacity before starting two new tasks. // // For services that *do not* use a load balancer, the following should be noted: // // - A service is considered healthy if all essential containers within the tasks in the service pass their health checks. // - If a task has no essential containers with a health check defined, the service scheduler will wait for 40 seconds after a task reaches a `RUNNING` state before the task is counted towards the minimum healthy percent total. // - If a task has one or more essential containers with a health check defined, the service scheduler will wait for the task to reach a healthy status before counting it towards the minimum healthy percent total. A task is considered healthy when all essential containers within the task have passed their health checks. The amount of time the service scheduler can wait for is determined by the container health check settings. // // For services that *do* use a load balancer, the following should be noted: // // - If a task has no essential containers with a health check defined, the service scheduler will wait for the load balancer target group health check to return a healthy status before counting the task towards the minimum healthy percent total. // - If a task has an essential container with a health check defined, the service scheduler will wait for both the task to reach a healthy status and the load balancer target group health check to return a healthy status before counting the task towards the minimum healthy percent total. // // If a service is using either the blue/green ( `CODE_DEPLOY` ) or `EXTERNAL` deployment types and is running tasks that use the EC2 launch type, the *minimum healthy percent* value is set to the default value and is used to define the lower limit on the number of the tasks in the service that remain in the `RUNNING` state while the container instances are in the `DRAINING` state. If a service is using either the blue/green ( `CODE_DEPLOY` ) or `EXTERNAL` deployment types and is running tasks that use the Fargate launch type, the minimum healthy percent value is not used, although it is returned when describing your service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-minimumhealthypercent // MinimumHealthyPercent *float64 `field:"optional" json:"minimumHealthyPercent" yaml:"minimumHealthyPercent"` }
The `DeploymentConfiguration` property specifies optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deploymentConfigurationProperty := &DeploymentConfigurationProperty{ Alarms: &DeploymentAlarmsProperty{ AlarmNames: []*string{ jsii.String("alarmNames"), }, Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, DeploymentCircuitBreaker: &DeploymentCircuitBreakerProperty{ Enable: jsii.Boolean(false), Rollback: jsii.Boolean(false), }, MaximumPercent: jsii.Number(123), MinimumHealthyPercent: jsii.Number(123), }
type CfnService_DeploymentControllerProperty ¶
type CfnService_DeploymentControllerProperty struct { // The deployment controller type to use. There are three deployment controller types available:. // // - **ECS** - The rolling update ( `ECS` ) deployment type involves replacing the current running version of the container with the latest version. The number of containers Amazon ECS adds or removes from the service during a rolling update is controlled by adjusting the minimum and maximum number of healthy tasks allowed during a service deployment, as specified in the [DeploymentConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html) . // - **CODE_DEPLOY** - The blue/green ( `CODE_DEPLOY` ) deployment type uses the blue/green deployment model powered by AWS CodeDeploy , which allows you to verify a new deployment of a service before sending production traffic to it. // - **EXTERNAL** - The external ( `EXTERNAL` ) deployment type enables you to use any third-party deployment controller for full control over the deployment process for an Amazon ECS service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcontroller.html#cfn-ecs-service-deploymentcontroller-type // Type *string `field:"optional" json:"type" yaml:"type"` }
The deployment controller to use for the service.
For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deploymentControllerProperty := &DeploymentControllerProperty{ Type: jsii.String("type"), }
type CfnService_EBSTagSpecificationProperty ¶ added in v2.117.0
type CfnService_EBSTagSpecificationProperty struct { // The type of volume resource. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-ebstagspecification.html#cfn-ecs-service-ebstagspecification-resourcetype // ResourceType *string `field:"required" json:"resourceType" yaml:"resourceType"` // Determines whether to propagate the tags from the task definition to the Amazon EBS volume. // // Tags can only propagate to a `SERVICE` specified in `ServiceVolumeConfiguration` . If no value is specified, the tags aren't propagated. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-ebstagspecification.html#cfn-ecs-service-ebstagspecification-propagatetags // PropagateTags *string `field:"optional" json:"propagateTags" yaml:"propagateTags"` // The tags applied to this Amazon EBS volume. // // `AmazonECSCreated` and `AmazonECSManaged` are reserved tags that can't be used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-ebstagspecification.html#cfn-ecs-service-ebstagspecification-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
The tag specifications of an Amazon EBS volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" eBSTagSpecificationProperty := &EBSTagSpecificationProperty{ ResourceType: jsii.String("resourceType"), // the properties below are optional PropagateTags: jsii.String("propagateTags"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
type CfnService_LoadBalancerProperty ¶
type CfnService_LoadBalancerProperty struct { // The name of the container (as it appears in a container definition) to associate with the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-containername // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The port on the container to associate with the load balancer. // // This port must correspond to a `containerPort` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the `hostPort` of the port mapping. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-containerport // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The name of the load balancer to associate with the Amazon ECS service or task set. // // If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-loadbalancername // LoadBalancerName *string `field:"optional" json:"loadBalancerName" yaml:"loadBalancerName"` // The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set. // // A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer. // // For services using the `ECS` deployment controller, you can specify one or multiple target groups. For more information, see [Registering multiple target groups with a service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the *Amazon Elastic Container Service Developer Guide* . // // For services using the `CODE_DEPLOY` deployment controller, you're required to define two target groups for the load balancer. For more information, see [Blue/green deployment with CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the *Amazon Elastic Container Service Developer Guide* . // // > If your service's task definition uses the `awsvpc` network mode, you must choose `ip` as the target type, not `instance` . Do this when creating your target groups because tasks that use the `awsvpc` network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-targetgrouparn // TargetGroupArn *string `field:"optional" json:"targetGroupArn" yaml:"targetGroupArn"` }
The `LoadBalancer` property specifies details on a load balancer that is used with a service.
If the service is using the `CODE_DEPLOY` deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When you are creating an AWS CodeDeploy deployment group, you specify two target groups (referred to as a `targetGroupPair` ). Each target group binds to a separate task set in the deployment. The load balancer can also have up to two listeners, a required listener for production traffic and an optional listener that allows you to test new revisions of the service before routing production traffic to it.
Services with tasks that use the `awsvpc` network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also, when you create any target groups for these services, you must choose `ip` as the target type, not `instance` . Tasks that use the `awsvpc` network mode are associated with an elastic network interface, not an Amazon EC2 instance.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" loadBalancerProperty := &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), LoadBalancerName: jsii.String("loadBalancerName"), TargetGroupArn: jsii.String("targetGroupArn"), }
type CfnService_LogConfigurationProperty ¶ added in v2.52.0
type CfnService_LogConfigurationProperty struct { // The log driver to use for the container. // // For tasks on AWS Fargate , the supported log drivers are `awslogs` , `splunk` , and `awsfirelens` . // // For tasks hosted on Amazon EC2 instances, the supported log drivers are `awslogs` , `fluentd` , `gelf` , `json-file` , `journald` , `logentries` , `syslog` , `splunk` , and `awsfirelens` . // // For more information about using the `awslogs` log driver, see [Using the awslogs log driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic Container Service Developer Guide* . // // For more information about using the `awsfirelens` log driver, see [Custom log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic Container Service Developer Guide* . // // > If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-logconfiguration.html#cfn-ecs-service-logconfiguration-logdriver // LogDriver *string `field:"optional" json:"logDriver" yaml:"logDriver"` // The configuration options to send to the log driver. // // This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-logconfiguration.html#cfn-ecs-service-logconfiguration-options // Options interface{} `field:"optional" json:"options" yaml:"options"` // The secrets to pass to the log configuration. // // For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-logconfiguration.html#cfn-ecs-service-logconfiguration-secretoptions // SecretOptions interface{} `field:"optional" json:"secretOptions" yaml:"secretOptions"` }
The log configuration for the container.
This parameter maps to `LogConfig` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--log-driver` option to [`docker run`](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/) .
By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For more information about the options for different supported log drivers, see [Configure logging drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker documentation.
Understand the following when specifying a log configuration for your containers.
- Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be available in future releases of the Amazon ECS container agent.
For tasks on AWS Fargate , the supported log drivers are `awslogs` , `splunk` , and `awsfirelens` .
For tasks hosted on Amazon EC2 instances, the supported log drivers are `awslogs` , `fluentd` , `gelf` , `json-file` , `journald` , `logentries` , `syslog` , `splunk` , and `awsfirelens` . - This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. - For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must register the available logging drivers with the `ECS_AVAILABLE_LOGGING_DRIVERS` environment variable before containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide* . - For tasks that are on AWS Fargate , because you don't have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to send Gelf logs to.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" logConfigurationProperty := &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }
type CfnService_NetworkConfigurationProperty ¶
type CfnService_NetworkConfigurationProperty struct { // The VPC subnets and security groups that are associated with a task. // // > All specified subnets and security groups must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-networkconfiguration.html#cfn-ecs-service-networkconfiguration-awsvpcconfiguration // AwsvpcConfiguration interface{} `field:"optional" json:"awsvpcConfiguration" yaml:"awsvpcConfiguration"` }
The `NetworkConfiguration` property specifies an object representing the network configuration for a task or service.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" networkConfigurationProperty := &NetworkConfigurationProperty{ AwsvpcConfiguration: &AwsVpcConfigurationProperty{ AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, }, }
type CfnService_PlacementConstraintProperty ¶
type CfnService_PlacementConstraintProperty struct { // The type of constraint. // // Use `distinctInstance` to ensure that each task in a particular group is running on a different container instance. Use `memberOf` to restrict the selection to a group of valid candidates. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementconstraint.html#cfn-ecs-service-placementconstraint-type // Type *string `field:"required" json:"type" yaml:"type"` // A cluster query language expression to apply to the constraint. // // The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is `distinctInstance` . For more information, see [Cluster query language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementconstraint.html#cfn-ecs-service-placementconstraint-expression // Expression *string `field:"optional" json:"expression" yaml:"expression"` }
The `PlacementConstraint` property specifies an object representing a constraint on task placement in the task definition.
For more information, see [Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" placementConstraintProperty := &PlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }
type CfnService_PlacementStrategyProperty ¶
type CfnService_PlacementStrategyProperty struct { // The type of placement strategy. // // The `random` placement strategy randomly places tasks on available candidates. The `spread` placement strategy spreads placement across available candidates evenly based on the `field` parameter. The `binpack` strategy places tasks on available candidates that have the least available amount of the resource that's specified with the `field` parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory but still enough to run the task. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementstrategy.html#cfn-ecs-service-placementstrategy-type // Type *string `field:"required" json:"type" yaml:"type"` // The field to apply the placement strategy against. // // For the `spread` placement strategy, valid values are `instanceId` (or `host` , which has the same effect), or any platform or custom attribute that is applied to a container instance, such as `attribute:ecs.availability-zone` . For the `binpack` placement strategy, valid values are `CPU` and `MEMORY` . For the `random` placement strategy, this field is not used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementstrategy.html#cfn-ecs-service-placementstrategy-field // Field *string `field:"optional" json:"field" yaml:"field"` }
The `PlacementStrategy` property specifies the task placement strategy for a task or service.
For more information, see [Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" placementStrategyProperty := &PlacementStrategyProperty{ Type: jsii.String("type"), // the properties below are optional Field: jsii.String("field"), }
type CfnService_SecretProperty ¶ added in v2.52.0
type CfnService_SecretProperty struct { // The name of the secret. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-secret.html#cfn-ecs-service-secret-name // Name *string `field:"required" json:"name" yaml:"name"` // The secret to expose to the container. // // The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. // // For information about the require AWS Identity and Access Management permissions, see [Required IAM permissions for Amazon ECS secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-iam) (for Secrets Manager) or [Required IAM permissions for Amazon ECS secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html) (for Systems Manager Parameter store) in the *Amazon Elastic Container Service Developer Guide* . // // > If the SSM Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-secret.html#cfn-ecs-service-secret-valuefrom // ValueFrom *string `field:"required" json:"valueFrom" yaml:"valueFrom"` }
An object representing the secret to expose to your container.
Secrets can be exposed to a container in the following ways:
- To inject sensitive data into your containers as environment variables, use the `secrets` container definition parameter. - To reference sensitive information in the log configuration of a container, use the `secretOptions` container definition parameter.
For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" secretProperty := &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-secret.html
type CfnService_ServiceConnectClientAliasProperty ¶ added in v2.52.0
type CfnService_ServiceConnectClientAliasProperty struct { // The listening port number for the Service Connect proxy. // // This port is available inside of all of the tasks within the same namespace. // // To avoid changing your applications in client Amazon ECS services, set this to the same port that the client application uses by default. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectclientalias.html#cfn-ecs-service-serviceconnectclientalias-port // Port *float64 `field:"required" json:"port" yaml:"port"` // The `dnsName` is the name that you use in the applications of client tasks to connect to this service. // // The name must be a valid DNS name but doesn't need to be fully-qualified. The name can include up to 127 characters. The name can include lowercase letters, numbers, underscores (_), hyphens (-), and periods (.). The name can't start with a hyphen. // // If this parameter isn't specified, the default value of `discoveryName.namespace` is used. If the `discoveryName` isn't specified, the port mapping name from the task definition is used in `portName.namespace` . // // To avoid changing your applications in client Amazon ECS services, set this to the same name that the client application uses by default. For example, a few common names are `database` , `db` , or the lowercase name of a database, such as `mysql` or `redis` . For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectclientalias.html#cfn-ecs-service-serviceconnectclientalias-dnsname // DnsName *string `field:"optional" json:"dnsName" yaml:"dnsName"` }
Each alias ("endpoint") is a fully-qualified name and port number that other tasks ("clients") can use to connect to this service.
Each name and port mapping must be unique within the namespace.
Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectClientAliasProperty := &ServiceConnectClientAliasProperty{ Port: jsii.Number(123), // the properties below are optional DnsName: jsii.String("dnsName"), }
type CfnService_ServiceConnectConfigurationProperty ¶ added in v2.52.0
type CfnService_ServiceConnectConfigurationProperty struct { // Specifies whether to use Service Connect with this service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectconfiguration.html#cfn-ecs-service-serviceconnectconfiguration-enabled // Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"` // The log configuration for the container. // // This parameter maps to `LogConfig` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--log-driver` option to [`docker run`](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/) . // // By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For more information about the options for different supported log drivers, see [Configure logging drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker documentation. // // Understand the following when specifying a log configuration for your containers. // // - Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be available in future releases of the Amazon ECS container agent. // // For tasks on AWS Fargate , the supported log drivers are `awslogs` , `splunk` , and `awsfirelens` . // // For tasks hosted on Amazon EC2 instances, the supported log drivers are `awslogs` , `fluentd` , `gelf` , `json-file` , `journald` , `logentries` , `syslog` , `splunk` , and `awsfirelens` . // - This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. // - For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must register the available logging drivers with the `ECS_AVAILABLE_LOGGING_DRIVERS` environment variable before containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide* . // - For tasks that are on AWS Fargate , because you don't have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to send Gelf logs to. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectconfiguration.html#cfn-ecs-service-serviceconnectconfiguration-logconfiguration // LogConfiguration interface{} `field:"optional" json:"logConfiguration" yaml:"logConfiguration"` // The namespace name or full Amazon Resource Name (ARN) of the AWS Cloud Map namespace for use with Service Connect. // // The namespace must be in the same AWS Region as the Amazon ECS service and cluster. The type of namespace doesn't affect Service Connect. For more information about AWS Cloud Map , see [Working with Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *AWS Cloud Map Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectconfiguration.html#cfn-ecs-service-serviceconnectconfiguration-namespace // Namespace *string `field:"optional" json:"namespace" yaml:"namespace"` // The list of Service Connect service objects. // // These are names and aliases (also known as endpoints) that are used by other Amazon ECS services to connect to this service. // // This field is not required for a "client" Amazon ECS service that's a member of a namespace only to connect to other services within the namespace. An example of this would be a frontend application that accepts incoming requests from either a load balancer that's attached to the service or by other means. // // An object selects a port from the task definition, assigns a name for the AWS Cloud Map service, and a list of aliases (endpoints) and ports for client applications to refer to this service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectconfiguration.html#cfn-ecs-service-serviceconnectconfiguration-services // Services interface{} `field:"optional" json:"services" yaml:"services"` }
The Service Connect configuration of your Amazon ECS service.
The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.
Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectConfigurationProperty := &ServiceConnectConfigurationProperty{ Enabled: jsii.Boolean(false), // the properties below are optional LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Namespace: jsii.String("namespace"), Services: []interface{}{ &ServiceConnectServiceProperty{ PortName: jsii.String("portName"), // the properties below are optional ClientAliases: []interface{}{ &ServiceConnectClientAliasProperty{ Port: jsii.Number(123), // the properties below are optional DnsName: jsii.String("dnsName"), }, }, DiscoveryName: jsii.String("discoveryName"), IngressPortOverride: jsii.Number(123), Timeout: &TimeoutConfigurationProperty{ IdleTimeoutSeconds: jsii.Number(123), PerRequestTimeoutSeconds: jsii.Number(123), }, Tls: &ServiceConnectTlsConfigurationProperty{ IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }, // the properties below are optional KmsKey: jsii.String("kmsKey"), RoleArn: jsii.String("roleArn"), }, }, }, }
type CfnService_ServiceConnectServiceProperty ¶ added in v2.52.0
type CfnService_ServiceConnectServiceProperty struct { // The `portName` must match the name of one of the `portMappings` from all the containers in the task definition of this Amazon ECS service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-portname // PortName *string `field:"required" json:"portName" yaml:"portName"` // The list of client aliases for this Service Connect service. // // You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1. // // Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service. // // Each name and port mapping must be unique within the namespace. // // For each `ServiceConnectService` , you must provide at least one `clientAlias` with one `port` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-clientaliases // ClientAliases interface{} `field:"optional" json:"clientAliases" yaml:"clientAliases"` // The `discoveryName` is the name of the new AWS Cloud Map service that Amazon ECS creates for this Amazon ECS service. // // This must be unique within the AWS Cloud Map namespace. The name can contain up to 64 characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen. // // If the `discoveryName` isn't specified, the port mapping name from the task definition is used in `portName.namespace` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-discoveryname // DiscoveryName *string `field:"optional" json:"discoveryName" yaml:"discoveryName"` // The port number for the Service Connect proxy to listen on. // // Use the value of this field to bypass the proxy for traffic on the port number specified in the named `portMapping` in the task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy for this Amazon ECS service. // // In `awsvpc` mode and Fargate, the default value is the container port number. The container port number is in the `portMapping` in the task definition. In bridge mode, the default value is the ephemeral port of the Service Connect proxy. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-ingressportoverride // IngressPortOverride *float64 `field:"optional" json:"ingressPortOverride" yaml:"ingressPortOverride"` // A reference to an object that represents the configured timeouts for Service Connect. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-timeout // Timeout interface{} `field:"optional" json:"timeout" yaml:"timeout"` // A reference to an object that represents a Transport Layer Security (TLS) configuration. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectservice.html#cfn-ecs-service-serviceconnectservice-tls // Tls interface{} `field:"optional" json:"tls" yaml:"tls"` }
The Service Connect service object configuration.
For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectServiceProperty := &ServiceConnectServiceProperty{ PortName: jsii.String("portName"), // the properties below are optional ClientAliases: []interface{}{ &ServiceConnectClientAliasProperty{ Port: jsii.Number(123), // the properties below are optional DnsName: jsii.String("dnsName"), }, }, DiscoveryName: jsii.String("discoveryName"), IngressPortOverride: jsii.Number(123), Timeout: &TimeoutConfigurationProperty{ IdleTimeoutSeconds: jsii.Number(123), PerRequestTimeoutSeconds: jsii.Number(123), }, Tls: &ServiceConnectTlsConfigurationProperty{ IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }, // the properties below are optional KmsKey: jsii.String("kmsKey"), RoleArn: jsii.String("roleArn"), }, }
type CfnService_ServiceConnectTlsCertificateAuthorityProperty ¶ added in v2.123.0
type CfnService_ServiceConnectTlsCertificateAuthorityProperty struct { // The ARN of the AWS Private Certificate Authority certificate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttlscertificateauthority.html#cfn-ecs-service-serviceconnecttlscertificateauthority-awspcaauthorityarn // AwsPcaAuthorityArn *string `field:"optional" json:"awsPcaAuthorityArn" yaml:"awsPcaAuthorityArn"` }
An object that represents the AWS Private Certificate Authority certificate.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectTlsCertificateAuthorityProperty := &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }
type CfnService_ServiceConnectTlsConfigurationProperty ¶ added in v2.123.0
type CfnService_ServiceConnectTlsConfigurationProperty struct { // The signer certificate authority. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttlsconfiguration.html#cfn-ecs-service-serviceconnecttlsconfiguration-issuercertificateauthority // IssuerCertificateAuthority interface{} `field:"required" json:"issuerCertificateAuthority" yaml:"issuerCertificateAuthority"` // The AWS Key Management Service key. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttlsconfiguration.html#cfn-ecs-service-serviceconnecttlsconfiguration-kmskey // KmsKey *string `field:"optional" json:"kmsKey" yaml:"kmsKey"` // The Amazon Resource Name (ARN) of the IAM role that's associated with the Service Connect TLS. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttlsconfiguration.html#cfn-ecs-service-serviceconnecttlsconfiguration-rolearn // RoleArn *string `field:"optional" json:"roleArn" yaml:"roleArn"` }
An object that represents the configuration for Service Connect TLS.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectTlsConfigurationProperty := &ServiceConnectTlsConfigurationProperty{ IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{ AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"), }, // the properties below are optional KmsKey: jsii.String("kmsKey"), RoleArn: jsii.String("roleArn"), }
type CfnService_ServiceManagedEBSVolumeConfigurationProperty ¶ added in v2.117.0
type CfnService_ServiceManagedEBSVolumeConfigurationProperty struct { // The ARN of the IAM role to associate with this volume. // // This is the Amazon ECS infrastructure IAM role that is used to manage your AWS infrastructure. We recommend using the Amazon ECS-managed `AmazonECSInfrastructureRolePolicyForVolumes` IAM policy with this role. For more information, see [Amazon ECS infrastructure IAM role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/infrastructure_IAM_role.html) in the *Amazon ECS Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-rolearn // RoleArn *string `field:"required" json:"roleArn" yaml:"roleArn"` // Indicates whether the volume should be encrypted. // // If no value is specified, encryption is turned on by default. This parameter maps 1:1 with the `Encrypted` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-encrypted // Encrypted interface{} `field:"optional" json:"encrypted" yaml:"encrypted"` // The Linux filesystem type for the volume. // // For volumes created from a snapshot, you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a filesystem type mismatch, the task will fail to start. // // The available filesystem types are `ext3` , `ext4` , and `xfs` . If no value is specified, the `xfs` filesystem type is used by default. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-filesystemtype // FilesystemType *string `field:"optional" json:"filesystemType" yaml:"filesystemType"` // The number of I/O operations per second (IOPS). // // For `gp3` , `io1` , and `io2` volumes, this represents the number of IOPS that are provisioned for the volume. For `gp2` volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. // // The following are the supported values for each volume type. // // - `gp3` : 3,000 - 16,000 IOPS // - `io1` : 100 - 64,000 IOPS // - `io2` : 100 - 256,000 IOPS // // This parameter is required for `io1` and `io2` volume types. The default for `gp3` volumes is `3,000 IOPS` . This parameter is not supported for `st1` , `sc1` , or `standard` volume types. // // This parameter maps 1:1 with the `Iops` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-iops // Iops *float64 `field:"optional" json:"iops" yaml:"iops"` // The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use for Amazon EBS encryption. // // When encryption is turned on and no AWS Key Management Service key is specified, the default AWS managed key for Amazon EBS volumes is used. This parameter maps 1:1 with the `KmsKeyId` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // // > AWS authenticates the AWS Key Management Service key asynchronously. Therefore, if you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-kmskeyid // KmsKeyId *string `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // The size of the volume in GiB. // // You must specify either a volume size or a snapshot ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the `Size` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // // The following are the supported volume size values for each volume type. // // - `gp2` and `gp3` : 1-16,384 // - `io1` and `io2` : 4-16,384 // - `st1` and `sc1` : 125-16,384 // - `standard` : 1-1,024. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-sizeingib // SizeInGiB *float64 `field:"optional" json:"sizeInGiB" yaml:"sizeInGiB"` // The snapshot that Amazon ECS uses to create the volume. // // You must specify either a snapshot ID or a volume size. This parameter maps 1:1 with the `SnapshotId` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-snapshotid // SnapshotId *string `field:"optional" json:"snapshotId" yaml:"snapshotId"` // The tags to apply to the volume. // // Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with the `TagSpecifications.N` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-tagspecifications // TagSpecifications interface{} `field:"optional" json:"tagSpecifications" yaml:"tagSpecifications"` // The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. // // This parameter maps 1:1 with the `Throughput` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . // // > This parameter is only supported for the `gp3` volume type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-throughput // Throughput *float64 `field:"optional" json:"throughput" yaml:"throughput"` // The volume type. // // This parameter maps 1:1 with the `VolumeType` parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API Reference* . For more information, see [Amazon EBS volume types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html) in the *Amazon EC2 User Guide* . // // The following are the supported volume types. // // - General Purpose SSD: `gp2` | `gp3` // - Provisioned IOPS SSD: `io1` | `io2` // - Throughput Optimized HDD: `st1` // - Cold HDD: `sc1` // - Magnetic: `standard` // // > The magnetic volume type is not supported on Fargate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicemanagedebsvolumeconfiguration.html#cfn-ecs-service-servicemanagedebsvolumeconfiguration-volumetype // VolumeType *string `field:"optional" json:"volumeType" yaml:"volumeType"` }
The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf.
These settings are used to create each Amazon EBS volume, with one volume created for each task in the service.
Many of these parameters map 1:1 with the Amazon EBS `CreateVolume` API request parameters.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceManagedEBSVolumeConfigurationProperty := &ServiceManagedEBSVolumeConfigurationProperty{ RoleArn: jsii.String("roleArn"), // the properties below are optional Encrypted: jsii.Boolean(false), FilesystemType: jsii.String("filesystemType"), Iops: jsii.Number(123), KmsKeyId: jsii.String("kmsKeyId"), SizeInGiB: jsii.Number(123), SnapshotId: jsii.String("snapshotId"), TagSpecifications: []interface{}{ &EBSTagSpecificationProperty{ ResourceType: jsii.String("resourceType"), // the properties below are optional PropagateTags: jsii.String("propagateTags"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }, }, Throughput: jsii.Number(123), VolumeType: jsii.String("volumeType"), }
type CfnService_ServiceRegistryProperty ¶
type CfnService_ServiceRegistryProperty struct { // The container name value to be used for your service discovery service. // // It's already specified in the task definition. If the task definition that your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition that your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-containername // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The port value to be used for your service discovery service. // // It's already specified in the task definition. If the task definition your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-containerport // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The port value used if your service discovery service specified an SRV record. // // This field might be used if both the `awsvpc` network mode and SRV records are used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-port // Port *float64 `field:"optional" json:"port" yaml:"port"` // The Amazon Resource Name (ARN) of the service registry. // // The currently supported service registry is AWS Cloud Map . For more information, see [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-registryarn // RegistryArn *string `field:"optional" json:"registryArn" yaml:"registryArn"` }
The `ServiceRegistry` property specifies details of the service registry.
For more information, see [Service Discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceRegistryProperty := &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }
type CfnService_ServiceVolumeConfigurationProperty ¶ added in v2.117.0
type CfnService_ServiceVolumeConfigurationProperty struct { // The name of the volume. // // This value must match the volume name from the `Volume` object in the task definition. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicevolumeconfiguration.html#cfn-ecs-service-servicevolumeconfiguration-name // Name *string `field:"required" json:"name" yaml:"name"` // The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf. // // These settings are used to create each Amazon EBS volume, with one volume created for each task in the service. The Amazon EBS volumes are visible in your account in the Amazon EC2 console once they are created. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-servicevolumeconfiguration.html#cfn-ecs-service-servicevolumeconfiguration-managedebsvolume // ManagedEbsVolume interface{} `field:"optional" json:"managedEbsVolume" yaml:"managedEbsVolume"` }
The configuration for a volume specified in the task definition as a volume that is configured at launch time.
Currently, the only supported volume type is an Amazon EBS volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceVolumeConfigurationProperty := &ServiceVolumeConfigurationProperty{ Name: jsii.String("name"), // the properties below are optional ManagedEbsVolume: &ServiceManagedEBSVolumeConfigurationProperty{ RoleArn: jsii.String("roleArn"), // the properties below are optional Encrypted: jsii.Boolean(false), FilesystemType: jsii.String("filesystemType"), Iops: jsii.Number(123), KmsKeyId: jsii.String("kmsKeyId"), SizeInGiB: jsii.Number(123), SnapshotId: jsii.String("snapshotId"), TagSpecifications: []interface{}{ &EBSTagSpecificationProperty{ ResourceType: jsii.String("resourceType"), // the properties below are optional PropagateTags: jsii.String("propagateTags"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }, }, Throughput: jsii.Number(123), VolumeType: jsii.String("volumeType"), }, }
type CfnService_TimeoutConfigurationProperty ¶ added in v2.123.0
type CfnService_TimeoutConfigurationProperty struct { // The amount of time in seconds a connection will stay active while idle. // // A value of `0` can be set to disable `idleTimeout` . // // The `idleTimeout` default for `HTTP` / `HTTP2` / `GRPC` is 5 minutes. // // The `idleTimeout` default for `TCP` is 1 hour. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-timeoutconfiguration.html#cfn-ecs-service-timeoutconfiguration-idletimeoutseconds // IdleTimeoutSeconds *float64 `field:"optional" json:"idleTimeoutSeconds" yaml:"idleTimeoutSeconds"` // The amount of time waiting for the upstream to respond with a complete response per request. // // A value of `0` can be set to disable `perRequestTimeout` . `perRequestTimeout` can only be set if Service Connect `appProtocol` isn't `TCP` . Only `idleTimeout` is allowed for `TCP` `appProtocol` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-timeoutconfiguration.html#cfn-ecs-service-timeoutconfiguration-perrequesttimeoutseconds // PerRequestTimeoutSeconds *float64 `field:"optional" json:"perRequestTimeoutSeconds" yaml:"perRequestTimeoutSeconds"` }
An object that represents the timeout configurations for Service Connect.
> If `idleTimeout` is set to a time that is less than `perRequestTimeout` , the connection will close when the `idleTimeout` is reached and not the `perRequestTimeout` .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" timeoutConfigurationProperty := &TimeoutConfigurationProperty{ IdleTimeoutSeconds: jsii.Number(123), PerRequestTimeoutSeconds: jsii.Number(123), }
type CfnTaskDefinition ¶
type CfnTaskDefinition interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The ARN of the task definition. AttrTaskDefinitionArn() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // A list of container definitions in JSON format that describe the different containers that make up your task. ContainerDefinitions() interface{} SetContainerDefinitions(val interface{}) // The number of `cpu` units used by the task. Cpu() *string SetCpu(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The ephemeral storage settings to use for tasks run with the task definition. EphemeralStorage() interface{} SetEphemeralStorage(val interface{}) // The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make AWS API calls on your behalf. ExecutionRoleArn() *string SetExecutionRoleArn(val *string) // The name of a family that this task definition is registered to. Family() *string SetFamily(val *string) // The Elastic Inference accelerators to use for the containers in the task. InferenceAccelerators() interface{} SetInferenceAccelerators(val interface{}) // The IPC resource namespace to use for the containers in the task. IpcMode() *string SetIpcMode(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The amount (in MiB) of memory used by the task. Memory() *string SetMemory(val *string) // The Docker networking mode to use for the containers in the task. NetworkMode() *string SetNetworkMode(val *string) // The tree node. Node() constructs.Node // The process namespace to use for the containers in the task. PidMode() *string SetPidMode(val *string) // An array of placement constraint objects to use for tasks. PlacementConstraints() interface{} SetPlacementConstraints(val interface{}) // The configuration details for the App Mesh proxy. ProxyConfiguration() interface{} SetProxyConfiguration(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The task launch types the task definition was validated against. RequiresCompatibilities() *[]*string SetRequiresCompatibilities(val *[]*string) // The operating system that your tasks definitions run on. RuntimePlatform() interface{} SetRuntimePlatform(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The metadata that you apply to the task definition to help you categorize and organize them. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // The short name or full Amazon Resource Name (ARN) of the AWS Identity and Access Management role that grants containers in the task permission to call AWS APIs on your behalf. TaskRoleArn() *string SetTaskRoleArn(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // The list of data volume definitions for the task. Volumes() interface{} SetVolumes(val interface{}) // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Registers a new task definition from the supplied `family` and `containerDefinitions` .
Optionally, you can add data volumes to your containers with the `volumes` parameter. For more information about task definition parameters and defaults, see [Amazon ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon Elastic Container Service Developer Guide* .
You can specify a role for your task with the `taskRoleArn` parameter. When you specify a role for a task, its containers can then use the latest versions of the AWS CLI or SDKs to make API requests to the AWS services that are specified in the policy that's associated with the role. For more information, see [IAM Roles for Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide* .
You can specify a Docker networking mode for the containers in your task definition with the `networkMode` parameter. The available network modes correspond to those described in [Network settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#/network-settings) in the Docker run reference. If you specify the `awsvpc` network mode, the task is allocated an elastic network interface, and you must specify a `NetworkConfiguration` when you create a service or run a task with the task definition. For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTaskDefinition := awscdk.Aws_ecs.NewCfnTaskDefinition(this, jsii.String("MyCfnTaskDefinition"), &CfnTaskDefinitionProps{ ContainerDefinitions: []interface{}{ &ContainerDefinitionProperty{ Image: jsii.String("image"), Name: jsii.String("name"), // the properties below are optional Command: []*string{ jsii.String("command"), }, Cpu: jsii.Number(123), DependsOn: []interface{}{ &ContainerDependencyProperty{ Condition: jsii.String("condition"), ContainerName: jsii.String("containerName"), }, }, DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, EnvironmentFiles: []interface{}{ &EnvironmentFileProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Essential: jsii.Boolean(false), ExtraHosts: []interface{}{ &HostEntryProperty{ Hostname: jsii.String("hostname"), IpAddress: jsii.String("ipAddress"), }, }, FirelensConfiguration: &FirelensConfigurationProperty{ Options: map[string]*string{ "optionsKey": jsii.String("options"), }, Type: jsii.String("type"), }, HealthCheck: &HealthCheckProperty{ Command: []*string{ jsii.String("command"), }, Interval: jsii.Number(123), Retries: jsii.Number(123), StartPeriod: jsii.Number(123), Timeout: jsii.Number(123), }, Hostname: jsii.String("hostname"), Interactive: jsii.Boolean(false), Links: []*string{ jsii.String("links"), }, LinuxParameters: &LinuxParametersProperty{ Capabilities: &KernelCapabilitiesProperty{ Add: []*string{ jsii.String("add"), }, Drop: []*string{ jsii.String("drop"), }, }, Devices: []interface{}{ &DeviceProperty{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), Permissions: []*string{ jsii.String("permissions"), }, }, }, InitProcessEnabled: jsii.Boolean(false), MaxSwap: jsii.Number(123), SharedMemorySize: jsii.Number(123), Swappiness: jsii.Number(123), Tmpfs: []interface{}{ &TmpfsProperty{ Size: jsii.Number(123), // the properties below are optional ContainerPath: jsii.String("containerPath"), MountOptions: []*string{ jsii.String("mountOptions"), }, }, }, }, LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), // the properties below are optional Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Memory: jsii.Number(123), MemoryReservation: jsii.Number(123), MountPoints: []interface{}{ &MountPointProperty{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), SourceVolume: jsii.String("sourceVolume"), }, }, PortMappings: []interface{}{ &PortMappingProperty{ AppProtocol: jsii.String("appProtocol"), ContainerPort: jsii.Number(123), ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: jsii.String("protocol"), }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), RepositoryCredentials: &RepositoryCredentialsProperty{ CredentialsParameter: jsii.String("credentialsParameter"), }, ResourceRequirements: []interface{}{ &ResourceRequirementProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Secrets: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, StartTimeout: jsii.Number(123), StopTimeout: jsii.Number(123), SystemControls: []interface{}{ &SystemControlProperty{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []interface{}{ &UlimitProperty{ HardLimit: jsii.Number(123), Name: jsii.String("name"), SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), VolumesFrom: []interface{}{ &VolumeFromProperty{ ReadOnly: jsii.Boolean(false), SourceContainer: jsii.String("sourceContainer"), }, }, WorkingDirectory: jsii.String("workingDirectory"), }, }, Cpu: jsii.String("cpu"), EphemeralStorage: &EphemeralStorageProperty{ SizeInGiB: jsii.Number(123), }, ExecutionRoleArn: jsii.String("executionRoleArn"), Family: jsii.String("family"), InferenceAccelerators: []interface{}{ &InferenceAcceleratorProperty{ DeviceName: jsii.String("deviceName"), DeviceType: jsii.String("deviceType"), }, }, IpcMode: jsii.String("ipcMode"), Memory: jsii.String("memory"), NetworkMode: jsii.String("networkMode"), PidMode: jsii.String("pidMode"), PlacementConstraints: []interface{}{ &TaskDefinitionPlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }, }, ProxyConfiguration: &ProxyConfigurationProperty{ ContainerName: jsii.String("containerName"), // the properties below are optional ProxyConfigurationProperties: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, Type: jsii.String("type"), }, RequiresCompatibilities: []*string{ jsii.String("requiresCompatibilities"), }, RuntimePlatform: &RuntimePlatformProperty{ CpuArchitecture: jsii.String("cpuArchitecture"), OperatingSystemFamily: jsii.String("operatingSystemFamily"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TaskRoleArn: jsii.String("taskRoleArn"), Volumes: []interface{}{ &VolumeProperty{ ConfiguredAtLaunch: jsii.Boolean(false), DockerVolumeConfiguration: &DockerVolumeConfigurationProperty{ Autoprovision: jsii.Boolean(false), Driver: jsii.String("driver"), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, Scope: jsii.String("scope"), }, EfsVolumeConfiguration: &EFSVolumeConfigurationProperty{ FilesystemId: jsii.String("filesystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfigProperty{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }, Host: &HostVolumePropertiesProperty{ SourcePath: jsii.String("sourcePath"), }, Name: jsii.String("name"), }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
func NewCfnTaskDefinition ¶
func NewCfnTaskDefinition(scope constructs.Construct, id *string, props *CfnTaskDefinitionProps) CfnTaskDefinition
type CfnTaskDefinitionProps ¶
type CfnTaskDefinitionProps struct { // A list of container definitions in JSON format that describe the different containers that make up your task. // // For more information about container definition parameters and defaults, see [Amazon ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-containerdefinitions // ContainerDefinitions interface{} `field:"optional" json:"containerDefinitions" yaml:"containerDefinitions"` // The number of `cpu` units used by the task. // // If you use the EC2 launch type, this field is optional. Any value can be used. If you use the Fargate launch type, this field is required. You must use one of the following values. The value that you choose determines your range of valid values for the `memory` parameter. // // The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. // // - 256 (.25 vCPU) - Available `memory` values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) // - 512 (.5 vCPU) - Available `memory` values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) // - 1024 (1 vCPU) - Available `memory` values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) // - 2048 (2 vCPU) - Available `memory` values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) // - 4096 (4 vCPU) - Available `memory` values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) // - 8192 (8 vCPU) - Available `memory` values: 16 GB and 60 GB in 4 GB increments // // This option requires Linux platform `1.4.0` or later. // - 16384 (16vCPU) - Available `memory` values: 32GB and 120 GB in 8 GB increments // // This option requires Linux platform `1.4.0` or later. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-cpu // Cpu *string `field:"optional" json:"cpu" yaml:"cpu"` // The ephemeral storage settings to use for tasks run with the task definition. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-ephemeralstorage // EphemeralStorage interface{} `field:"optional" json:"ephemeralStorage" yaml:"ephemeralStorage"` // The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make AWS API calls on your behalf. // // The task execution IAM role is required depending on the requirements of your task. For more information, see [Amazon ECS task execution IAM role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-executionrolearn // ExecutionRoleArn *string `field:"optional" json:"executionRoleArn" yaml:"executionRoleArn"` // The name of a family that this task definition is registered to. // // Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. // // A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add. // // > To use revision numbers when you update a task definition, specify this property. If you don't specify a value, AWS CloudFormation generates a new task definition each time that you update it. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-family // Family *string `field:"optional" json:"family" yaml:"family"` // The Elastic Inference accelerators to use for the containers in the task. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-inferenceaccelerators // InferenceAccelerators interface{} `field:"optional" json:"inferenceAccelerators" yaml:"inferenceAccelerators"` // The IPC resource namespace to use for the containers in the task. // // The valid values are `host` , `task` , or `none` . If `host` is specified, then all containers within the tasks that specified the `host` IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If `task` is specified, all containers within the specified task share the same IPC resources. If `none` is specified, then IPC resources within the containers of a task are private and not shared with other containers in a task or on the container instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more information, see [IPC settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) in the *Docker run reference* . // // If the `host` IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see [Docker security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/) . // // If you are setting namespaced kernel parameters using `systemControls` for the containers in the task, the following will apply to your IPC resource namespace. For more information, see [System Controls](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) in the *Amazon Elastic Container Service Developer Guide* . // // - For tasks that use the `host` IPC mode, IPC namespace related `systemControls` are not supported. // - For tasks that use the `task` IPC mode, IPC namespace related `systemControls` will apply to all containers within a task. // // > This parameter is not supported for Windows containers or tasks run on AWS Fargate . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-ipcmode // IpcMode *string `field:"optional" json:"ipcMode" yaml:"ipcMode"` // The amount (in MiB) of memory used by the task. // // If your tasks runs on Amazon EC2 instances, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified, the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see [ContainerDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html) . // // If your tasks runs on AWS Fargate , this field is required. You must use one of the following values. The value you choose determines your range of valid values for the `cpu` parameter. // // - 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available `cpu` values: 256 (.25 vCPU) // - 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available `cpu` values: 512 (.5 vCPU) // - 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available `cpu` values: 1024 (1 vCPU) // - Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available `cpu` values: 2048 (2 vCPU) // - Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available `cpu` values: 4096 (4 vCPU) // - Between 16 GB and 60 GB in 4 GB increments - Available `cpu` values: 8192 (8 vCPU) // // This option requires Linux platform `1.4.0` or later. // - Between 32GB and 120 GB in 8 GB increments - Available `cpu` values: 16384 (16 vCPU) // // This option requires Linux platform `1.4.0` or later. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-memory // Memory *string `field:"optional" json:"memory" yaml:"memory"` // The Docker networking mode to use for the containers in the task. // // The valid values are `none` , `bridge` , `awsvpc` , and `host` . If no network mode is specified, the default is `bridge` . // // For Amazon ECS tasks on Fargate, the `awsvpc` network mode is required. For Amazon ECS tasks on Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, `<default>` or `awsvpc` can be used. If the network mode is set to `none` , you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The `host` and `awsvpc` network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the `bridge` mode. // // With the `host` and `awsvpc` network modes, exposed container ports are mapped directly to the corresponding host port (for the `host` network mode) or the attached elastic network interface port (for the `awsvpc` network mode), so you cannot take advantage of dynamic host port mappings. // // > When using the `host` network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user. // // If the network mode is `awsvpc` , the task is allocated an elastic network interface, and you must specify a `NetworkConfiguration` value when you create a service or run a task with the task definition. For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide* . // // If the network mode is `host` , you cannot run multiple instantiations of the same task on a single container instance when port mappings are used. // // For more information, see [Network settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#network-settings) in the *Docker run reference* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-networkmode // NetworkMode *string `field:"optional" json:"networkMode" yaml:"networkMode"` // The process namespace to use for the containers in the task. // // The valid values are `host` or `task` . On Fargate for Linux containers, the only valid value is `task` . For example, monitoring sidecars might need `pidMode` to access information about other containers running in the same task. // // If `host` is specified, all containers within the tasks that specified the `host` PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. // // If `task` is specified, all containers within the specified task share the same process namespace. // // If no value is specified, the default is a private namespace for each container. For more information, see [PID settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#pid-settings---pid) in the *Docker run reference* . // // If the `host` PID mode is used, there's a heightened risk of undesired process namespace exposure. For more information, see [Docker security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/) . // // > This parameter is not supported for Windows containers. > This parameter is only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version `1.4.0` or later (Linux). This isn't supported for Windows containers on Fargate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-pidmode // PidMode *string `field:"optional" json:"pidMode" yaml:"pidMode"` // An array of placement constraint objects to use for tasks. // // > This parameter isn't supported for tasks run on AWS Fargate . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-placementconstraints // PlacementConstraints interface{} `field:"optional" json:"placementConstraints" yaml:"placementConstraints"` // The configuration details for the App Mesh proxy. // // Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the `ecs-init` package to use a proxy configuration. If your container instances are launched from the Amazon ECS optimized AMI version `20190301` or later, they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-proxyconfiguration // ProxyConfiguration interface{} `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The task launch types the task definition was validated against. // // The valid values are `EC2` , `FARGATE` , and `EXTERNAL` . For more information, see [Amazon ECS launch types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-requirescompatibilities // RequiresCompatibilities *[]*string `field:"optional" json:"requiresCompatibilities" yaml:"requiresCompatibilities"` // The operating system that your tasks definitions run on. // // A platform family is specified only for tasks using the Fargate launch type. // // When you specify a task definition in a service, this value must match the `runtimePlatform` value of the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-runtimeplatform // RuntimePlatform interface{} `field:"optional" json:"runtimePlatform" yaml:"runtimePlatform"` // The metadata that you apply to the task definition to help you categorize and organize them. // // Each tag consists of a key and an optional value. You define both of them. // // The following basic restrictions apply to tags: // // - Maximum number of tags per resource - 50 // - For each resource, each tag key must be unique, and each tag key can have only one value. // - Maximum key length - 128 Unicode characters in UTF-8 // - Maximum value length - 256 Unicode characters in UTF-8 // - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // The short name or full Amazon Resource Name (ARN) of the AWS Identity and Access Management role that grants containers in the task permission to call AWS APIs on your behalf. // // For more information, see [Amazon ECS Task Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide* . // // IAM roles for tasks on Windows require that the `-EnableTaskIAMRole` option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code to use the feature. For more information, see [Windows IAM roles for tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-taskrolearn // TaskRoleArn *string `field:"optional" json:"taskRoleArn" yaml:"taskRoleArn"` // The list of data volume definitions for the task. // // For more information, see [Using data volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the *Amazon Elastic Container Service Developer Guide* . // // > The `host` and `sourcePath` parameters aren't supported for tasks run on AWS Fargate . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-volumes // Volumes interface{} `field:"optional" json:"volumes" yaml:"volumes"` }
Properties for defining a `CfnTaskDefinition`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTaskDefinitionProps := &CfnTaskDefinitionProps{ ContainerDefinitions: []interface{}{ &ContainerDefinitionProperty{ Image: jsii.String("image"), Name: jsii.String("name"), // the properties below are optional Command: []*string{ jsii.String("command"), }, Cpu: jsii.Number(123), DependsOn: []interface{}{ &ContainerDependencyProperty{ Condition: jsii.String("condition"), ContainerName: jsii.String("containerName"), }, }, DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, EnvironmentFiles: []interface{}{ &EnvironmentFileProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Essential: jsii.Boolean(false), ExtraHosts: []interface{}{ &HostEntryProperty{ Hostname: jsii.String("hostname"), IpAddress: jsii.String("ipAddress"), }, }, FirelensConfiguration: &FirelensConfigurationProperty{ Options: map[string]*string{ "optionsKey": jsii.String("options"), }, Type: jsii.String("type"), }, HealthCheck: &HealthCheckProperty{ Command: []*string{ jsii.String("command"), }, Interval: jsii.Number(123), Retries: jsii.Number(123), StartPeriod: jsii.Number(123), Timeout: jsii.Number(123), }, Hostname: jsii.String("hostname"), Interactive: jsii.Boolean(false), Links: []*string{ jsii.String("links"), }, LinuxParameters: &LinuxParametersProperty{ Capabilities: &KernelCapabilitiesProperty{ Add: []*string{ jsii.String("add"), }, Drop: []*string{ jsii.String("drop"), }, }, Devices: []interface{}{ &DeviceProperty{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), Permissions: []*string{ jsii.String("permissions"), }, }, }, InitProcessEnabled: jsii.Boolean(false), MaxSwap: jsii.Number(123), SharedMemorySize: jsii.Number(123), Swappiness: jsii.Number(123), Tmpfs: []interface{}{ &TmpfsProperty{ Size: jsii.Number(123), // the properties below are optional ContainerPath: jsii.String("containerPath"), MountOptions: []*string{ jsii.String("mountOptions"), }, }, }, }, LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), // the properties below are optional Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Memory: jsii.Number(123), MemoryReservation: jsii.Number(123), MountPoints: []interface{}{ &MountPointProperty{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), SourceVolume: jsii.String("sourceVolume"), }, }, PortMappings: []interface{}{ &PortMappingProperty{ AppProtocol: jsii.String("appProtocol"), ContainerPort: jsii.Number(123), ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: jsii.String("protocol"), }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), RepositoryCredentials: &RepositoryCredentialsProperty{ CredentialsParameter: jsii.String("credentialsParameter"), }, ResourceRequirements: []interface{}{ &ResourceRequirementProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Secrets: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, StartTimeout: jsii.Number(123), StopTimeout: jsii.Number(123), SystemControls: []interface{}{ &SystemControlProperty{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []interface{}{ &UlimitProperty{ HardLimit: jsii.Number(123), Name: jsii.String("name"), SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), VolumesFrom: []interface{}{ &VolumeFromProperty{ ReadOnly: jsii.Boolean(false), SourceContainer: jsii.String("sourceContainer"), }, }, WorkingDirectory: jsii.String("workingDirectory"), }, }, Cpu: jsii.String("cpu"), EphemeralStorage: &EphemeralStorageProperty{ SizeInGiB: jsii.Number(123), }, ExecutionRoleArn: jsii.String("executionRoleArn"), Family: jsii.String("family"), InferenceAccelerators: []interface{}{ &InferenceAcceleratorProperty{ DeviceName: jsii.String("deviceName"), DeviceType: jsii.String("deviceType"), }, }, IpcMode: jsii.String("ipcMode"), Memory: jsii.String("memory"), NetworkMode: jsii.String("networkMode"), PidMode: jsii.String("pidMode"), PlacementConstraints: []interface{}{ &TaskDefinitionPlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }, }, ProxyConfiguration: &ProxyConfigurationProperty{ ContainerName: jsii.String("containerName"), // the properties below are optional ProxyConfigurationProperties: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, Type: jsii.String("type"), }, RequiresCompatibilities: []*string{ jsii.String("requiresCompatibilities"), }, RuntimePlatform: &RuntimePlatformProperty{ CpuArchitecture: jsii.String("cpuArchitecture"), OperatingSystemFamily: jsii.String("operatingSystemFamily"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TaskRoleArn: jsii.String("taskRoleArn"), Volumes: []interface{}{ &VolumeProperty{ ConfiguredAtLaunch: jsii.Boolean(false), DockerVolumeConfiguration: &DockerVolumeConfigurationProperty{ Autoprovision: jsii.Boolean(false), Driver: jsii.String("driver"), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, Scope: jsii.String("scope"), }, EfsVolumeConfiguration: &EFSVolumeConfigurationProperty{ FilesystemId: jsii.String("filesystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfigProperty{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }, Host: &HostVolumePropertiesProperty{ SourcePath: jsii.String("sourcePath"), }, Name: jsii.String("name"), }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
type CfnTaskDefinition_AuthorizationConfigProperty ¶
type CfnTaskDefinition_AuthorizationConfigProperty struct { // The Amazon EFS access point ID to use. // // If an access point is specified, the root directory value specified in the `EFSVolumeConfiguration` must either be omitted or set to `/` which will enforce the path set on the EFS access point. If an access point is used, transit encryption must be on in the `EFSVolumeConfiguration` . For more information, see [Working with Amazon EFS access points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) in the *Amazon Elastic File System User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-authorizationconfig.html#cfn-ecs-taskdefinition-authorizationconfig-accesspointid // AccessPointId *string `field:"optional" json:"accessPointId" yaml:"accessPointId"` // Determines whether to use the Amazon ECS task role defined in a task definition when mounting the Amazon EFS file system. // // If it is turned on, transit encryption must be turned on in the `EFSVolumeConfiguration` . If this parameter is omitted, the default value of `DISABLED` is used. For more information, see [Using Amazon EFS access points](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-authorizationconfig.html#cfn-ecs-taskdefinition-authorizationconfig-iam // Iam *string `field:"optional" json:"iam" yaml:"iam"` }
The authorization configuration details for the Amazon EFS file system.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" authorizationConfigProperty := &AuthorizationConfigProperty{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }
type CfnTaskDefinition_ContainerDefinitionProperty ¶
type CfnTaskDefinition_ContainerDefinitionProperty struct { // The image used to start a container. // // This string is passed directly to the Docker daemon. By default, images in the Docker Hub registry are available. Other repositories are specified with either `*repository-url* / *image* : *tag*` or `*repository-url* / *image* @ *digest*` . Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This parameter maps to `Image` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `IMAGE` parameter of [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // - When a new task starts, the Amazon ECS container agent pulls the latest version of the specified image and tag for the container to use. However, subsequent updates to a repository image aren't propagated to already running tasks. // - Images in Amazon ECR repositories can be specified by either using the full `registry/repository:tag` or `registry/repository@digest` . For example, `012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>:latest` or `012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE` . // - Images in official repositories on Docker Hub use a single name (for example, `ubuntu` or `mongo` ). // - Images in other repositories on Docker Hub are qualified with an organization name (for example, `amazon/amazon-ecs-agent` ). // - Images in other online repositories are qualified further by a domain name (for example, `quay.io/assemblyline/ubuntu` ). // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-image // Image *string `field:"required" json:"image" yaml:"image"` // The name of a container. // // If you're linking multiple containers together in a task definition, the `name` of one container can be entered in the `links` of another container to connect the containers. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. This parameter maps to `name` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--name` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-name // Name *string `field:"required" json:"name" yaml:"name"` // The command that's passed to the container. // // This parameter maps to `Cmd` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `COMMAND` parameter to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . For more information, see [https://docs.docker.com/engine/reference/builder/#cmd](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#cmd) . If there are multiple arguments, each argument is a separated string in the array. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-command // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The number of `cpu` units reserved for the container. // // This parameter maps to `CpuShares` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--cpu-shares` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // This field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of CPU reserved for all containers within a task be lower than the task-level `cpu` value. // // > You can determine the number of CPU units that are available per EC2 instance type by multiplying the vCPUs listed for that instance type on the [Amazon EC2 Instances](https://docs.aws.amazon.com/ec2/instance-types/) detail page by 1,024. // // Linux containers share unallocated CPU units with other containers on the container instance with the same ratio as their allocated amount. For example, if you run a single-container task on a single-core instance type with 512 CPU units specified for that container, and that's the only task running on the container instance, that container could use the full 1,024 CPU unit share at any given time. However, if you launched another copy of the same task on that container instance, each task is guaranteed a minimum of 512 CPU units when needed. Moreover, each container could float to higher CPU usage if the other container was not using it. If both tasks were 100% active all of the time, they would be limited to 512 CPU units. // // On Linux container instances, the Docker daemon on the container instance uses the CPU value to calculate the relative CPU share ratios for running containers. For more information, see [CPU share constraint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#cpu-share-constraint) in the Docker documentation. The minimum valid CPU share value that the Linux kernel allows is 2. However, the CPU parameter isn't required, and you can use CPU values below 2 in your container definitions. For CPU values below 2 (including null), the behavior varies based on your Amazon ECS container agent version: // // - *Agent versions less than or equal to 1.1.0:* Null and zero CPU values are passed to Docker as 0, which Docker then converts to 1,024 CPU shares. CPU values of 1 are passed to Docker as 1, which the Linux kernel converts to two CPU shares. // - *Agent versions greater than or equal to 1.2.0:* Null, zero, and CPU values of 1 are passed to Docker as 2. // // On Windows container instances, the CPU limit is enforced as an absolute limit, or a quota. Windows containers only have access to the specified amount of CPU that's described in the task definition. A null or zero CPU value is passed to Docker as `0` , which Windows interprets as 1% of one CPU. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-cpu // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // The dependencies defined for container startup and shutdown. // // A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. // // For tasks using the EC2 launch type, the container instances require at least version 1.26.0 of the container agent to turn on container dependencies. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the `ecs-init` package. If your container instances are launched from version `20190301` or later, then they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic Container Service Developer Guide* . // // For tasks using the Fargate launch type, the task or service requires the following platforms: // // - Linux platform version `1.3.0` or later. // - Windows platform version `1.0.0` or later. // // If the task definition is used in a blue/green deployment that uses [AWS::CodeDeploy::DeploymentGroup BlueGreenDeploymentConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-bluegreendeploymentconfiguration.html) , the `dependsOn` parameter is not supported. For more information see [Issue #680](https://docs.aws.amazon.com/https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/680) on the on the GitHub website. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-dependson // DependsOn interface{} `field:"optional" json:"dependsOn" yaml:"dependsOn"` // When this parameter is true, networking is off within the container. // // This parameter maps to `NetworkDisabled` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) . // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-disablenetworking // DisableNetworking interface{} `field:"optional" json:"disableNetworking" yaml:"disableNetworking"` // A list of DNS search domains that are presented to the container. // // This parameter maps to `DnsSearch` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--dns-search` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-dnssearchdomains // DnsSearchDomains *[]*string `field:"optional" json:"dnsSearchDomains" yaml:"dnsSearchDomains"` // A list of DNS servers that are presented to the container. // // This parameter maps to `Dns` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--dns` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-dnsservers // DnsServers *[]*string `field:"optional" json:"dnsServers" yaml:"dnsServers"` // A key/value map of labels to add to the container. // // This parameter maps to `Labels` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--label` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-dockerlabels // DockerLabels interface{} `field:"optional" json:"dockerLabels" yaml:"dockerLabels"` // A list of strings to provide custom configuration for multiple security systems. // // For more information about valid values, see [Docker Run Security Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . This field isn't valid for containers in tasks using the Fargate launch type. // // For Linux tasks on EC2, this parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems. // // For any tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for Active Directory authentication. For more information, see [Using gMSAs for Windows Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using gMSAs for Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html) in the *Amazon Elastic Container Service Developer Guide* . // // This parameter maps to `SecurityOpt` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--security-opt` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > The Amazon ECS container agent running on a container instance must register with the `ECS_SELINUX_CAPABLE=true` or `ECS_APPARMOR_CAPABLE=true` environment variables before containers placed on that instance can use these security options. For more information, see [Amazon ECS Container Agent Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide* . // // For more information about valid values, see [Docker Run Security Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // Valid values: "no-new-privileges" | "apparmor:PROFILE" | "label:value" | "credentialspec:CredentialSpecFilePath". // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-dockersecurityoptions // DockerSecurityOptions *[]*string `field:"optional" json:"dockerSecurityOptions" yaml:"dockerSecurityOptions"` // > Early versions of the Amazon ECS container agent don't properly handle `entryPoint` parameters. // // If you have problems using `entryPoint` , update your container agent or enter your commands and arguments as `command` array items instead. // // The entry point that's passed to the container. This parameter maps to `Entrypoint` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--entrypoint` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . For more information, see [https://docs.docker.com/engine/reference/builder/#entrypoint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#entrypoint) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-entrypoint // EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // The environment variables to pass to a container. // // This parameter maps to `Env` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--env` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > We don't recommend that you use plaintext environment variables for sensitive information, such as credential data. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-environment // Environment interface{} `field:"optional" json:"environment" yaml:"environment"` // A list of files containing the environment variables to pass to a container. // // This parameter maps to the `--env-file` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // You can specify up to ten environment files. The file must have a `.env` file extension. Each line in an environment file contains an environment variable in `VARIABLE=VALUE` format. Lines beginning with `#` are treated as comments and are ignored. For more information about the environment variable file syntax, see [Declare default environment variables in file](https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/) . // // If there are environment variables specified using the `environment` parameter in a container definition, they take precedence over the variables contained within an environment file. If multiple environment files are specified that contain the same variable, they're processed from the top down. We recommend that you use unique variable names. For more information, see [Specifying Environment Variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-environmentfiles // EnvironmentFiles interface{} `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // If the `essential` parameter of a container is marked as `true` , and that container fails or stops for any reason, all other containers that are part of the task are stopped. // // If the `essential` parameter of a container is marked as `false` , its failure doesn't affect the rest of the containers in a task. If this parameter is omitted, a container is assumed to be essential. // // All tasks must have at least one essential container. If you have an application that's composed of multiple containers, group containers that are used for a common purpose into components, and separate the different components into multiple task definitions. For more information, see [Application Architecture](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-essential // Essential interface{} `field:"optional" json:"essential" yaml:"essential"` // A list of hostnames and IP address mappings to append to the `/etc/hosts` file on the container. // // This parameter maps to `ExtraHosts` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--add-host` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter isn't supported for Windows containers or tasks that use the `awsvpc` network mode. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-extrahosts // ExtraHosts interface{} `field:"optional" json:"extraHosts" yaml:"extraHosts"` // The FireLens configuration for the container. // // This is used to specify and configure a log router for container logs. For more information, see [Custom Log Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-firelensconfiguration // FirelensConfiguration interface{} `field:"optional" json:"firelensConfiguration" yaml:"firelensConfiguration"` // The container health check command and associated configuration parameters for the container. // // This parameter maps to `HealthCheck` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `HEALTHCHECK` parameter of [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-healthcheck // HealthCheck interface{} `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The hostname to use for your container. // // This parameter maps to `Hostname` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--hostname` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > The `hostname` parameter is not supported if you're using the `awsvpc` network mode. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-hostname // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // When this parameter is `true` , you can deploy containerized applications that require `stdin` or a `tty` to be allocated. // // This parameter maps to `OpenStdin` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--interactive` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive // Interactive interface{} `field:"optional" json:"interactive" yaml:"interactive"` // The `links` parameter allows containers to communicate with each other without the need for port mappings. // // This parameter is only supported if the network mode of a task definition is `bridge` . The `name:internalName` construct is analogous to `name:alias` in Docker links. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. For more information about linking Docker containers, go to [Legacy container links](https://docs.aws.amazon.com/https://docs.docker.com/network/links/) in the Docker documentation. This parameter maps to `Links` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--link` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter is not supported for Windows containers. > Containers that are collocated on a single container instance may be able to communicate with each other without requiring links or host port mappings. Network isolation is achieved on the container instance using security groups and VPC settings. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-links // Links *[]*string `field:"optional" json:"links" yaml:"links"` // Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html) . // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-linuxparameters // LinuxParameters interface{} `field:"optional" json:"linuxParameters" yaml:"linuxParameters"` // The log configuration specification for the container. // // This parameter maps to `LogConfig` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--log-driver` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/) . By default, containers use the same logging driver that the Docker daemon uses. However, the container may use a different logging driver than the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different logging driver for a container, the log system must be configured properly on the container instance (or on a different log server for remote logging options). For more information on the options for different supported log drivers, see [Configure logging drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker documentation. // // > Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon (shown in the [LogConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html) data type). Additional log drivers may be available in future releases of the Amazon ECS container agent. // // This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // // > The Amazon ECS container agent running on a container instance must register the logging drivers available on that instance with the `ECS_AVAILABLE_LOGGING_DRIVERS` environment variable before containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS Container Agent Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration // LogConfiguration interface{} `field:"optional" json:"logConfiguration" yaml:"logConfiguration"` // The amount (in MiB) of memory to present to the container. // // If your container attempts to exceed the memory specified here, the container is killed. The total amount of memory reserved for all containers within a task must be lower than the task `memory` value, if one is specified. This parameter maps to `Memory` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--memory` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // If using the Fargate launch type, this parameter is optional. // // If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. If you specify both a container-level `memory` and `memoryReservation` value, `memory` must be greater than `memoryReservation` . If you specify `memoryReservation` , then that value is subtracted from the available memory resources for the container instance where the container is placed. Otherwise, the value of `memory` is used. // // The Docker 20.10.0 or later daemon reserves a minimum of 6 MiB of memory for a container, so you should not specify fewer than 6 MiB of memory for your containers. // // The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of memory for a container, so you should not specify fewer than 4 MiB of memory for your containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-memory // Memory *float64 `field:"optional" json:"memory" yaml:"memory"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the `memory` parameter (if applicable), or all of the available memory on the container instance, whichever comes first. This parameter maps to `MemoryReservation` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--memory-reservation` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // If a task-level memory value is not specified, you must specify a non-zero integer for one or both of `memory` or `memoryReservation` in a container definition. If you specify both, `memory` must be greater than `memoryReservation` . If you specify `memoryReservation` , then that value is subtracted from the available memory resources for the container instance where the container is placed. Otherwise, the value of `memory` is used. // // For example, if your container normally uses 128 MiB of memory, but occasionally bursts to 256 MiB of memory for short periods of time, you can set a `memoryReservation` of 128 MiB, and a `memory` hard limit of 300 MiB. This configuration would allow the container to only reserve 128 MiB of memory from the remaining resources on the container instance, but also allow the container to consume more memory resources when needed. // // The Docker 20.10.0 or later daemon reserves a minimum of 6 MiB of memory for a container. So, don't specify less than 6 MiB of memory for your containers. // // The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of memory for a container. So, don't specify less than 4 MiB of memory for your containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-memoryreservation // MemoryReservation *float64 `field:"optional" json:"memoryReservation" yaml:"memoryReservation"` // The mount points for data volumes in your container. // // This parameter maps to `Volumes` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--volume` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // Windows containers can mount whole directories on the same drive as `$env:ProgramData` . Windows containers can't mount directories on a different drive, and mount point can't be across drives. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-mountpoints // MountPoints interface{} `field:"optional" json:"mountPoints" yaml:"mountPoints"` // The list of port mappings for the container. // // Port mappings allow containers to access ports on the host container instance to send or receive traffic. // // For task definitions that use the `awsvpc` network mode, you should only specify the `containerPort` . The `hostPort` can be left blank or it must be the same value as the `containerPort` . // // Port mappings on Windows use the `NetNAT` gateway address rather than `localhost` . There is no loopback for port mappings on Windows, so you cannot access a container's mapped port from the host itself. // // This parameter maps to `PortBindings` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--publish` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/) . If the network mode of a task definition is set to `none` , then you can't specify port mappings. If the network mode of a task definition is set to `host` , then host ports must either be undefined or they must match the container port in the port mapping. // // > After a task reaches the `RUNNING` status, manual and automatic host and container port assignments are visible in the *Network Bindings* section of a container description for a selected task in the Amazon ECS console. The assignments are also visible in the `networkBindings` section [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) responses. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-portmappings // PortMappings interface{} `field:"optional" json:"portMappings" yaml:"portMappings"` // When this parameter is true, the container is given elevated privileges on the host container instance (similar to the `root` user). // // This parameter maps to `Privileged` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--privileged` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter is not supported for Windows containers or tasks run on AWS Fargate . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-privileged // Privileged interface{} `field:"optional" json:"privileged" yaml:"privileged"` // When this parameter is `true` , a TTY is allocated. // // This parameter maps to `Tty` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--tty` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-pseudoterminal // PseudoTerminal interface{} `field:"optional" json:"pseudoTerminal" yaml:"pseudoTerminal"` // When this parameter is true, the container is given read-only access to its root file system. // // This parameter maps to `ReadonlyRootfs` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--read-only` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-readonlyrootfilesystem // ReadonlyRootFilesystem interface{} `field:"optional" json:"readonlyRootFilesystem" yaml:"readonlyRootFilesystem"` // The private repository authentication credentials to use. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-repositorycredentials // RepositoryCredentials interface{} `field:"optional" json:"repositoryCredentials" yaml:"repositoryCredentials"` // The type and amount of a resource to assign to a container. // // The only supported resource is a GPU. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-resourcerequirements // ResourceRequirements interface{} `field:"optional" json:"resourceRequirements" yaml:"resourceRequirements"` // The secrets to pass to the container. // // For more information, see [Specifying Sensitive Data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-secrets // Secrets interface{} `field:"optional" json:"secrets" yaml:"secrets"` // Time duration (in seconds) to wait before giving up on resolving dependencies for a container. // // For example, you specify two containers in a task definition with containerA having a dependency on containerB reaching a `COMPLETE` , `SUCCESS` , or `HEALTHY` status. If a `startTimeout` value is specified for containerB and it doesn't reach the desired status within that time then containerA gives up and not start. This results in the task transitioning to a `STOPPED` state. // // > When the `ECS_CONTAINER_START_TIMEOUT` container agent configuration variable is used, it's enforced independently from this start timeout value. // // For tasks using the Fargate launch type, the task or service requires the following platforms: // // - Linux platform version `1.3.0` or later. // - Windows platform version `1.0.0` or later. // // For tasks using the EC2 launch type, your container instances require at least version `1.26.0` of the container agent to use a container start timeout value. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version `1.26.0-1` of the `ecs-init` package. If your container instances are launched from version `20190301` or later, then they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic Container Service Developer Guide* . // // The valid values are 2-120 seconds. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-starttimeout // StartTimeout *float64 `field:"optional" json:"startTimeout" yaml:"startTimeout"` // Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. // // For tasks using the Fargate launch type, the task or service requires the following platforms: // // - Linux platform version `1.3.0` or later. // - Windows platform version `1.0.0` or later. // // The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds is used. // // For tasks that use the EC2 launch type, if the `stopTimeout` parameter isn't specified, the value set for the Amazon ECS container agent configuration variable `ECS_CONTAINER_STOP_TIMEOUT` is used. If neither the `stopTimeout` parameter or the `ECS_CONTAINER_STOP_TIMEOUT` agent configuration variable are set, then the default values of 30 seconds for Linux containers and 30 seconds on Windows containers are used. Your container instances require at least version 1.26.0 of the container agent to use a container stop timeout value. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the `ecs-init` package. If your container instances are launched from version `20190301` or later, then they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic Container Service Developer Guide* . // // The valid values are 2-120 seconds. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-stoptimeout // StopTimeout *float64 `field:"optional" json:"stopTimeout" yaml:"stopTimeout"` // A list of namespaced kernel parameters to set in the container. // // This parameter maps to `Sysctls` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--sysctl` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . For example, you can configure `net.ipv4.tcp_keepalive_time` setting to maintain longer lived connections. // // We don't recommend that you specify network-related `systemControls` parameters for multiple containers in a single task that also uses either the `awsvpc` or `host` network mode. Doing this has the following disadvantages: // // - For tasks that use the `awsvpc` network mode including Fargate, if you set `systemControls` for any container, it applies to all containers in the task. If you set different `systemControls` for multiple containers in a single task, the container that's started last determines which `systemControls` take effect. // - For tasks that use the `host` network mode, the network namespace `systemControls` aren't supported. // // If you're setting an IPC resource namespace to use for the containers in the task, the following conditions apply to your system controls. For more information, see [IPC mode](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_ipcmode) . // // - For tasks that use the `host` IPC mode, IPC namespace `systemControls` aren't supported. // - For tasks that use the `task` IPC mode, IPC namespace `systemControls` values apply to all containers within a task. // // > This parameter is not supported for Windows containers. > This parameter is only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version `1.4.0` or later (Linux). This isn't supported for Windows containers on Fargate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-systemcontrols // SystemControls interface{} `field:"optional" json:"systemControls" yaml:"systemControls"` // A list of `ulimits` to set in the container. // // This parameter maps to `Ulimits` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--ulimit` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/) . Valid naming values are displayed in the [Ulimit](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Ulimit.html) data type. This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-ulimits // Ulimits interface{} `field:"optional" json:"ulimits" yaml:"ulimits"` // The user to use inside the container. // // This parameter maps to `User` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--user` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > When running tasks using the `host` network mode, don't run containers using the root user (UID 0). We recommend using a non-root user for better security. // // You can specify the `user` using the following formats. If specifying a UID or GID, you must specify it as a positive integer. // // - `user` // - `user:group` // - `uid` // - `uid:gid` // - `user:gid` // - `uid:group` // // > This parameter is not supported for Windows containers. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-user // User *string `field:"optional" json:"user" yaml:"user"` // Data volumes to mount from another container. // // This parameter maps to `VolumesFrom` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--volumes-from` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-volumesfrom // VolumesFrom interface{} `field:"optional" json:"volumesFrom" yaml:"volumesFrom"` // The working directory to run commands inside the container in. // // This parameter maps to `WorkingDir` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--workdir` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-workingdirectory // WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
The `ContainerDefinition` property specifies a container definition.
Container definitions are used in task definitions to describe the different containers that are launched as part of a task.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" containerDefinitionProperty := &ContainerDefinitionProperty{ Image: jsii.String("image"), Name: jsii.String("name"), // the properties below are optional Command: []*string{ jsii.String("command"), }, Cpu: jsii.Number(123), DependsOn: []interface{}{ &ContainerDependencyProperty{ Condition: jsii.String("condition"), ContainerName: jsii.String("containerName"), }, }, DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, EnvironmentFiles: []interface{}{ &EnvironmentFileProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Essential: jsii.Boolean(false), ExtraHosts: []interface{}{ &HostEntryProperty{ Hostname: jsii.String("hostname"), IpAddress: jsii.String("ipAddress"), }, }, FirelensConfiguration: &FirelensConfigurationProperty{ Options: map[string]*string{ "optionsKey": jsii.String("options"), }, Type: jsii.String("type"), }, HealthCheck: &HealthCheckProperty{ Command: []*string{ jsii.String("command"), }, Interval: jsii.Number(123), Retries: jsii.Number(123), StartPeriod: jsii.Number(123), Timeout: jsii.Number(123), }, Hostname: jsii.String("hostname"), Interactive: jsii.Boolean(false), Links: []*string{ jsii.String("links"), }, LinuxParameters: &LinuxParametersProperty{ Capabilities: &KernelCapabilitiesProperty{ Add: []*string{ jsii.String("add"), }, Drop: []*string{ jsii.String("drop"), }, }, Devices: []interface{}{ &DeviceProperty{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), Permissions: []*string{ jsii.String("permissions"), }, }, }, InitProcessEnabled: jsii.Boolean(false), MaxSwap: jsii.Number(123), SharedMemorySize: jsii.Number(123), Swappiness: jsii.Number(123), Tmpfs: []interface{}{ &TmpfsProperty{ Size: jsii.Number(123), // the properties below are optional ContainerPath: jsii.String("containerPath"), MountOptions: []*string{ jsii.String("mountOptions"), }, }, }, }, LogConfiguration: &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), // the properties below are optional Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }, Memory: jsii.Number(123), MemoryReservation: jsii.Number(123), MountPoints: []interface{}{ &MountPointProperty{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), SourceVolume: jsii.String("sourceVolume"), }, }, PortMappings: []interface{}{ &PortMappingProperty{ AppProtocol: jsii.String("appProtocol"), ContainerPort: jsii.Number(123), ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: jsii.String("protocol"), }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), RepositoryCredentials: &RepositoryCredentialsProperty{ CredentialsParameter: jsii.String("credentialsParameter"), }, ResourceRequirements: []interface{}{ &ResourceRequirementProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }, }, Secrets: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, StartTimeout: jsii.Number(123), StopTimeout: jsii.Number(123), SystemControls: []interface{}{ &SystemControlProperty{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []interface{}{ &UlimitProperty{ HardLimit: jsii.Number(123), Name: jsii.String("name"), SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), VolumesFrom: []interface{}{ &VolumeFromProperty{ ReadOnly: jsii.Boolean(false), SourceContainer: jsii.String("sourceContainer"), }, }, WorkingDirectory: jsii.String("workingDirectory"), }
type CfnTaskDefinition_ContainerDependencyProperty ¶
type CfnTaskDefinition_ContainerDependencyProperty struct { // The dependency condition of the container. The following are the available conditions and their behavior:. // // - `START` - This condition emulates the behavior of links and volumes today. It validates that a dependent container is started before permitting other containers to start. // - `COMPLETE` - This condition validates that a dependent container runs to completion (exits) before permitting other containers to start. This can be useful for nonessential containers that run a script and then exit. This condition can't be set on an essential container. // - `SUCCESS` - This condition is the same as `COMPLETE` , but it also requires that the container exits with a `zero` status. This condition can't be set on an essential container. // - `HEALTHY` - This condition validates that the dependent container passes its Docker health check before permitting other containers to start. This requires that the dependent container has health checks configured. This condition is confirmed only at task startup. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdependency.html#cfn-ecs-taskdefinition-containerdependency-condition // Condition *string `field:"optional" json:"condition" yaml:"condition"` // The name of a container. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdependency.html#cfn-ecs-taskdefinition-containerdependency-containername // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` }
The `ContainerDependency` property specifies the dependencies defined for container startup and shutdown.
A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed.
Your Amazon ECS container instances require at least version 1.26.0 of the container agent to enable container dependencies. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic Container Service Developer Guide* . If you are using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the `ecs-init` package. If your container instances are launched from version `20190301` or later, then they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic Container Service Developer Guide* .
> For tasks using the Fargate launch type, this parameter requires that the task or service uses platform version 1.3.0 or later.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" containerDependencyProperty := &ContainerDependencyProperty{ Condition: jsii.String("condition"), ContainerName: jsii.String("containerName"), }
type CfnTaskDefinition_DeviceProperty ¶
type CfnTaskDefinition_DeviceProperty struct { // The path inside the container at which to expose the host device. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-containerpath // ContainerPath *string `field:"optional" json:"containerPath" yaml:"containerPath"` // The path for the device on the host container instance. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-hostpath // HostPath *string `field:"optional" json:"hostPath" yaml:"hostPath"` // The explicit permissions to provide to the container for the device. // // By default, the container has permissions for `read` , `write` , and `mknod` for the device. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-permissions // Permissions *[]*string `field:"optional" json:"permissions" yaml:"permissions"` }
The `Device` property specifies an object representing a container instance host device.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deviceProperty := &DeviceProperty{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), Permissions: []*string{ jsii.String("permissions"), }, }
type CfnTaskDefinition_DockerVolumeConfigurationProperty ¶
type CfnTaskDefinition_DockerVolumeConfigurationProperty struct { // If this value is `true` , the Docker volume is created if it doesn't already exist. // // > This field is only used if the `scope` is `shared` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-autoprovision // Autoprovision interface{} `field:"optional" json:"autoprovision" yaml:"autoprovision"` // The Docker volume driver to use. // // The driver value must match the driver name provided by Docker because it is used for task placement. If the driver was installed using the Docker plugin CLI, use `docker plugin ls` to retrieve the driver name from your container instance. If the driver was installed using another method, use Docker plugin discovery to retrieve the driver name. For more information, see [Docker plugin discovery](https://docs.aws.amazon.com/https://docs.docker.com/engine/extend/plugin_api/#plugin-discovery) . This parameter maps to `Driver` in the [Create a volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `xxdriver` option to [docker volume create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-driver // Driver *string `field:"optional" json:"driver" yaml:"driver"` // A map of Docker driver-specific options passed through. // // This parameter maps to `DriverOpts` in the [Create a volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `xxopt` option to [docker volume create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-driveropts // DriverOpts interface{} `field:"optional" json:"driverOpts" yaml:"driverOpts"` // Custom metadata to add to your Docker volume. // // This parameter maps to `Labels` in the [Create a volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `xxlabel` option to [docker volume create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-labels // Labels interface{} `field:"optional" json:"labels" yaml:"labels"` // The scope for the Docker volume that determines its lifecycle. // // Docker volumes that are scoped to a `task` are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped as `shared` persist after the task stops. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-scope // Scope *string `field:"optional" json:"scope" yaml:"scope"` }
The `DockerVolumeConfiguration` property specifies a Docker volume configuration and is used when you use Docker volumes.
Docker volumes are only supported when you are using the EC2 launch type. Windows containers only support the use of the `local` driver. To use bind mounts, specify a `host` instead.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dockerVolumeConfigurationProperty := &DockerVolumeConfigurationProperty{ Autoprovision: jsii.Boolean(false), Driver: jsii.String("driver"), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, Scope: jsii.String("scope"), }
type CfnTaskDefinition_EFSVolumeConfigurationProperty ¶ added in v2.21.0
type CfnTaskDefinition_EFSVolumeConfigurationProperty struct { // The Amazon EFS file system ID to use. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-efsvolumeconfiguration.html#cfn-ecs-taskdefinition-efsvolumeconfiguration-filesystemid // FilesystemId *string `field:"required" json:"filesystemId" yaml:"filesystemId"` // The authorization configuration details for the Amazon EFS file system. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-efsvolumeconfiguration.html#cfn-ecs-taskdefinition-efsvolumeconfiguration-authorizationconfig // AuthorizationConfig interface{} `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"` // The directory within the Amazon EFS file system to mount as the root directory inside the host. // // If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying `/` will have the same effect as omitting this parameter. // // > If an EFS access point is specified in the `authorizationConfig` , the root directory parameter must either be omitted or set to `/` which will enforce the path set on the EFS access point. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-efsvolumeconfiguration.html#cfn-ecs-taskdefinition-efsvolumeconfiguration-rootdirectory // RootDirectory *string `field:"optional" json:"rootDirectory" yaml:"rootDirectory"` // Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. // // Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this parameter is omitted, the default value of `DISABLED` is used. For more information, see [Encrypting data in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) in the *Amazon Elastic File System User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-efsvolumeconfiguration.html#cfn-ecs-taskdefinition-efsvolumeconfiguration-transitencryption // TransitEncryption *string `field:"optional" json:"transitEncryption" yaml:"transitEncryption"` // The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. // // If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses. For more information, see [EFS mount helper](https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html) in the *Amazon Elastic File System User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-efsvolumeconfiguration.html#cfn-ecs-taskdefinition-efsvolumeconfiguration-transitencryptionport // TransitEncryptionPort *float64 `field:"optional" json:"transitEncryptionPort" yaml:"transitEncryptionPort"` }
This parameter is specified when you're using an Amazon Elastic File System file system for task storage.
For more information, see [Amazon EFS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" eFSVolumeConfigurationProperty := &EFSVolumeConfigurationProperty{ FilesystemId: jsii.String("filesystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfigProperty{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }
type CfnTaskDefinition_EnvironmentFileProperty ¶
type CfnTaskDefinition_EnvironmentFileProperty struct { // The file type to use. // // The only supported value is `s3` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-environmentfile.html#cfn-ecs-taskdefinition-environmentfile-type // Type *string `field:"optional" json:"type" yaml:"type"` // The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment variable file. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-environmentfile.html#cfn-ecs-taskdefinition-environmentfile-value // Value *string `field:"optional" json:"value" yaml:"value"` }
A list of files containing the environment variables to pass to a container.
You can specify up to ten environment files. The file must have a `.env` file extension. Each line in an environment file should contain an environment variable in `VARIABLE=VALUE` format. Lines beginning with `#` are treated as comments and are ignored.
If there are environment variables specified using the `environment` parameter in a container definition, they take precedence over the variables contained within an environment file. If multiple environment files are specified that contain the same variable, they're processed from the top down. We recommend that you use unique variable names. For more information, see [Specifying environment variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon Elastic Container Service Developer Guide* .
You must use the following platforms for the Fargate launch type:
- Linux platform version `1.4.0` or later. - Windows platform version `1.0.0` or later.
Consider the following when using the Fargate launch type:
- The file is handled like a native Docker env-file. - There is no support for shell escape handling. - The container entry point interperts the `VARIABLE` values.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentFileProperty := &EnvironmentFileProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }
type CfnTaskDefinition_EphemeralStorageProperty ¶
type CfnTaskDefinition_EphemeralStorageProperty struct { // The total amount, in GiB, of ephemeral storage to set for the task. // // The minimum supported value is `21` GiB and the maximum supported value is `200` GiB. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ephemeralstorage.html#cfn-ecs-taskdefinition-ephemeralstorage-sizeingib // SizeInGiB *float64 `field:"optional" json:"sizeInGiB" yaml:"sizeInGiB"` }
The amount of ephemeral storage to allocate for the task.
This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate . For more information, see [Fargate task storage](https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html) in the *Amazon ECS User Guide for AWS Fargate* .
> For tasks using the Fargate launch type, the task requires the following platforms: > > - Linux platform version `1.4.0` or later. > - Windows platform version `1.0.0` or later.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" ephemeralStorageProperty := &EphemeralStorageProperty{ SizeInGiB: jsii.Number(123), }
type CfnTaskDefinition_FirelensConfigurationProperty ¶
type CfnTaskDefinition_FirelensConfigurationProperty struct { // The options to use when configuring the log router. // // This field is optional and can be used to add additional metadata, such as the task, task definition, cluster, and container instance details to the log event. // // If specified, valid option keys are: // // - `enable-ecs-log-metadata` , which can be `true` or `false` // - `config-file-type` , which can be `s3` or `file` // - `config-file-value` , which is either an S3 ARN or a file path. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-firelensconfiguration.html#cfn-ecs-taskdefinition-firelensconfiguration-options // Options interface{} `field:"optional" json:"options" yaml:"options"` // The log router to use. // // The valid values are `fluentd` or `fluentbit` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-firelensconfiguration.html#cfn-ecs-taskdefinition-firelensconfiguration-type // Type *string `field:"optional" json:"type" yaml:"type"` }
The FireLens configuration for the container.
This is used to specify and configure a log router for container logs. For more information, see [Custom log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" firelensConfigurationProperty := &FirelensConfigurationProperty{ Options: map[string]*string{ "optionsKey": jsii.String("options"), }, Type: jsii.String("type"), }
type CfnTaskDefinition_HealthCheckProperty ¶
type CfnTaskDefinition_HealthCheckProperty struct { // A string array representing the command that the container runs to determine if it is healthy. // // The string array must start with `CMD` to run the command arguments directly, or `CMD-SHELL` to run the command with the container's default shell. // // When you use the AWS Management Console JSON panel, the AWS Command Line Interface , or the APIs, enclose the list of commands in double quotes and brackets. // // `[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]` // // You don't include the double quotes and brackets when you use the AWS Management Console. // // `CMD-SHELL, curl -f http://localhost/ || exit 1` // // An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see `HealthCheck` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-command // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The time period in seconds between each health check execution. // // You may specify between 5 and 300 seconds. The default value is 30 seconds. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-interval // Interval *float64 `field:"optional" json:"interval" yaml:"interval"` // The number of times to retry a failed health check before the container is considered unhealthy. // // You may specify between 1 and 10 retries. The default value is 3. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-retries // Retries *float64 `field:"optional" json:"retries" yaml:"retries"` // The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. // // You can specify between 0 and 300 seconds. By default, the `startPeriod` is off. // // > If a health check succeeds within the `startPeriod` , then the container is considered healthy and any subsequent failures count toward the maximum number of retries. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-startperiod // StartPeriod *float64 `field:"optional" json:"startPeriod" yaml:"startPeriod"` // The time period in seconds to wait for a health check to succeed before it is considered a failure. // // You may specify between 2 and 60 seconds. The default value is 5. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-timeout // Timeout *float64 `field:"optional" json:"timeout" yaml:"timeout"` }
The `HealthCheck` property specifies an object representing a container health check.
Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image (such as those specified in a parent image or from the image's Dockerfile). This configuration maps to the `HEALTHCHECK` parameter of [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/) .
> The Amazon ECS container agent only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor Docker health checks that are embedded in a container image and not specified in the container definition. Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image.
If a task is run manually, and not as part of a service, the task will continue its lifecycle regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the task will be stopped and the service scheduler will replace it.
The following are notes about container health check support:
- Container health checks require version 1.17.0 or greater of the Amazon ECS container agent. For more information, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) . - Container health checks are supported for Fargate tasks if you are using platform version 1.1.0 or greater. For more information, see [AWS Fargate Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) . - Container health checks are not supported for tasks that are part of a service that is configured to use a Classic Load Balancer.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" healthCheckProperty := &HealthCheckProperty{ Command: []*string{ jsii.String("command"), }, Interval: jsii.Number(123), Retries: jsii.Number(123), StartPeriod: jsii.Number(123), Timeout: jsii.Number(123), }
type CfnTaskDefinition_HostEntryProperty ¶
type CfnTaskDefinition_HostEntryProperty struct { // The hostname to use in the `/etc/hosts` entry. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-hostentry.html#cfn-ecs-taskdefinition-hostentry-hostname // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // The IP address to use in the `/etc/hosts` entry. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-hostentry.html#cfn-ecs-taskdefinition-hostentry-ipaddress // IpAddress *string `field:"optional" json:"ipAddress" yaml:"ipAddress"` }
The `HostEntry` property specifies a hostname and an IP address that are added to the `/etc/hosts` file of a container through the `extraHosts` parameter of its `ContainerDefinition` resource.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" hostEntryProperty := &HostEntryProperty{ Hostname: jsii.String("hostname"), IpAddress: jsii.String("ipAddress"), }
type CfnTaskDefinition_HostVolumePropertiesProperty ¶
type CfnTaskDefinition_HostVolumePropertiesProperty struct { // When the `host` parameter is used, specify a `sourcePath` to declare the path on the host container instance that's presented to the container. // // If this parameter is empty, then the Docker daemon has assigned a host path for you. If the `host` parameter contains a `sourcePath` file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the `sourcePath` value doesn't exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported. // // If you're using the Fargate launch type, the `sourcePath` parameter is not supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-hostvolumeproperties.html#cfn-ecs-taskdefinition-hostvolumeproperties-sourcepath // SourcePath *string `field:"optional" json:"sourcePath" yaml:"sourcePath"` }
The `HostVolumeProperties` property specifies details on a container instance bind mount host volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" hostVolumePropertiesProperty := &HostVolumePropertiesProperty{ SourcePath: jsii.String("sourcePath"), }
type CfnTaskDefinition_InferenceAcceleratorProperty ¶
type CfnTaskDefinition_InferenceAcceleratorProperty struct { // The Elastic Inference accelerator device name. // // The `deviceName` must also be referenced in a container definition as a [ResourceRequirement](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ResourceRequirement.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-inferenceaccelerator.html#cfn-ecs-taskdefinition-inferenceaccelerator-devicename // DeviceName *string `field:"optional" json:"deviceName" yaml:"deviceName"` // The Elastic Inference accelerator type to use. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-inferenceaccelerator.html#cfn-ecs-taskdefinition-inferenceaccelerator-devicetype // DeviceType *string `field:"optional" json:"deviceType" yaml:"deviceType"` }
Details on an Elastic Inference accelerator.
For more information, see [Working with Amazon Elastic Inference on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" inferenceAcceleratorProperty := &InferenceAcceleratorProperty{ DeviceName: jsii.String("deviceName"), DeviceType: jsii.String("deviceType"), }
type CfnTaskDefinition_KernelCapabilitiesProperty ¶
type CfnTaskDefinition_KernelCapabilitiesProperty struct { // The Linux capabilities for the container that have been added to the default configuration provided by Docker. // // This parameter maps to `CapAdd` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--cap-add` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > Tasks launched on AWS Fargate only support adding the `SYS_PTRACE` kernel capability. // // Valid values: `"ALL" | "AUDIT_CONTROL" | "AUDIT_WRITE" | "BLOCK_SUSPEND" | "CHOWN" | "DAC_OVERRIDE" | "DAC_READ_SEARCH" | "FOWNER" | "FSETID" | "IPC_LOCK" | "IPC_OWNER" | "KILL" | "LEASE" | "LINUX_IMMUTABLE" | "MAC_ADMIN" | "MAC_OVERRIDE" | "MKNOD" | "NET_ADMIN" | "NET_BIND_SERVICE" | "NET_BROADCAST" | "NET_RAW" | "SETFCAP" | "SETGID" | "SETPCAP" | "SETUID" | "SYS_ADMIN" | "SYS_BOOT" | "SYS_CHROOT" | "SYS_MODULE" | "SYS_NICE" | "SYS_PACCT" | "SYS_PTRACE" | "SYS_RAWIO" | "SYS_RESOURCE" | "SYS_TIME" | "SYS_TTY_CONFIG" | "SYSLOG" | "WAKE_ALARM"`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-kernelcapabilities.html#cfn-ecs-taskdefinition-kernelcapabilities-add // Add *[]*string `field:"optional" json:"add" yaml:"add"` // The Linux capabilities for the container that have been removed from the default configuration provided by Docker. // // This parameter maps to `CapDrop` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--cap-drop` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // Valid values: `"ALL" | "AUDIT_CONTROL" | "AUDIT_WRITE" | "BLOCK_SUSPEND" | "CHOWN" | "DAC_OVERRIDE" | "DAC_READ_SEARCH" | "FOWNER" | "FSETID" | "IPC_LOCK" | "IPC_OWNER" | "KILL" | "LEASE" | "LINUX_IMMUTABLE" | "MAC_ADMIN" | "MAC_OVERRIDE" | "MKNOD" | "NET_ADMIN" | "NET_BIND_SERVICE" | "NET_BROADCAST" | "NET_RAW" | "SETFCAP" | "SETGID" | "SETPCAP" | "SETUID" | "SYS_ADMIN" | "SYS_BOOT" | "SYS_CHROOT" | "SYS_MODULE" | "SYS_NICE" | "SYS_PACCT" | "SYS_PTRACE" | "SYS_RAWIO" | "SYS_RESOURCE" | "SYS_TIME" | "SYS_TTY_CONFIG" | "SYSLOG" | "WAKE_ALARM"`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-kernelcapabilities.html#cfn-ecs-taskdefinition-kernelcapabilities-drop // Drop *[]*string `field:"optional" json:"drop" yaml:"drop"` }
The `KernelCapabilities` property specifies the Linux capabilities for the container that are added to or dropped from the default configuration that is provided by Docker.
For more information on the default capabilities and the non-default available capabilities, see [Runtime privilege and Linux capabilities](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) in the *Docker run reference* . For more detailed information on these Linux capabilities, see the [capabilities(7)](https://docs.aws.amazon.com/http://man7.org/linux/man-pages/man7/capabilities.7.html) Linux manual page.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" kernelCapabilitiesProperty := &KernelCapabilitiesProperty{ Add: []*string{ jsii.String("add"), }, Drop: []*string{ jsii.String("drop"), }, }
type CfnTaskDefinition_KeyValuePairProperty ¶
type CfnTaskDefinition_KeyValuePairProperty struct { // The name of the key-value pair. // // For environment variables, this is the name of the environment variable. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-keyvaluepair.html#cfn-ecs-taskdefinition-keyvaluepair-name // Name *string `field:"optional" json:"name" yaml:"name"` // The value of the key-value pair. // // For environment variables, this is the value of the environment variable. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-keyvaluepair.html#cfn-ecs-taskdefinition-keyvaluepair-value // Value *string `field:"optional" json:"value" yaml:"value"` }
A key-value pair object.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" keyValuePairProperty := &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }
type CfnTaskDefinition_LinuxParametersProperty ¶
type CfnTaskDefinition_LinuxParametersProperty struct { // The Linux capabilities for the container that are added to or dropped from the default configuration provided by Docker. // // > For tasks that use the Fargate launch type, `capabilities` is supported for all platform versions but the `add` parameter is only supported if using platform version 1.4.0 or later. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-capabilities // Capabilities interface{} `field:"optional" json:"capabilities" yaml:"capabilities"` // Any host devices to expose to the container. // // This parameter maps to `Devices` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--device` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > If you're using tasks that use the Fargate launch type, the `devices` parameter isn't supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-devices // Devices interface{} `field:"optional" json:"devices" yaml:"devices"` // Run an `init` process inside the container that forwards signals and reaps processes. // // This parameter maps to the `--init` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . This parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-initprocessenabled // InitProcessEnabled interface{} `field:"optional" json:"initProcessEnabled" yaml:"initProcessEnabled"` // The total amount of swap memory (in MiB) a container can use. // // This parameter will be translated to the `--memory-swap` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) where the value would be the sum of the container memory plus the `maxSwap` value. // // If a `maxSwap` value of `0` is specified, the container will not use swap. Accepted values are `0` or any positive integer. If the `maxSwap` parameter is omitted, the container will use the swap configuration for the container instance it is running on. A `maxSwap` value must be set for the `swappiness` parameter to be used. // // > If you're using tasks that use the Fargate launch type, the `maxSwap` parameter isn't supported. // > // > If you're using tasks on Amazon Linux 2023 the `swappiness` parameter isn't supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-maxswap // MaxSwap *float64 `field:"optional" json:"maxSwap" yaml:"maxSwap"` // // This parameter maps to the `--shm-size` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > If you are using tasks that use the Fargate launch type, the `sharedMemorySize` parameter is not supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-sharedmemorysize // SharedMemorySize *float64 `field:"optional" json:"sharedMemorySize" yaml:"sharedMemorySize"` // This allows you to tune a container's memory swappiness behavior. // // A `swappiness` value of `0` will cause swapping to not happen unless absolutely necessary. A `swappiness` value of `100` will cause pages to be swapped very aggressively. Accepted values are whole numbers between `0` and `100` . If the `swappiness` parameter is not specified, a default value of `60` is used. If a value is not specified for `maxSwap` then this parameter is ignored. This parameter maps to the `--memory-swappiness` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > If you're using tasks that use the Fargate launch type, the `swappiness` parameter isn't supported. // > // > If you're using tasks on Amazon Linux 2023 the `swappiness` parameter isn't supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-swappiness // Swappiness *float64 `field:"optional" json:"swappiness" yaml:"swappiness"` // The container path, mount options, and size (in MiB) of the tmpfs mount. // // This parameter maps to the `--tmpfs` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) . // // > If you're using tasks that use the Fargate launch type, the `tmpfs` parameter isn't supported. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-tmpfs // Tmpfs interface{} `field:"optional" json:"tmpfs" yaml:"tmpfs"` }
The Linux-specific options that are applied to the container, such as Linux [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" linuxParametersProperty := &LinuxParametersProperty{ Capabilities: &KernelCapabilitiesProperty{ Add: []*string{ jsii.String("add"), }, Drop: []*string{ jsii.String("drop"), }, }, Devices: []interface{}{ &DeviceProperty{ ContainerPath: jsii.String("containerPath"), HostPath: jsii.String("hostPath"), Permissions: []*string{ jsii.String("permissions"), }, }, }, InitProcessEnabled: jsii.Boolean(false), MaxSwap: jsii.Number(123), SharedMemorySize: jsii.Number(123), Swappiness: jsii.Number(123), Tmpfs: []interface{}{ &TmpfsProperty{ Size: jsii.Number(123), // the properties below are optional ContainerPath: jsii.String("containerPath"), MountOptions: []*string{ jsii.String("mountOptions"), }, }, }, }
type CfnTaskDefinition_LogConfigurationProperty ¶
type CfnTaskDefinition_LogConfigurationProperty struct { // The log driver to use for the container. // // For tasks on AWS Fargate , the supported log drivers are `awslogs` , `splunk` , and `awsfirelens` . // // For tasks hosted on Amazon EC2 instances, the supported log drivers are `awslogs` , `fluentd` , `gelf` , `json-file` , `journald` , `logentries` , `syslog` , `splunk` , and `awsfirelens` . // // For more information about using the `awslogs` log driver, see [Using the awslogs log driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic Container Service Developer Guide* . // // For more information about using the `awsfirelens` log driver, see [Custom log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic Container Service Developer Guide* . // // > If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-logconfiguration.html#cfn-ecs-taskdefinition-logconfiguration-logdriver // LogDriver *string `field:"required" json:"logDriver" yaml:"logDriver"` // The configuration options to send to the log driver. // // This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: `sudo docker version --format '{{.Server.APIVersion}}'` // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-logconfiguration.html#cfn-ecs-taskdefinition-logconfiguration-options // Options interface{} `field:"optional" json:"options" yaml:"options"` // The secrets to pass to the log configuration. // // For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-logconfiguration.html#cfn-ecs-taskdefinition-logconfiguration-secretoptions // SecretOptions interface{} `field:"optional" json:"secretOptions" yaml:"secretOptions"` }
The `LogConfiguration` property specifies log configuration options to send to a custom log driver for the container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" logConfigurationProperty := &LogConfigurationProperty{ LogDriver: jsii.String("logDriver"), // the properties below are optional Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []interface{}{ &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }
type CfnTaskDefinition_MountPointProperty ¶
type CfnTaskDefinition_MountPointProperty struct { // The path on the container to mount the host volume at. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-mountpoint.html#cfn-ecs-taskdefinition-mountpoint-containerpath // ContainerPath *string `field:"optional" json:"containerPath" yaml:"containerPath"` // If this value is `true` , the container has read-only access to the volume. // // If this value is `false` , then the container can write to the volume. The default value is `false` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-mountpoint.html#cfn-ecs-taskdefinition-mountpoint-readonly // ReadOnly interface{} `field:"optional" json:"readOnly" yaml:"readOnly"` // The name of the volume to mount. // // Must be a volume name referenced in the `name` parameter of task definition `volume` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-mountpoint.html#cfn-ecs-taskdefinition-mountpoint-sourcevolume // SourceVolume *string `field:"optional" json:"sourceVolume" yaml:"sourceVolume"` }
The details for a volume mount point that's used in a container definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" mountPointProperty := &MountPointProperty{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), SourceVolume: jsii.String("sourceVolume"), }
type CfnTaskDefinition_PortMappingProperty ¶
type CfnTaskDefinition_PortMappingProperty struct { // The application protocol that's used for the port mapping. // // This parameter only applies to Service Connect. We recommend that you set this parameter to be consistent with the protocol that your application uses. If you set this parameter, Amazon ECS adds protocol-specific connection handling to the Service Connect proxy. If you set this parameter, Amazon ECS adds protocol-specific telemetry in the Amazon ECS console and CloudWatch. // // If you don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add protocol-specific telemetry for TCP. // // `appProtocol` is immutable in a Service Connect service. Updating this field requires a service deletion and redeployment. // // Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-appprotocol // AppProtocol *string `field:"optional" json:"appProtocol" yaml:"appProtocol"` // The port number on the container that's bound to the user-specified or automatically assigned host port. // // If you use containers in a task with the `awsvpc` or `host` network mode, specify the exposed ports using `containerPort` . // // If you use containers in a task with the `bridge` network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range. For more information, see `hostPort` . Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-containerport // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The port number range on the container that's bound to the dynamically mapped host port range. // // The following rules apply when you specify a `containerPortRange` : // // - You must use either the `bridge` network mode or the `awsvpc` network mode. // - This parameter is available for both the EC2 and AWS Fargate launch types. // - This parameter is available for both the Linux and Windows operating systems. // - The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of the `ecs-init` package // - You can specify a maximum of 100 port ranges per container. // - You do not specify a `hostPortRange` . The value of the `hostPortRange` is set as follows: // // - For containers in a task with the `awsvpc` network mode, the `hostPortRange` is set to the same value as the `containerPortRange` . This is a static mapping strategy. // - For containers in a task with the `bridge` network mode, the Amazon ECS agent finds open host ports from the default ephemeral range and passes it to docker to bind them to the container ports. // - The `containerPortRange` valid values are between 1 and 65535. // - A port can only be included in one port mapping per container. // - You cannot specify overlapping port ranges. // - The first port in the range must be less than last port in the range. // - Docker recommends that you turn off the docker-proxy in the Docker daemon config file when you have a large number of ports. // // For more information, see [Issue #11185](https://docs.aws.amazon.com/https://github.com/moby/moby/issues/11185) on the Github website. // // For information about how to turn off the docker-proxy in the Docker daemon config file, see [Docker daemon](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html#bootstrap_docker_daemon) in the *Amazon ECS Developer Guide* . // // You can call [`DescribeTasks`](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) to view the `hostPortRange` which are the host ports that are bound to the container ports. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-containerportrange // ContainerPortRange *string `field:"optional" json:"containerPortRange" yaml:"containerPortRange"` // The port number on the container instance to reserve for your container. // // If you specify a `containerPortRange` , leave this field empty and the value of the `hostPort` is set as follows: // // - For containers in a task with the `awsvpc` network mode, the `hostPort` is set to the same value as the `containerPort` . This is a static mapping strategy. // - For containers in a task with the `bridge` network mode, the Amazon ECS agent finds open ports on the host and automatically binds them to the container ports. This is a dynamic mapping strategy. // // If you use containers in a task with the `awsvpc` or `host` network mode, the `hostPort` can either be left blank or set to the same value as the `containerPort` . // // If you use containers in a task with the `bridge` network mode, you can specify a non-reserved host port for your container port mapping, or you can omit the `hostPort` (or set it to `0` ) while specifying a `containerPort` and your container automatically receives a port in the ephemeral port range for your container instance operating system and Docker version. // // The default ephemeral port range for Docker version 1.6.0 and later is listed on the instance under `/proc/sys/net/ipv4/ip_local_port_range` . If this kernel parameter is unavailable, the default ephemeral port range from 49153 through 65535 (Linux) or 49152 through 65535 (Windows) is used. Do not attempt to specify a host port in the ephemeral port range as these are reserved for automatic assignment. In general, ports below 32768 are outside of the ephemeral port range. // // The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376, and the Amazon ECS container agent ports 51678-51680. Any host port that was previously specified in a running task is also reserved while the task is running. That is, after a task stops, the host port is released. The current reserved ports are displayed in the `remainingResources` of [DescribeContainerInstances](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html) output. A container instance can have up to 100 reserved ports at a time. This number includes the default reserved ports. Automatically assigned ports aren't included in the 100 reserved ports quota. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-hostport // HostPort *float64 `field:"optional" json:"hostPort" yaml:"hostPort"` // The name that's used for the port mapping. // // This parameter only applies to Service Connect. This parameter is the name that you use in the `serviceConnectConfiguration` of a service. The name can include up to 64 characters. The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen. // // For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-name // Name *string `field:"optional" json:"name" yaml:"name"` // The protocol used for the port mapping. // // Valid values are `tcp` and `udp` . The default is `tcp` . `protocol` is immutable in a Service Connect service. Updating this field requires a service deletion and redeployment. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-portmapping.html#cfn-ecs-taskdefinition-portmapping-protocol // Protocol *string `field:"optional" json:"protocol" yaml:"protocol"` }
The `PortMapping` property specifies a port mapping.
Port mappings allow containers to access ports on the host container instance to send or receive traffic. Port mappings are specified as part of the container definition.
If you are using containers in a task with the `awsvpc` or `host` network mode, exposed ports should be specified using `containerPort` . The `hostPort` can be left blank or it must be the same value as the `containerPort` .
After a task reaches the `RUNNING` status, manual and automatic host and container port assignments are visible in the `networkBindings` section of [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API responses.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" portMappingProperty := &PortMappingProperty{ AppProtocol: jsii.String("appProtocol"), ContainerPort: jsii.Number(123), ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: jsii.String("protocol"), }
type CfnTaskDefinition_ProxyConfigurationProperty ¶
type CfnTaskDefinition_ProxyConfigurationProperty struct { // The name of the container that will serve as the App Mesh proxy. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-proxyconfiguration.html#cfn-ecs-taskdefinition-proxyconfiguration-containername // ContainerName *string `field:"required" json:"containerName" yaml:"containerName"` // The set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified as key-value pairs. // // - `IgnoredUID` - (Required) The user ID (UID) of the proxy container as defined by the `user` parameter in a container definition. This is used to ensure the proxy ignores its own traffic. If `IgnoredGID` is specified, this field can be empty. // - `IgnoredGID` - (Required) The group ID (GID) of the proxy container as defined by the `user` parameter in a container definition. This is used to ensure the proxy ignores its own traffic. If `IgnoredUID` is specified, this field can be empty. // - `AppPorts` - (Required) The list of ports that the application uses. Network traffic to these ports is forwarded to the `ProxyIngressPort` and `ProxyEgressPort` . // - `ProxyIngressPort` - (Required) Specifies the port that incoming traffic to the `AppPorts` is directed to. // - `ProxyEgressPort` - (Required) Specifies the port that outgoing traffic from the `AppPorts` is directed to. // - `EgressIgnoredPorts` - (Required) The egress traffic going to the specified ports is ignored and not redirected to the `ProxyEgressPort` . It can be an empty list. // - `EgressIgnoredIPs` - (Required) The egress traffic going to the specified IP addresses is ignored and not redirected to the `ProxyEgressPort` . It can be an empty list. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-proxyconfiguration.html#cfn-ecs-taskdefinition-proxyconfiguration-proxyconfigurationproperties // ProxyConfigurationProperties interface{} `field:"optional" json:"proxyConfigurationProperties" yaml:"proxyConfigurationProperties"` // The proxy type. // // The only supported value is `APPMESH` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-proxyconfiguration.html#cfn-ecs-taskdefinition-proxyconfiguration-type // Type *string `field:"optional" json:"type" yaml:"type"` }
The configuration details for the App Mesh proxy.
For tasks that use the EC2 launch type, the container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the `ecs-init` package to use a proxy configuration. If your container instances are launched from the Amazon ECS optimized AMI version `20190301` or later, then they contain the required versions of the container agent and `ecs-init` . For more information, see [Amazon ECS-optimized Linux AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" proxyConfigurationProperty := &ProxyConfigurationProperty{ ContainerName: jsii.String("containerName"), // the properties below are optional ProxyConfigurationProperties: []interface{}{ &KeyValuePairProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, Type: jsii.String("type"), }
type CfnTaskDefinition_RepositoryCredentialsProperty ¶
type CfnTaskDefinition_RepositoryCredentialsProperty struct { // The Amazon Resource Name (ARN) of the secret containing the private repository credentials. // // > When you use the Amazon ECS API, AWS CLI , or AWS SDK, if the secret exists in the same Region as the task that you're launching then you can use either the full ARN or the name of the secret. When you use the AWS Management Console, you must specify the full ARN of the secret. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-repositorycredentials.html#cfn-ecs-taskdefinition-repositorycredentials-credentialsparameter // CredentialsParameter *string `field:"optional" json:"credentialsParameter" yaml:"credentialsParameter"` }
The repository credentials for private registry authentication.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" repositoryCredentialsProperty := &RepositoryCredentialsProperty{ CredentialsParameter: jsii.String("credentialsParameter"), }
type CfnTaskDefinition_ResourceRequirementProperty ¶
type CfnTaskDefinition_ResourceRequirementProperty struct { // The type of resource to assign to a container. // // The supported values are `GPU` or `InferenceAccelerator` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-resourcerequirement.html#cfn-ecs-taskdefinition-resourcerequirement-type // Type *string `field:"required" json:"type" yaml:"type"` // The value for the specified resource type. // // If the `GPU` type is used, the value is the number of physical `GPUs` the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all containers in a task can't exceed the number of available GPUs on the container instance that the task is launched on. // // If the `InferenceAccelerator` type is used, the `value` matches the `deviceName` for an [InferenceAccelerator](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_InferenceAccelerator.html) specified in a task definition. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-resourcerequirement.html#cfn-ecs-taskdefinition-resourcerequirement-value // Value *string `field:"required" json:"value" yaml:"value"` }
The type and amount of a resource to assign to a container.
The supported resource types are GPUs and Elastic Inference accelerators. For more information, see [Working with GPUs on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) or [Working with Amazon Elastic Inference on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) in the *Amazon Elastic Container Service Developer Guide*
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" resourceRequirementProperty := &ResourceRequirementProperty{ Type: jsii.String("type"), Value: jsii.String("value"), }
type CfnTaskDefinition_RuntimePlatformProperty ¶
type CfnTaskDefinition_RuntimePlatformProperty struct { // The CPU architecture. // // You can run your Linux tasks on an ARM-based platform by setting the value to `ARM64` . This option is available for tasks that run on Linux Amazon EC2 instance or Linux containers on Fargate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-runtimeplatform.html#cfn-ecs-taskdefinition-runtimeplatform-cpuarchitecture // CpuArchitecture *string `field:"optional" json:"cpuArchitecture" yaml:"cpuArchitecture"` // The operating system. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-runtimeplatform.html#cfn-ecs-taskdefinition-runtimeplatform-operatingsystemfamily // OperatingSystemFamily *string `field:"optional" json:"operatingSystemFamily" yaml:"operatingSystemFamily"` }
Information about the platform for the Amazon ECS service or task.
For more information about `RuntimePlatform` , see RuntimePlatform(https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#runtime-platform) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" runtimePlatformProperty := &RuntimePlatformProperty{ CpuArchitecture: jsii.String("cpuArchitecture"), OperatingSystemFamily: jsii.String("operatingSystemFamily"), }
type CfnTaskDefinition_SecretProperty ¶
type CfnTaskDefinition_SecretProperty struct { // The name of the secret. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-secret.html#cfn-ecs-taskdefinition-secret-name // Name *string `field:"required" json:"name" yaml:"name"` // The secret to expose to the container. // // The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. // // For information about the require AWS Identity and Access Management permissions, see [Required IAM permissions for Amazon ECS secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-iam) (for Secrets Manager) or [Required IAM permissions for Amazon ECS secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html) (for Systems Manager Parameter store) in the *Amazon Elastic Container Service Developer Guide* . // // > If the SSM Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-secret.html#cfn-ecs-taskdefinition-secret-valuefrom // ValueFrom *string `field:"required" json:"valueFrom" yaml:"valueFrom"` }
An object representing the secret to expose to your container.
Secrets can be exposed to a container in the following ways:
- To inject sensitive data into your containers as environment variables, use the `secrets` container definition parameter. - To reference sensitive information in the log configuration of a container, use the `secretOptions` container definition parameter.
For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" secretProperty := &SecretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }
type CfnTaskDefinition_SystemControlProperty ¶
type CfnTaskDefinition_SystemControlProperty struct { // The namespaced kernel parameter to set a `value` for. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-systemcontrol.html#cfn-ecs-taskdefinition-systemcontrol-namespace // Namespace *string `field:"optional" json:"namespace" yaml:"namespace"` // The namespaced kernel parameter to set a `value` for. // // Valid IPC namespace values: `"kernel.msgmax" | "kernel.msgmnb" | "kernel.msgmni" | "kernel.sem" | "kernel.shmall" | "kernel.shmmax" | "kernel.shmmni" | "kernel.shm_rmid_forced"` , and `Sysctls` that start with `"fs.mqueue.*"` // // Valid network namespace values: `Sysctls` that start with `"net.*"` // // All of these values are supported by Fargate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-systemcontrol.html#cfn-ecs-taskdefinition-systemcontrol-value // Value *string `field:"optional" json:"value" yaml:"value"` }
A list of namespaced kernel parameters to set in the container.
This parameter maps to `Sysctls` in the [Create a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the `--sysctl` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) .
We don't recommend that you specify network-related `systemControls` parameters for multiple containers in a single task. This task also uses either the `awsvpc` or `host` network mode. It does it for the following reasons.
- For tasks that use the `awsvpc` network mode, if you set `systemControls` for any container, it applies to all containers in the task. If you set different `systemControls` for multiple containers in a single task, the container that's started last determines which `systemControls` take effect. - For tasks that use the `host` network mode, the `systemControls` parameter applies to the container instance's kernel parameter and that of all containers of any tasks running on that container instance.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" systemControlProperty := &SystemControlProperty{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }
type CfnTaskDefinition_TaskDefinitionPlacementConstraintProperty ¶
type CfnTaskDefinition_TaskDefinitionPlacementConstraintProperty struct { // The type of constraint. // // The `MemberOf` constraint restricts selection to be from a group of valid candidates. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-taskdefinitionplacementconstraint.html#cfn-ecs-taskdefinition-taskdefinitionplacementconstraint-type // Type *string `field:"required" json:"type" yaml:"type"` // A cluster query language expression to apply to the constraint. // // For more information, see [Cluster query language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-taskdefinitionplacementconstraint.html#cfn-ecs-taskdefinition-taskdefinitionplacementconstraint-expression // Expression *string `field:"optional" json:"expression" yaml:"expression"` }
The constraint on task placement in the task definition.
For more information, see [Task placement constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the *Amazon Elastic Container Service Developer Guide* .
> Task placement constraints aren't supported for tasks run on AWS Fargate .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" taskDefinitionPlacementConstraintProperty := &TaskDefinitionPlacementConstraintProperty{ Type: jsii.String("type"), // the properties below are optional Expression: jsii.String("expression"), }
type CfnTaskDefinition_TmpfsProperty ¶
type CfnTaskDefinition_TmpfsProperty struct { // The maximum size (in MiB) of the tmpfs volume. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-size // Size *float64 `field:"required" json:"size" yaml:"size"` // The absolute file path where the tmpfs volume is to be mounted. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-containerpath // ContainerPath *string `field:"optional" json:"containerPath" yaml:"containerPath"` // The list of tmpfs volume mount options. // // Valid values: `"defaults" | "ro" | "rw" | "suid" | "nosuid" | "dev" | "nodev" | "exec" | "noexec" | "sync" | "async" | "dirsync" | "remount" | "mand" | "nomand" | "atime" | "noatime" | "diratime" | "nodiratime" | "bind" | "rbind" | "unbindable" | "runbindable" | "private" | "rprivate" | "shared" | "rshared" | "slave" | "rslave" | "relatime" | "norelatime" | "strictatime" | "nostrictatime" | "mode" | "uid" | "gid" | "nr_inodes" | "nr_blocks" | "mpol"`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-mountoptions // MountOptions *[]*string `field:"optional" json:"mountOptions" yaml:"mountOptions"` }
The container path, mount options, and size of the tmpfs mount.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" tmpfsProperty := &TmpfsProperty{ Size: jsii.Number(123), // the properties below are optional ContainerPath: jsii.String("containerPath"), MountOptions: []*string{ jsii.String("mountOptions"), }, }
type CfnTaskDefinition_UlimitProperty ¶
type CfnTaskDefinition_UlimitProperty struct { // The hard limit for the `ulimit` type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ulimit.html#cfn-ecs-taskdefinition-ulimit-hardlimit // HardLimit *float64 `field:"required" json:"hardLimit" yaml:"hardLimit"` // The `type` of the `ulimit` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ulimit.html#cfn-ecs-taskdefinition-ulimit-name // Name *string `field:"required" json:"name" yaml:"name"` // The soft limit for the `ulimit` type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ulimit.html#cfn-ecs-taskdefinition-ulimit-softlimit // SoftLimit *float64 `field:"required" json:"softLimit" yaml:"softLimit"` }
The `ulimit` settings to pass to the container.
Amazon ECS tasks hosted on AWS Fargate use the default resource limit values set by the operating system with the exception of the `nofile` resource limit parameter which AWS Fargate overrides. The `nofile` resource limit sets a restriction on the number of open files that a container can use. The default `nofile` soft limit is `1024` and the default hard limit is `65535` .
You can specify the `ulimit` settings for a container in a task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" ulimitProperty := &UlimitProperty{ HardLimit: jsii.Number(123), Name: jsii.String("name"), SoftLimit: jsii.Number(123), }
type CfnTaskDefinition_VolumeFromProperty ¶
type CfnTaskDefinition_VolumeFromProperty struct { // If this value is `true` , the container has read-only access to the volume. // // If this value is `false` , then the container can write to the volume. The default value is `false` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumefrom.html#cfn-ecs-taskdefinition-volumefrom-readonly // ReadOnly interface{} `field:"optional" json:"readOnly" yaml:"readOnly"` // The name of another container within the same task definition to mount volumes from. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumefrom.html#cfn-ecs-taskdefinition-volumefrom-sourcecontainer // SourceContainer *string `field:"optional" json:"sourceContainer" yaml:"sourceContainer"` }
Details on a data volume from another container in the same task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" volumeFromProperty := &VolumeFromProperty{ ReadOnly: jsii.Boolean(false), SourceContainer: jsii.String("sourceContainer"), }
type CfnTaskDefinition_VolumeProperty ¶
type CfnTaskDefinition_VolumeProperty struct { // Indicates whether the volume should be configured at launch time. // // This is used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task definition revision may only have one volume configured at launch in the volume configuration. // // To configure a volume at launch time, use this task definition revision and specify a `volumeConfigurations` object when calling the `CreateService` , `UpdateService` , `RunTask` or `StartTask` APIs. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volume.html#cfn-ecs-taskdefinition-volume-configuredatlaunch // ConfiguredAtLaunch interface{} `field:"optional" json:"configuredAtLaunch" yaml:"configuredAtLaunch"` // This parameter is specified when you use Docker volumes. // // Windows containers only support the use of the `local` driver. To use bind mounts, specify the `host` parameter instead. // // > Docker volumes aren't supported by tasks run on AWS Fargate . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volume.html#cfn-ecs-taskdefinition-volume-dockervolumeconfiguration // DockerVolumeConfiguration interface{} `field:"optional" json:"dockerVolumeConfiguration" yaml:"dockerVolumeConfiguration"` // This parameter is specified when you use an Amazon Elastic File System file system for task storage. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volume.html#cfn-ecs-taskdefinition-volume-efsvolumeconfiguration // EfsVolumeConfiguration interface{} `field:"optional" json:"efsVolumeConfiguration" yaml:"efsVolumeConfiguration"` // This parameter is specified when you use bind mount host volumes. // // The contents of the `host` parameter determine whether your bind mount host volume persists on the host container instance and where it's stored. If the `host` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop running. // // Windows containers can mount whole directories on the same drive as `$env:ProgramData` . Windows containers can't mount directories on a different drive, and mount point can't be across drives. For example, you can mount `C:\my\path:C:\my\path` and `D:\:D:\` , but not `D:\my\path:C:\my\path` or `D:\:C:\my\path` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volume.html#cfn-ecs-taskdefinition-volume-host // Host interface{} `field:"optional" json:"host" yaml:"host"` // The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. // // When using a volume configured at launch, the `name` is required and must also be specified as the volume name in the `ServiceVolumeConfiguration` or `TaskVolumeConfiguration` parameter when creating your service or standalone task. // // For all other types of volumes, this name is referenced in the `sourceVolume` parameter of the `mountPoints` object in the container definition. // // When a volume is using the `efsVolumeConfiguration` , the name is required. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volume.html#cfn-ecs-taskdefinition-volume-name // Name *string `field:"optional" json:"name" yaml:"name"` }
The data volume configuration for tasks launched using this task definition.
Specifying a volume configuration in a task definition is optional. The volume configuration may contain multiple volumes but only one volume configured at launch is supported. Each volume defined in the volume configuration may only specify a `name` and one of either `configuredAtLaunch` , `dockerVolumeConfiguration` , `efsVolumeConfiguration` , `fsxWindowsFileServerVolumeConfiguration` , or `host` . If an empty volume configuration is specified, by default Amazon ECS uses a host volume. For more information, see [Using data volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" volumeProperty := &VolumeProperty{ ConfiguredAtLaunch: jsii.Boolean(false), DockerVolumeConfiguration: &DockerVolumeConfigurationProperty{ Autoprovision: jsii.Boolean(false), Driver: jsii.String("driver"), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, Scope: jsii.String("scope"), }, EfsVolumeConfiguration: &EFSVolumeConfigurationProperty{ FilesystemId: jsii.String("filesystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfigProperty{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }, Host: &HostVolumePropertiesProperty{ SourcePath: jsii.String("sourcePath"), }, Name: jsii.String("name"), }
type CfnTaskSet ¶
type CfnTaskSet interface { awscdk.CfnResource awscdk.IInspectable // The ID of the task set. AttrId() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. Cluster() *string SetCluster(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // An optional non-unique tag that identifies this task set in external systems. ExternalId() *string SetExternalId(val *string) // The launch type that new tasks in the task set uses. LaunchType() *string SetLaunchType(val *string) // A load balancer object representing the load balancer to use with the task set. LoadBalancers() interface{} SetLoadBalancers(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The network configuration for the task set. NetworkConfiguration() interface{} SetNetworkConfiguration(val interface{}) // The tree node. Node() constructs.Node // The platform version that the tasks in the task set uses. PlatformVersion() *string SetPlatformVersion(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // A floating-point percentage of your desired number of tasks to place and keep running in the task set. Scale() interface{} SetScale(val interface{}) // The short name or full Amazon Resource Name (ARN) of the service to create the task set in. Service() *string SetService(val *string) // The details of the service discovery registries to assign to this task set. ServiceRegistries() interface{} SetServiceRegistries(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The task definition for the tasks in the task set to use. TaskDefinition() *string SetTaskDefinition(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Create a task set in the specified cluster and service.
This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide* .
For information about the maximum number of task sets and otther quotas, see [Amazon ECS service quotas](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTaskSet := awscdk.Aws_ecs.NewCfnTaskSet(this, jsii.String("MyCfnTaskSet"), &CfnTaskSetProps{ Cluster: jsii.String("cluster"), Service: jsii.String("service"), TaskDefinition: jsii.String("taskDefinition"), // the properties below are optional ExternalId: jsii.String("externalId"), LaunchType: jsii.String("launchType"), LoadBalancers: []interface{}{ &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), TargetGroupArn: jsii.String("targetGroupArn"), }, }, NetworkConfiguration: &NetworkConfigurationProperty{ AwsVpcConfiguration: &AwsVpcConfigurationProperty{ Subnets: []*string{ jsii.String("subnets"), }, // the properties below are optional AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, }, }, PlatformVersion: jsii.String("platformVersion"), Scale: &ScaleProperty{ Unit: jsii.String("unit"), Value: jsii.Number(123), }, ServiceRegistries: []interface{}{ &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html
func NewCfnTaskSet ¶
func NewCfnTaskSet(scope constructs.Construct, id *string, props *CfnTaskSetProps) CfnTaskSet
type CfnTaskSetProps ¶
type CfnTaskSetProps struct { // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-cluster // Cluster *string `field:"required" json:"cluster" yaml:"cluster"` // The short name or full Amazon Resource Name (ARN) of the service to create the task set in. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-service // Service *string `field:"required" json:"service" yaml:"service"` // The task definition for the tasks in the task set to use. // // If a revision isn't specified, the latest `ACTIVE` revision is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-taskdefinition // TaskDefinition *string `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // An optional non-unique tag that identifies this task set in external systems. // // If the task set is associated with a service discovery registry, the tasks in this task set will have the `ECS_TASK_SET_EXTERNAL_ID` AWS Cloud Map attribute set to the provided value. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-externalid // ExternalId *string `field:"optional" json:"externalId" yaml:"externalId"` // The launch type that new tasks in the task set uses. // // For more information, see [Amazon ECS launch types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide* . // // If a `launchType` is specified, the `capacityProviderStrategy` parameter must be omitted. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-launchtype // LaunchType *string `field:"optional" json:"launchType" yaml:"launchType"` // A load balancer object representing the load balancer to use with the task set. // // The supported load balancer types are either an Application Load Balancer or a Network Load Balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-loadbalancers // LoadBalancers interface{} `field:"optional" json:"loadBalancers" yaml:"loadBalancers"` // The network configuration for the task set. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-networkconfiguration // NetworkConfiguration interface{} `field:"optional" json:"networkConfiguration" yaml:"networkConfiguration"` // The platform version that the tasks in the task set uses. // // A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the `LATEST` platform version is used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-platformversion // PlatformVersion *string `field:"optional" json:"platformVersion" yaml:"platformVersion"` // A floating-point percentage of your desired number of tasks to place and keep running in the task set. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-scale // Scale interface{} `field:"optional" json:"scale" yaml:"scale"` // The details of the service discovery registries to assign to this task set. // // For more information, see [Service discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html#cfn-ecs-taskset-serviceregistries // ServiceRegistries interface{} `field:"optional" json:"serviceRegistries" yaml:"serviceRegistries"` }
Properties for defining a `CfnTaskSet`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTaskSetProps := &CfnTaskSetProps{ Cluster: jsii.String("cluster"), Service: jsii.String("service"), TaskDefinition: jsii.String("taskDefinition"), // the properties below are optional ExternalId: jsii.String("externalId"), LaunchType: jsii.String("launchType"), LoadBalancers: []interface{}{ &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), TargetGroupArn: jsii.String("targetGroupArn"), }, }, NetworkConfiguration: &NetworkConfigurationProperty{ AwsVpcConfiguration: &AwsVpcConfigurationProperty{ Subnets: []*string{ jsii.String("subnets"), }, // the properties below are optional AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, }, }, PlatformVersion: jsii.String("platformVersion"), Scale: &ScaleProperty{ Unit: jsii.String("unit"), Value: jsii.Number(123), }, ServiceRegistries: []interface{}{ &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html
type CfnTaskSet_AwsVpcConfigurationProperty ¶
type CfnTaskSet_AwsVpcConfigurationProperty struct { // The IDs of the subnets associated with the task or service. // // There's a limit of 16 subnets that can be specified per `AwsVpcConfiguration` . // // > All specified subnets must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-awsvpcconfiguration.html#cfn-ecs-taskset-awsvpcconfiguration-subnets // Subnets *[]*string `field:"required" json:"subnets" yaml:"subnets"` // Whether the task's elastic network interface receives a public IP address. // // The default value is `DISABLED` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-awsvpcconfiguration.html#cfn-ecs-taskset-awsvpcconfiguration-assignpublicip // AssignPublicIp *string `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"` // The IDs of the security groups associated with the task or service. // // If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified per `AwsVpcConfiguration` . // // > All specified security groups must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-awsvpcconfiguration.html#cfn-ecs-taskset-awsvpcconfiguration-securitygroups // SecurityGroups *[]*string `field:"optional" json:"securityGroups" yaml:"securityGroups"` }
An object representing the networking details for a task or service.
For example `awsvpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]}`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" awsVpcConfigurationProperty := &AwsVpcConfigurationProperty{ Subnets: []*string{ jsii.String("subnets"), }, // the properties below are optional AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, }
type CfnTaskSet_LoadBalancerProperty ¶
type CfnTaskSet_LoadBalancerProperty struct { // The name of the container (as it appears in a container definition) to associate with the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-loadbalancer.html#cfn-ecs-taskset-loadbalancer-containername // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The port on the container to associate with the load balancer. // // This port must correspond to a `containerPort` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the `hostPort` of the port mapping. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-loadbalancer.html#cfn-ecs-taskset-loadbalancer-containerport // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set. // // A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer. // // For services using the `ECS` deployment controller, you can specify one or multiple target groups. For more information, see [Registering multiple target groups with a service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the *Amazon Elastic Container Service Developer Guide* . // // For services using the `CODE_DEPLOY` deployment controller, you're required to define two target groups for the load balancer. For more information, see [Blue/green deployment with CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the *Amazon Elastic Container Service Developer Guide* . // // > If your service's task definition uses the `awsvpc` network mode, you must choose `ip` as the target type, not `instance` . Do this when creating your target groups because tasks that use the `awsvpc` network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-loadbalancer.html#cfn-ecs-taskset-loadbalancer-targetgrouparn // TargetGroupArn *string `field:"optional" json:"targetGroupArn" yaml:"targetGroupArn"` }
The load balancer configuration to use with a service or task set.
When you add, update, or remove a load balancer configuration, Amazon ECS starts a new deployment with the updated Elastic Load Balancing configuration. This causes tasks to register to and deregister from load balancers.
We recommend that you verify this on a test environment before you update the Elastic Load Balancing configuration.
A service-linked role is required for services that use multiple target groups. For more information, see [Using service-linked roles](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" loadBalancerProperty := &LoadBalancerProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), TargetGroupArn: jsii.String("targetGroupArn"), }
type CfnTaskSet_NetworkConfigurationProperty ¶
type CfnTaskSet_NetworkConfigurationProperty struct { // The VPC subnets and security groups that are associated with a task. // // > All specified subnets and security groups must be from the same VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-networkconfiguration.html#cfn-ecs-taskset-networkconfiguration-awsvpcconfiguration // AwsVpcConfiguration interface{} `field:"optional" json:"awsVpcConfiguration" yaml:"awsVpcConfiguration"` }
The network configuration for a task or service.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" networkConfigurationProperty := &NetworkConfigurationProperty{ AwsVpcConfiguration: &AwsVpcConfigurationProperty{ Subnets: []*string{ jsii.String("subnets"), }, // the properties below are optional AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, }, }
type CfnTaskSet_ScaleProperty ¶
type CfnTaskSet_ScaleProperty struct { // The unit of measure for the scale value. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-scale.html#cfn-ecs-taskset-scale-unit // Unit *string `field:"optional" json:"unit" yaml:"unit"` // The value, specified as a percent total of a service's `desiredCount` , to scale the task set. // // Accepted values are numbers between 0 and 100. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-scale.html#cfn-ecs-taskset-scale-value // Value *float64 `field:"optional" json:"value" yaml:"value"` }
A floating-point percentage of the desired number of tasks to place and keep running in the task set.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" scaleProperty := &ScaleProperty{ Unit: jsii.String("unit"), Value: jsii.Number(123), }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-scale.html
type CfnTaskSet_ServiceRegistryProperty ¶
type CfnTaskSet_ServiceRegistryProperty struct { // The container name value to be used for your service discovery service. // // It's already specified in the task definition. If the task definition that your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition that your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-serviceregistry.html#cfn-ecs-taskset-serviceregistry-containername // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The port value to be used for your service discovery service. // // It's already specified in the task definition. If the task definition your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-serviceregistry.html#cfn-ecs-taskset-serviceregistry-containerport // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The port value used if your service discovery service specified an SRV record. // // This field might be used if both the `awsvpc` network mode and SRV records are used. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-serviceregistry.html#cfn-ecs-taskset-serviceregistry-port // Port *float64 `field:"optional" json:"port" yaml:"port"` // The Amazon Resource Name (ARN) of the service registry. // // The currently supported service registry is AWS Cloud Map . For more information, see [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-serviceregistry.html#cfn-ecs-taskset-serviceregistry-registryarn // RegistryArn *string `field:"optional" json:"registryArn" yaml:"registryArn"` }
The details for the service registry.
Each service may be associated with one service registry. Multiple service registries for each service are not supported.
When you add, update, or remove the service registries configuration, Amazon ECS starts a new deployment. New tasks are registered and deregistered to the updated service registry configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceRegistryProperty := &ServiceRegistryProperty{ ContainerName: jsii.String("containerName"), ContainerPort: jsii.Number(123), Port: jsii.Number(123), RegistryArn: jsii.String("registryArn"), }
type CloudMapNamespaceOptions ¶
type CloudMapNamespaceOptions struct { // The name of the namespace, such as example.com. Name *string `field:"required" json:"name" yaml:"name"` // The type of CloudMap Namespace to create. // Default: PrivateDns. // Type awsservicediscovery.NamespaceType `field:"optional" json:"type" yaml:"type"` // This property specifies whether to set the provided namespace as the service connect default in the cluster properties. // Default: false. // UseForServiceConnect *bool `field:"optional" json:"useForServiceConnect" yaml:"useForServiceConnect"` // The VPC to associate the namespace with. // // This property is required for private DNS namespaces. // Default: VPC of the cluster for Private DNS Namespace, otherwise none. // Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` }
The options for creating an AWS Cloud Map namespace.
Example:
var cluster cluster var taskDefinition taskDefinition var containerOptions containerDefinitionOptions container := taskDefinition.AddContainer(jsii.String("MyContainer"), containerOptions) container.AddPortMappings(&PortMapping{ Name: jsii.String("api"), ContainerPort: jsii.Number(8080), }) cluster.AddDefaultCloudMapNamespace(&CloudMapNamespaceOptions{ Name: jsii.String("local"), }) service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, ServiceConnectConfiguration: &ServiceConnectProps{ Services: []serviceConnectService{ &serviceConnectService{ PortMappingName: jsii.String("api"), DnsName: jsii.String("http-api"), Port: jsii.Number(80), }, }, }, })
type CloudMapOptions ¶
type CloudMapOptions struct { // The service discovery namespace for the Cloud Map service to attach to the ECS service. // Default: - the defaultCloudMapNamespace associated to the cluster. // CloudMapNamespace awsservicediscovery.INamespace `field:"optional" json:"cloudMapNamespace" yaml:"cloudMapNamespace"` // The container to point to for a SRV record. // Default: - the task definition's default container. // Container ContainerDefinition `field:"optional" json:"container" yaml:"container"` // The port to point to for a SRV record. // Default: - the default port of the task definition's default container. // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The DNS record type that you want AWS Cloud Map to create. // // The supported record types are A or SRV. // Default: - DnsRecordType.A if TaskDefinition.networkMode = AWS_VPC, otherwise DnsRecordType.SRV // DnsRecordType awsservicediscovery.DnsRecordType `field:"optional" json:"dnsRecordType" yaml:"dnsRecordType"` // The amount of time that you want DNS resolvers to cache the settings for this record. // Default: Duration.minutes(1) // DnsTtl awscdk.Duration `field:"optional" json:"dnsTtl" yaml:"dnsTtl"` // The number of 30-second intervals that you want Cloud Map to wait after receiving an UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. // // NOTE: This is used for HealthCheckCustomConfig. FailureThreshold *float64 `field:"optional" json:"failureThreshold" yaml:"failureThreshold"` // The name of the Cloud Map service to attach to the ECS service. // Default: CloudFormation-generated name. // Name *string `field:"optional" json:"name" yaml:"name"` }
The options to enabling AWS Cloud Map for an Amazon ECS service.
Example:
var taskDefinition taskDefinition var cluster cluster service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CloudMapOptions: &CloudMapOptions{ // Create A records - useful for AWSVPC network mode. DnsRecordType: cloudmap.DnsRecordType_A, }, })
type Cluster ¶
type Cluster interface { awscdk.Resource ICluster // Getter for autoscaling group added to cluster. AutoscalingGroup() awsautoscaling.IAutoScalingGroup // Getter for _capacityProviderNames added to cluster. CapacityProviderNames() *[]*string // The Amazon Resource Name (ARN) that identifies the cluster. ClusterArn() *string // The name of the cluster. ClusterName() *string // Manage the allowed network connections for the cluster with Security Groups. Connections() awsec2.Connections // Getter for _defaultCapacityProviderStrategy. // // This is necessary to correctly create Capacity Provider Associations. DefaultCapacityProviderStrategy() *[]*CapacityProviderStrategy // Getter for namespace added to cluster. DefaultCloudMapNamespace() awsservicediscovery.INamespace // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // Getter for execute command configuration associated with the cluster. ExecuteCommandConfiguration() *ExecuteCommandConfiguration // Whether the cluster has EC2 capacity associated with it. HasEc2Capacity() *bool // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // The VPC associated with the cluster. Vpc() awsec2.IVpc // This method adds an Auto Scaling Group Capacity Provider to a cluster. AddAsgCapacityProvider(provider AsgCapacityProvider, options *AddAutoScalingGroupCapacityOptions) // It is highly recommended to use `Cluster.addAsgCapacityProvider` instead of this method. // // This method adds compute capacity to a cluster by creating an AutoScalingGroup with the specified options. // // Returns the AutoScalingGroup so you can add autoscaling settings to it. AddCapacity(id *string, options *AddCapacityOptions) awsautoscaling.AutoScalingGroup // Add default capacity provider strategy for this cluster. AddDefaultCapacityProviderStrategy(defaultCapacityProviderStrategy *[]*CapacityProviderStrategy) // Add an AWS Cloud Map DNS namespace for this cluster. // // NOTE: HttpNamespaces are supported only for use cases involving Service Connect. For use cases involving both Service- // Discovery and Service Connect, customers should manage the HttpNamespace outside of the Cluster.addDefaultCloudMapNamespace method. AddDefaultCloudMapNamespace(options *CloudMapNamespaceOptions) awsservicediscovery.INamespace // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns an ARN that represents all tasks within the cluster that match the task pattern specified. // // To represent all tasks, specify “"*"“. ArnForTasks(keyPattern *string) *string // Enable the Fargate capacity providers for this cluster. EnableFargateCapacityProviders() GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grants an ECS Task Protection API permission to the specified grantee. // // This method provides a streamlined way to assign the 'ecs:UpdateTaskProtection' // permission, enabling the grantee to manage task protection in the ECS cluster. GrantTaskProtection(grantee awsiam.IGrantable) awsiam.Grant // This method returns the specifed CloudWatch metric for this cluster. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this clusters CPU reservation. // Default: average over 5 minutes. // MetricCpuReservation(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this clusters CPU utilization. // Default: average over 5 minutes. // MetricCpuUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this clusters memory reservation. // Default: average over 5 minutes. // MetricMemoryReservation(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this clusters memory utilization. // Default: average over 5 minutes. // MetricMemoryUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. ToString() *string }
A regional grouping of one or more container instances on which you can run tasks and services.
Example:
var vpc vpc cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, }) autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ Vpc: Vpc, InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux2(), MinCapacity: jsii.Number(0), MaxCapacity: jsii.Number(100), }) capacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String("AsgCapacityProvider"), &AsgCapacityProviderProps{ AutoScalingGroup: AutoScalingGroup, InstanceWarmupPeriod: jsii.Number(300), }) cluster.AddAsgCapacityProvider(capacityProvider) taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryReservationMiB: jsii.Number(256), }) ecs.NewEc2Service(this, jsii.String("EC2Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CapacityProviderStrategies: []capacityProviderStrategy{ &capacityProviderStrategy{ CapacityProvider: capacityProvider.CapacityProviderName, Weight: jsii.Number(1), }, }, })
func NewCluster ¶
func NewCluster(scope constructs.Construct, id *string, props *ClusterProps) Cluster
Constructs a new instance of the Cluster class.
type ClusterAttributes ¶
type ClusterAttributes struct { // The name of the cluster. ClusterName *string `field:"required" json:"clusterName" yaml:"clusterName"` // The VPC associated with the cluster. Vpc awsec2.IVpc `field:"required" json:"vpc" yaml:"vpc"` // Autoscaling group added to the cluster if capacity is added. // Default: - No default autoscaling group. // AutoscalingGroup awsautoscaling.IAutoScalingGroup `field:"optional" json:"autoscalingGroup" yaml:"autoscalingGroup"` // The Amazon Resource Name (ARN) that identifies the cluster. // Default: Derived from clusterName. // ClusterArn *string `field:"optional" json:"clusterArn" yaml:"clusterArn"` // The AWS Cloud Map namespace to associate with the cluster. // Default: - No default namespace. // DefaultCloudMapNamespace awsservicediscovery.INamespace `field:"optional" json:"defaultCloudMapNamespace" yaml:"defaultCloudMapNamespace"` // The execute command configuration for the cluster. // Default: - none. // ExecuteCommandConfiguration *ExecuteCommandConfiguration `field:"optional" json:"executeCommandConfiguration" yaml:"executeCommandConfiguration"` // Specifies whether the cluster has EC2 instance capacity. // Default: true. // HasEc2Capacity *bool `field:"optional" json:"hasEc2Capacity" yaml:"hasEc2Capacity"` // The security groups associated with the container instances registered to the cluster. // Default: - no security groups. // SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` }
The properties to import from the ECS cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var autoScalingGroup autoScalingGroup var bucket bucket var key key var logGroup logGroup var namespace iNamespace var securityGroup securityGroup var vpc vpc clusterAttributes := &ClusterAttributes{ ClusterName: jsii.String("clusterName"), Vpc: vpc, // the properties below are optional AutoscalingGroup: autoScalingGroup, ClusterArn: jsii.String("clusterArn"), DefaultCloudMapNamespace: namespace, ExecuteCommandConfiguration: &ExecuteCommandConfiguration{ KmsKey: key, LogConfiguration: &ExecuteCommandLogConfiguration{ CloudWatchEncryptionEnabled: jsii.Boolean(false), CloudWatchLogGroup: logGroup, S3Bucket: bucket, S3EncryptionEnabled: jsii.Boolean(false), S3KeyPrefix: jsii.String("s3KeyPrefix"), }, Logging: awscdk.Aws_ecs.ExecuteCommandLogging_NONE, }, HasEc2Capacity: jsii.Boolean(false), SecurityGroups: []iSecurityGroup{ securityGroup, }, }
type ClusterProps ¶
type ClusterProps struct { // The ec2 capacity to add to the cluster. // Default: - no EC2 capacity will be added, you can use `addCapacity` to add capacity later. // Capacity *AddCapacityOptions `field:"optional" json:"capacity" yaml:"capacity"` // The name for the cluster. // Default: CloudFormation-generated name. // ClusterName *string `field:"optional" json:"clusterName" yaml:"clusterName"` // If true CloudWatch Container Insights will be enabled for the cluster. // Default: - Container Insights will be disabled for this cluster. // ContainerInsights *bool `field:"optional" json:"containerInsights" yaml:"containerInsights"` // The service discovery namespace created in this cluster. // Default: - no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a // default service discovery namespace later. // DefaultCloudMapNamespace *CloudMapNamespaceOptions `field:"optional" json:"defaultCloudMapNamespace" yaml:"defaultCloudMapNamespace"` // Whether to enable Fargate Capacity Providers. // Default: false. // EnableFargateCapacityProviders *bool `field:"optional" json:"enableFargateCapacityProviders" yaml:"enableFargateCapacityProviders"` // The execute command configuration for the cluster. // Default: - no configuration will be provided. // ExecuteCommandConfiguration *ExecuteCommandConfiguration `field:"optional" json:"executeCommandConfiguration" yaml:"executeCommandConfiguration"` // The VPC where your ECS instances will be running or your ENIs will be deployed. // Default: - creates a new VPC with two AZs. // Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` }
The properties used to define an ECS cluster.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("FargateCluster"), &ClusterProps{ Vpc: Vpc, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ MemoryMiB: jsii.String("512"), Cpu: jsii.String("256"), Compatibility: ecs.Compatibility_FARGATE, }) containerDefinition := taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("RunFargate"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, AssignPublicIp: jsii.Boolean(true), ContainerOverrides: []containerOverride{ &containerOverride{ ContainerDefinition: *ContainerDefinition, Environment: []taskEnvironmentVariable{ &taskEnvironmentVariable{ Name: jsii.String("SOME_KEY"), Value: sfn.JsonPath_StringAt(jsii.String("$.SomeKey")), }, }, }, }, LaunchTarget: tasks.NewEcsFargateLaunchTarget(), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
type CommonTaskDefinitionAttributes ¶
type CommonTaskDefinitionAttributes struct { // The arn of the task definition. TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"` // The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. // // Some tasks do not have an execution role. // Default: - undefined. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The networking mode to use for the containers in the task. // Default: Network mode cannot be provided to the imported task. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: Permissions cannot be granted to the imported task. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` }
The common task definition attributes used across all types of task definitions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role commonTaskDefinitionAttributes := &CommonTaskDefinitionAttributes{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional ExecutionRole: role, NetworkMode: awscdk.Aws_ecs.NetworkMode_NONE, TaskRole: role, }
type CommonTaskDefinitionProps ¶
type CommonTaskDefinitionProps struct { // The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. // // The role will be used to retrieve container images from ECR and create CloudWatch log groups. // Default: - An execution role will be automatically created if you use ECR images in your task definition. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. // Default: - Automatically generated name. // Family *string `field:"optional" json:"family" yaml:"family"` // The configuration details for the App Mesh proxy. // Default: - No proxy configuration. // ProxyConfiguration ProxyConfiguration `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // The list of volume definitions for the task. // // For more information, see // [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes). // Default: - No volumes are passed to the Docker daemon on a container instance. // Volumes *[]*Volume `field:"optional" json:"volumes" yaml:"volumes"` }
The common properties for all task definitions.
For more information, see [Task Definition Parameters](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html).
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var proxyConfiguration proxyConfiguration var role role commonTaskDefinitionProps := &CommonTaskDefinitionProps{ ExecutionRole: role, Family: jsii.String("family"), ProxyConfiguration: proxyConfiguration, TaskRole: role, Volumes: []volume{ &volume{ Name: jsii.String("name"), // the properties below are optional ConfiguredAtLaunch: jsii.Boolean(false), DockerVolumeConfiguration: &DockerVolumeConfiguration{ Driver: jsii.String("driver"), Scope: awscdk.Aws_ecs.Scope_TASK, // the properties below are optional Autoprovision: jsii.Boolean(false), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, }, EfsVolumeConfiguration: &EfsVolumeConfiguration{ FileSystemId: jsii.String("fileSystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfig{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }, Host: &Host{ SourcePath: jsii.String("sourcePath"), }, }, }, }
type Compatibility ¶
type Compatibility string
The task launch type compatibility requirement.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("Ec2Cluster"), &ClusterProps{ Vpc: Vpc, }) cluster.AddCapacity(jsii.String("DefaultAutoScalingGroup"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), VpcSubnets: &SubnetSelection{ SubnetType: ec2.SubnetType_PUBLIC, }, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ Compatibility: ecs.Compatibility_EC2, }) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("Run"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, LaunchTarget: tasks.NewEcsEc2LaunchTarget(&EcsEc2LaunchTargetOptions{ PlacementStrategies: []placementStrategy{ ecs.*placementStrategy_SpreadAcrossInstances(), ecs.*placementStrategy_PackedByCpu(), ecs.*placementStrategy_Randomly(), }, PlacementConstraints: []placementConstraint{ ecs.*placementConstraint_MemberOf(jsii.String("blieptuut")), }, }), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
const ( // The task should specify the EC2 launch type. Compatibility_EC2 Compatibility = "EC2" // The task should specify the Fargate launch type. Compatibility_FARGATE Compatibility = "FARGATE" // The task can specify either the EC2 or Fargate launch types. Compatibility_EC2_AND_FARGATE Compatibility = "EC2_AND_FARGATE" // The task should specify the External launch type. Compatibility_EXTERNAL Compatibility = "EXTERNAL" )
type ContainerDefinition ¶
type ContainerDefinition interface { constructs.Construct // An array dependencies defined for container startup and shutdown. ContainerDependencies() *[]*ContainerDependency // The name of this container. ContainerName() *string // The port the container will listen on. ContainerPort() *float64 // The number of cpu units reserved for the container. Cpu() *float64 // The environment files for this container. EnvironmentFiles() *[]*EnvironmentFileConfig // Specifies whether the container will be marked essential. // // If the essential parameter of a container is marked as true, and that container // fails or stops for any reason, all other containers that are part of the task are // stopped. If the essential parameter of a container is marked as false, then its // failure does not affect the rest of the containers in a task. // // If this parameter is omitted, a container is assumed to be essential. Essential() *bool // The name of the image referenced by this container. ImageName() *string // The inbound rules associated with the security group the task or service will use. // // This property is only used for tasks that use the awsvpc network mode. IngressPort() *float64 // The Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. LinuxParameters() LinuxParameters // The log configuration specification for the container. LogDriverConfig() *LogDriverConfig // Whether there was at least one memory limit specified in this definition. MemoryLimitSpecified() *bool // The mount points for data volumes in your container. MountPoints() *[]*MountPoint // The tree node. Node() constructs.Node // The list of port mappings for the container. // // Port mappings allow containers to access ports // on the host container instance to send or receive traffic. PortMappings() *[]*PortMapping // Specifies whether a TTY must be allocated for this container. PseudoTerminal() *bool // Whether this container definition references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The name of the task definition that includes this container definition. TaskDefinition() TaskDefinition // An array of ulimits to set in the container. Ulimits() *[]*Ulimit // The data volumes to mount from another container in the same task definition. VolumesFrom() *[]*VolumeFrom // This method adds one or more container dependencies to the container. AddContainerDependencies(containerDependencies ...*ContainerDependency) // This method adds an environment variable to the container. AddEnvironment(name *string, value *string) // This method adds one or more resources to the container. AddInferenceAcceleratorResource(inferenceAcceleratorResources ...*string) // This method adds a link which allows containers to communicate with each other without the need for port mappings. // // This parameter is only supported if the task definition is using the bridge network mode. // Warning: The --link flag is a legacy feature of Docker. It may eventually be removed. AddLink(container ContainerDefinition, alias *string) // This method adds one or more mount points for data volumes to the container. AddMountPoints(mountPoints ...*MountPoint) // This method adds one or more port mappings to the container. AddPortMappings(portMappings ...*PortMapping) // This method mounts temporary disk space to the container. // // This adds the correct container mountPoint and task definition volume. AddScratch(scratch *ScratchSpace) // This method adds a secret as environment variable to the container. AddSecret(name *string, secret Secret) // This method adds the specified statement to the IAM task execution policy in the task definition. AddToExecutionPolicy(statement awsiam.PolicyStatement) // This method adds one or more ulimits to the container. AddUlimits(ulimits ...*Ulimit) // This method adds one or more volumes to the container. AddVolumesFrom(volumesFrom ...*VolumeFrom) // Returns the host port for the requested container port if it exists. FindPortMapping(containerPort *float64, protocol Protocol) *PortMapping // Returns the port mapping with the given name, if it exists. FindPortMappingByName(name *string) *PortMapping // Render this container definition to a CloudFormation object. RenderContainerDefinition(_taskDefinition TaskDefinition) *CfnTaskDefinition_ContainerDefinitionProperty // Returns a string representation of this construct. ToString() *string }
A container definition is used in a task definition to describe the containers that are launched as part of a task.
Example:
var taskDefinition taskDefinition var cluster cluster // Add a container to the task definition specificContainer := taskDefinition.AddContainer(jsii.String("Container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("/aws/aws-example-app")), MemoryLimitMiB: jsii.Number(2048), }) // Add a port mapping specificContainer.AddPortMappings(&PortMapping{ ContainerPort: jsii.Number(7600), Protocol: ecs.Protocol_TCP, }) ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CloudMapOptions: &CloudMapOptions{ // Create SRV records - useful for bridge networking DnsRecordType: cloudmap.DnsRecordType_SRV, // Targets port TCP port 7600 `specificContainer` Container: specificContainer, ContainerPort: jsii.Number(7600), }, })
func NewContainerDefinition ¶
func NewContainerDefinition(scope constructs.Construct, id *string, props *ContainerDefinitionProps) ContainerDefinition
Constructs a new instance of the ContainerDefinition class.
type ContainerDefinitionOptions ¶
type ContainerDefinitionOptions struct { // The image used to start a container. // // This string is passed directly to the Docker daemon. // Images in the Docker Hub registry are available by default. // Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. // TODO: Update these to specify using classes of IContainerImage. Image ContainerImage `field:"required" json:"image" yaml:"image"` // The command that is passed to the container. // // If you provide a shell command as a single string, you have to quote command-line arguments. // Default: - CMD value built into container image. // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The name of the container. // Default: - id of node associated with ContainerDefinition. // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The minimum number of CPU units to reserve for the container. // Default: - No minimum CPU units reserved. // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // Specifies whether networking is disabled within the container. // // When this parameter is true, networking is disabled within the container. // Default: false. // DisableNetworking *bool `field:"optional" json:"disableNetworking" yaml:"disableNetworking"` // A list of DNS search domains that are presented to the container. // Default: - No search domains. // DnsSearchDomains *[]*string `field:"optional" json:"dnsSearchDomains" yaml:"dnsSearchDomains"` // A list of DNS servers that are presented to the container. // Default: - Default DNS servers. // DnsServers *[]*string `field:"optional" json:"dnsServers" yaml:"dnsServers"` // A key/value map of labels to add to the container. // Default: - No labels. // DockerLabels *map[string]*string `field:"optional" json:"dockerLabels" yaml:"dockerLabels"` // A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. // Default: - No security labels. // DockerSecurityOptions *[]*string `field:"optional" json:"dockerSecurityOptions" yaml:"dockerSecurityOptions"` // The ENTRYPOINT value to pass to the container. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Default: - Entry point configured in container. // EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // The environment variables to pass to the container. // Default: - No environment variables. // Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The environment files to pass to the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html // // Default: - No environment files. // EnvironmentFiles *[]EnvironmentFile `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // Specifies whether the container is marked essential. // // If the essential parameter of a container is marked as true, and that container fails // or stops for any reason, all other containers that are part of the task are stopped. // If the essential parameter of a container is marked as false, then its failure does not // affect the rest of the containers in a task. All tasks must have at least one essential container. // // If this parameter is omitted, a container is assumed to be essential. // Default: true. // Essential *bool `field:"optional" json:"essential" yaml:"essential"` // A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. // Default: - No extra hosts. // ExtraHosts *map[string]*string `field:"optional" json:"extraHosts" yaml:"extraHosts"` // The number of GPUs assigned to the container. // Default: - No GPUs assigned. // GpuCount *float64 `field:"optional" json:"gpuCount" yaml:"gpuCount"` // The health check command and associated configuration parameters for the container. // Default: - Health check configuration from container. // HealthCheck *HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The hostname to use for your container. // Default: - Automatic hostname. // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // The inference accelerators referenced by the container. // Default: - No inference accelerators assigned. // InferenceAcceleratorResources *[]*string `field:"optional" json:"inferenceAcceleratorResources" yaml:"inferenceAcceleratorResources"` // When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive // // Default: - false. // Interactive *bool `field:"optional" json:"interactive" yaml:"interactive"` // Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. // // For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). // Default: - No Linux parameters. // LinuxParameters LinuxParameters `field:"optional" json:"linuxParameters" yaml:"linuxParameters"` // The log configuration specification for the container. // Default: - Containers use the same logging driver that the Docker daemon uses. // Logging LogDriver `field:"optional" json:"logging" yaml:"logging"` // The amount (in MiB) of memory to present to the container. // // If your container attempts to exceed the allocated memory, the container // is terminated. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory limit. // MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under heavy contention, Docker attempts to keep the // container memory to this soft limit. However, your container can consume more // memory when it needs to, up to either the hard limit specified with the memory // parameter (if applicable), or all of the available memory on the container // instance, whichever comes first. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory reserved. // MemoryReservationMiB *float64 `field:"optional" json:"memoryReservationMiB" yaml:"memoryReservationMiB"` // The port mappings to add to the container definition. // Default: - No ports are mapped. // PortMappings *[]*PortMapping `field:"optional" json:"portMappings" yaml:"portMappings"` // Specifies whether the container is marked as privileged. // // When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). // Default: false. // Privileged *bool `field:"optional" json:"privileged" yaml:"privileged"` // When this parameter is true, a TTY is allocated. // // This parameter maps to Tty in the "Create a container section" of the // Docker Remote API and the --tty option to `docker run`. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_pseudoterminal // // Default: - false. // PseudoTerminal *bool `field:"optional" json:"pseudoTerminal" yaml:"pseudoTerminal"` // When this parameter is true, the container is given read-only access to its root file system. // Default: false. // ReadonlyRootFilesystem *bool `field:"optional" json:"readonlyRootFilesystem" yaml:"readonlyRootFilesystem"` // The secret environment variables to pass to the container. // Default: - No secret environment variables. // Secrets *map[string]Secret `field:"optional" json:"secrets" yaml:"secrets"` // Time duration (in seconds) to wait before giving up on resolving dependencies for a container. // Default: - none. // StartTimeout awscdk.Duration `field:"optional" json:"startTimeout" yaml:"startTimeout"` // Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. // Default: - none. // StopTimeout awscdk.Duration `field:"optional" json:"stopTimeout" yaml:"stopTimeout"` // A list of namespaced kernel parameters to set in the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols // // Default: - No system controls are set. // SystemControls *[]*SystemControl `field:"optional" json:"systemControls" yaml:"systemControls"` // An array of ulimits to set in the container. Ulimits *[]*Ulimit `field:"optional" json:"ulimits" yaml:"ulimits"` // The user to use inside the container. // // This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#ContainerDefinition-user // // Default: root. // User *string `field:"optional" json:"user" yaml:"user"` // The working directory in which to run commands inside the container. // Default: /. // WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
Example:
var taskDefinition taskDefinition var cluster cluster // Add a container to the task definition specificContainer := taskDefinition.AddContainer(jsii.String("Container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("/aws/aws-example-app")), MemoryLimitMiB: jsii.Number(2048), }) // Add a port mapping specificContainer.AddPortMappings(&PortMapping{ ContainerPort: jsii.Number(7600), Protocol: ecs.Protocol_TCP, }) ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CloudMapOptions: &CloudMapOptions{ // Create SRV records - useful for bridge networking DnsRecordType: cloudmap.DnsRecordType_SRV, // Targets port TCP port 7600 `specificContainer` Container: specificContainer, ContainerPort: jsii.Number(7600), }, })
type ContainerDefinitionProps ¶
type ContainerDefinitionProps struct { // The image used to start a container. // // This string is passed directly to the Docker daemon. // Images in the Docker Hub registry are available by default. // Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. // TODO: Update these to specify using classes of IContainerImage. Image ContainerImage `field:"required" json:"image" yaml:"image"` // The command that is passed to the container. // // If you provide a shell command as a single string, you have to quote command-line arguments. // Default: - CMD value built into container image. // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The name of the container. // Default: - id of node associated with ContainerDefinition. // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The minimum number of CPU units to reserve for the container. // Default: - No minimum CPU units reserved. // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // Specifies whether networking is disabled within the container. // // When this parameter is true, networking is disabled within the container. // Default: false. // DisableNetworking *bool `field:"optional" json:"disableNetworking" yaml:"disableNetworking"` // A list of DNS search domains that are presented to the container. // Default: - No search domains. // DnsSearchDomains *[]*string `field:"optional" json:"dnsSearchDomains" yaml:"dnsSearchDomains"` // A list of DNS servers that are presented to the container. // Default: - Default DNS servers. // DnsServers *[]*string `field:"optional" json:"dnsServers" yaml:"dnsServers"` // A key/value map of labels to add to the container. // Default: - No labels. // DockerLabels *map[string]*string `field:"optional" json:"dockerLabels" yaml:"dockerLabels"` // A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. // Default: - No security labels. // DockerSecurityOptions *[]*string `field:"optional" json:"dockerSecurityOptions" yaml:"dockerSecurityOptions"` // The ENTRYPOINT value to pass to the container. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Default: - Entry point configured in container. // EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // The environment variables to pass to the container. // Default: - No environment variables. // Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The environment files to pass to the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html // // Default: - No environment files. // EnvironmentFiles *[]EnvironmentFile `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // Specifies whether the container is marked essential. // // If the essential parameter of a container is marked as true, and that container fails // or stops for any reason, all other containers that are part of the task are stopped. // If the essential parameter of a container is marked as false, then its failure does not // affect the rest of the containers in a task. All tasks must have at least one essential container. // // If this parameter is omitted, a container is assumed to be essential. // Default: true. // Essential *bool `field:"optional" json:"essential" yaml:"essential"` // A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. // Default: - No extra hosts. // ExtraHosts *map[string]*string `field:"optional" json:"extraHosts" yaml:"extraHosts"` // The number of GPUs assigned to the container. // Default: - No GPUs assigned. // GpuCount *float64 `field:"optional" json:"gpuCount" yaml:"gpuCount"` // The health check command and associated configuration parameters for the container. // Default: - Health check configuration from container. // HealthCheck *HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The hostname to use for your container. // Default: - Automatic hostname. // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // The inference accelerators referenced by the container. // Default: - No inference accelerators assigned. // InferenceAcceleratorResources *[]*string `field:"optional" json:"inferenceAcceleratorResources" yaml:"inferenceAcceleratorResources"` // When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive // // Default: - false. // Interactive *bool `field:"optional" json:"interactive" yaml:"interactive"` // Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. // // For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). // Default: - No Linux parameters. // LinuxParameters LinuxParameters `field:"optional" json:"linuxParameters" yaml:"linuxParameters"` // The log configuration specification for the container. // Default: - Containers use the same logging driver that the Docker daemon uses. // Logging LogDriver `field:"optional" json:"logging" yaml:"logging"` // The amount (in MiB) of memory to present to the container. // // If your container attempts to exceed the allocated memory, the container // is terminated. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory limit. // MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under heavy contention, Docker attempts to keep the // container memory to this soft limit. However, your container can consume more // memory when it needs to, up to either the hard limit specified with the memory // parameter (if applicable), or all of the available memory on the container // instance, whichever comes first. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory reserved. // MemoryReservationMiB *float64 `field:"optional" json:"memoryReservationMiB" yaml:"memoryReservationMiB"` // The port mappings to add to the container definition. // Default: - No ports are mapped. // PortMappings *[]*PortMapping `field:"optional" json:"portMappings" yaml:"portMappings"` // Specifies whether the container is marked as privileged. // // When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). // Default: false. // Privileged *bool `field:"optional" json:"privileged" yaml:"privileged"` // When this parameter is true, a TTY is allocated. // // This parameter maps to Tty in the "Create a container section" of the // Docker Remote API and the --tty option to `docker run`. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_pseudoterminal // // Default: - false. // PseudoTerminal *bool `field:"optional" json:"pseudoTerminal" yaml:"pseudoTerminal"` // When this parameter is true, the container is given read-only access to its root file system. // Default: false. // ReadonlyRootFilesystem *bool `field:"optional" json:"readonlyRootFilesystem" yaml:"readonlyRootFilesystem"` // The secret environment variables to pass to the container. // Default: - No secret environment variables. // Secrets *map[string]Secret `field:"optional" json:"secrets" yaml:"secrets"` // Time duration (in seconds) to wait before giving up on resolving dependencies for a container. // Default: - none. // StartTimeout awscdk.Duration `field:"optional" json:"startTimeout" yaml:"startTimeout"` // Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. // Default: - none. // StopTimeout awscdk.Duration `field:"optional" json:"stopTimeout" yaml:"stopTimeout"` // A list of namespaced kernel parameters to set in the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols // // Default: - No system controls are set. // SystemControls *[]*SystemControl `field:"optional" json:"systemControls" yaml:"systemControls"` // An array of ulimits to set in the container. Ulimits *[]*Ulimit `field:"optional" json:"ulimits" yaml:"ulimits"` // The user to use inside the container. // // This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#ContainerDefinition-user // // Default: root. // User *string `field:"optional" json:"user" yaml:"user"` // The working directory in which to run commands inside the container. // Default: /. // WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` // The name of the task definition that includes this container definition. // // [disable-awslint:ref-via-interface]. TaskDefinition TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` }
The properties in a container definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol var containerImage containerImage var environmentFile environmentFile var linuxParameters linuxParameters var logDriver logDriver var secret secret var taskDefinition taskDefinition containerDefinitionProps := &ContainerDefinitionProps{ Image: containerImage, TaskDefinition: taskDefinition, // the properties below are optional Command: []*string{ jsii.String("command"), }, ContainerName: jsii.String("containerName"), Cpu: jsii.Number(123), DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentFiles: []*environmentFile{ environmentFile, }, Essential: jsii.Boolean(false), ExtraHosts: map[string]*string{ "extraHostsKey": jsii.String("extraHosts"), }, GpuCount: jsii.Number(123), HealthCheck: &HealthCheck{ Command: []*string{ jsii.String("command"), }, // the properties below are optional Interval: cdk.Duration_Minutes(jsii.Number(30)), Retries: jsii.Number(123), StartPeriod: cdk.Duration_*Minutes(jsii.Number(30)), Timeout: cdk.Duration_*Minutes(jsii.Number(30)), }, Hostname: jsii.String("hostname"), InferenceAcceleratorResources: []*string{ jsii.String("inferenceAcceleratorResources"), }, Interactive: jsii.Boolean(false), LinuxParameters: linuxParameters, Logging: logDriver, MemoryLimitMiB: jsii.Number(123), MemoryReservationMiB: jsii.Number(123), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.Aws_ecs.Protocol_TCP, }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), Secrets: map[string]*secret{ "secretsKey": secret, }, StartTimeout: cdk.Duration_*Minutes(jsii.Number(30)), StopTimeout: cdk.Duration_*Minutes(jsii.Number(30)), SystemControls: []systemControl{ &systemControl{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []ulimit{ &ulimit{ HardLimit: jsii.Number(123), Name: awscdk.*Aws_ecs.UlimitName_CORE, SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), WorkingDirectory: jsii.String("workingDirectory"), }
type ContainerDependency ¶
type ContainerDependency struct { // The container to depend on. Container ContainerDefinition `field:"required" json:"container" yaml:"container"` // The state the container needs to be in to satisfy the dependency and proceed with startup. // // Valid values are ContainerDependencyCondition.START, ContainerDependencyCondition.COMPLETE, // ContainerDependencyCondition.SUCCESS and ContainerDependencyCondition.HEALTHY. // Default: ContainerDependencyCondition.HEALTHY // Condition ContainerDependencyCondition `field:"optional" json:"condition" yaml:"condition"` }
The details of a dependency on another container in the task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var containerDefinition containerDefinition containerDependency := &ContainerDependency{ Container: containerDefinition, // the properties below are optional Condition: awscdk.Aws_ecs.ContainerDependencyCondition_START, }
See: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDependency.html
type ContainerDependencyCondition ¶
type ContainerDependencyCondition string
const ( // This condition emulates the behavior of links and volumes today. // // It validates that a dependent container is started before permitting other containers to start. ContainerDependencyCondition_START ContainerDependencyCondition = "START" // This condition validates that a dependent container runs to completion (exits) before permitting other containers to start. // // This can be useful for nonessential containers that run a script and then exit. ContainerDependencyCondition_COMPLETE ContainerDependencyCondition = "COMPLETE" // This condition is the same as COMPLETE, but it also requires that the container exits with a zero status. ContainerDependencyCondition_SUCCESS ContainerDependencyCondition = "SUCCESS" // This condition validates that the dependent container passes its Docker health check before permitting other containers to start. // // This requires that the dependent container has health checks configured. This condition is confirmed only at task startup. ContainerDependencyCondition_HEALTHY ContainerDependencyCondition = "HEALTHY" )
type ContainerImage ¶
type ContainerImage interface { // Called when the image is used by a ContainerDefinition. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *ContainerImageConfig }
Constructs for types of container images.
Example:
var mySecret iSecret jobDefn := batch.NewEcsJobDefinition(this, jsii.String("JobDefn"), &EcsJobDefinitionProps{ Container: batch.NewEcsEc2ContainerDefinition(this, jsii.String("containerDefn"), &EcsEc2ContainerDefinitionProps{ Image: ecs.ContainerImage_FromRegistry(jsii.String("public.ecr.aws/amazonlinux/amazonlinux:latest")), Memory: cdk.Size_Mebibytes(jsii.Number(2048)), Cpu: jsii.Number(256), Secrets: map[string]secret{ "MY_SECRET_ENV_VAR": batch.*secret_fromSecretsManager(mySecret), }, }), })
func AssetImage_FromDockerImageAsset ¶
func AssetImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
Use an existing `DockerImageAsset` for this container image.
func AssetImage_FromTarball ¶
func AssetImage_FromTarball(tarballFile *string) ContainerImage
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
func ContainerImage_FromDockerImageAsset ¶
func ContainerImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
Use an existing `DockerImageAsset` for this container image.
func ContainerImage_FromTarball ¶
func ContainerImage_FromTarball(tarballFile *string) ContainerImage
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
func EcrImage_FromDockerImageAsset ¶
func EcrImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
Use an existing `DockerImageAsset` for this container image.
func EcrImage_FromTarball ¶
func EcrImage_FromTarball(tarballFile *string) ContainerImage
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
func RepositoryImage_FromDockerImageAsset ¶
func RepositoryImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
Use an existing `DockerImageAsset` for this container image.
func RepositoryImage_FromTarball ¶
func RepositoryImage_FromTarball(tarballFile *string) ContainerImage
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
func TagParameterContainerImage_FromDockerImageAsset ¶
func TagParameterContainerImage_FromDockerImageAsset(asset awsecrassets.DockerImageAsset) ContainerImage
Use an existing `DockerImageAsset` for this container image.
func TagParameterContainerImage_FromTarball ¶
func TagParameterContainerImage_FromTarball(tarballFile *string) ContainerImage
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
type ContainerImageConfig ¶
type ContainerImageConfig struct { // Specifies the name of the container image. ImageName *string `field:"required" json:"imageName" yaml:"imageName"` // Specifies the credentials used to access the image repository. RepositoryCredentials *CfnTaskDefinition_RepositoryCredentialsProperty `field:"optional" json:"repositoryCredentials" yaml:"repositoryCredentials"` }
The configuration for creating a container image.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" containerImageConfig := &ContainerImageConfig{ ImageName: jsii.String("imageName"), // the properties below are optional RepositoryCredentials: &RepositoryCredentialsProperty{ CredentialsParameter: jsii.String("credentialsParameter"), }, }
type ContainerMountPoint ¶ added in v2.122.0
type ContainerMountPoint struct { // The path on the container to mount the host volume at. ContainerPath *string `field:"required" json:"containerPath" yaml:"containerPath"` // Specifies whether to give the container read-only access to the volume. // // If this value is true, the container has read-only access to the volume. // If this value is false, then the container can write to the volume. ReadOnly *bool `field:"required" json:"readOnly" yaml:"readOnly"` }
Defines the mount point details for attaching a volume to a container.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
type CpuArchitecture ¶ added in v2.7.0
type CpuArchitecture interface { }
The CpuArchitecture for Fargate Runtime Platform.
Example:
// Create a Task Definition for the Windows container to start taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{ RuntimePlatform: &RuntimePlatform{ OperatingSystemFamily: ecs.OperatingSystemFamily_WINDOWS_SERVER_2019_CORE(), CpuArchitecture: ecs.CpuArchitecture_X86_64(), }, Cpu: jsii.Number(1024), MemoryLimitMiB: jsii.Number(2048), }) taskDefinition.AddContainer(jsii.String("windowsservercore"), &ContainerDefinitionOptions{ Logging: ecs.LogDriver_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("win-iis-on-fargate"), }), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), }, }, Image: ecs.ContainerImage_FromRegistry(jsii.String("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")), })
func CpuArchitecture_ARM64 ¶ added in v2.7.0
func CpuArchitecture_ARM64() CpuArchitecture
func CpuArchitecture_Of ¶ added in v2.7.0
func CpuArchitecture_Of(cpuArchitecture *string) CpuArchitecture
Other cpu architecture. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-runtimeplatform.html#cfn-ecs-taskdefinition-runtimeplatform-cpuarchitecture for all available cpu architecture.
func CpuArchitecture_X86_64 ¶ added in v2.7.0
func CpuArchitecture_X86_64() CpuArchitecture
type CpuUtilizationScalingProps ¶
type CpuUtilizationScalingProps struct { // Indicates whether scale in by the target tracking policy is disabled. // // If the value is true, scale in is disabled and the target tracking policy // won't remove capacity from the scalable resource. Otherwise, scale in is // enabled and the target tracking policy can remove capacity from the // scalable resource. // Default: false. // DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"` // A name for the scaling policy. // Default: - Automatically generated name. // PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` // Period after a scale in activity completes before another scale in activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // Period after a scale out activity completes before another scale out activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // The target value for CPU utilization across all tasks in the service. TargetUtilizationPercent *float64 `field:"required" json:"targetUtilizationPercent" yaml:"targetUtilizationPercent"` }
The properties for enabling scaling based on CPU utilization.
Example:
var target applicationTargetGroup var service baseService scaling := service.AutoScaleTaskCount(&EnableScalingProps{ MaxCapacity: jsii.Number(10), }) scaling.ScaleOnCpuUtilization(jsii.String("CpuScaling"), &CpuUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), }) scaling.ScaleOnRequestCount(jsii.String("RequestScaling"), &RequestCountScalingProps{ RequestsPerTarget: jsii.Number(10000), TargetGroup: target, })
type DeploymentAlarmConfig ¶ added in v2.87.0
type DeploymentAlarmConfig struct { // Default rollback on alarm. // Default: AlarmBehavior.ROLLBACK_ON_ALARM // Behavior AlarmBehavior `field:"optional" json:"behavior" yaml:"behavior"` // List of alarm names to monitor during deployments. AlarmNames *[]*string `field:"required" json:"alarmNames" yaml:"alarmNames"` }
Configuration for deployment alarms.
Example:
import cw "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var taskDefinition taskDefinition var elbAlarm alarm service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DeploymentAlarms: &DeploymentAlarmConfig{ AlarmNames: []*string{ elbAlarm.AlarmName, }, Behavior: ecs.AlarmBehavior_ROLLBACK_ON_ALARM, }, }) // Defining a deployment alarm after the service has been created cpuAlarmName := "MyCpuMetricAlarm" cw.NewAlarm(this, jsii.String("CPUAlarm"), &AlarmProps{ AlarmName: cpuAlarmName, Metric: service.MetricCpuUtilization(), EvaluationPeriods: jsii.Number(2), Threshold: jsii.Number(80), }) service.EnableDeploymentAlarms([]*string{ cpuAlarmName, }, &DeploymentAlarmOptions{ Behavior: ecs.AlarmBehavior_FAIL_ON_ALARM, })
type DeploymentAlarmOptions ¶ added in v2.87.0
type DeploymentAlarmOptions struct { // Default rollback on alarm. // Default: AlarmBehavior.ROLLBACK_ON_ALARM // Behavior AlarmBehavior `field:"optional" json:"behavior" yaml:"behavior"` }
Options for deployment alarms.
Example:
import cw "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var taskDefinition taskDefinition var elbAlarm alarm service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DeploymentAlarms: &DeploymentAlarmConfig{ AlarmNames: []*string{ elbAlarm.AlarmName, }, Behavior: ecs.AlarmBehavior_ROLLBACK_ON_ALARM, }, }) // Defining a deployment alarm after the service has been created cpuAlarmName := "MyCpuMetricAlarm" cw.NewAlarm(this, jsii.String("CPUAlarm"), &AlarmProps{ AlarmName: cpuAlarmName, Metric: service.MetricCpuUtilization(), EvaluationPeriods: jsii.Number(2), Threshold: jsii.Number(80), }) service.EnableDeploymentAlarms([]*string{ cpuAlarmName, }, &DeploymentAlarmOptions{ Behavior: ecs.AlarmBehavior_FAIL_ON_ALARM, })
type DeploymentCircuitBreaker ¶
type DeploymentCircuitBreaker struct { // Whether to enable the deployment circuit breaker logic. // Default: true. // Enable *bool `field:"optional" json:"enable" yaml:"enable"` // Whether to enable rollback on deployment failure. // Default: false. // Rollback *bool `field:"optional" json:"rollback" yaml:"rollback"` }
The deployment circuit breaker to use for the service.
Example:
var cluster cluster var taskDefinition taskDefinition service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CircuitBreaker: &DeploymentCircuitBreaker{ Enable: jsii.Boolean(true), Rollback: jsii.Boolean(true), }, })
type DeploymentController ¶
type DeploymentController struct { // The deployment controller type to use. // Default: DeploymentControllerType.ECS // Type DeploymentControllerType `field:"optional" json:"type" yaml:"type"` }
The deployment controller to use for the service.
Example:
var myApplication ecsApplication var cluster cluster var taskDefinition fargateTaskDefinition var blueTargetGroup iTargetGroup var greenTargetGroup iTargetGroup var listener iApplicationListener service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DeploymentController: &DeploymentController{ Type: ecs.DeploymentControllerType_CODE_DEPLOY, }, }) codedeploy.NewEcsDeploymentGroup(this, jsii.String("BlueGreenDG"), &EcsDeploymentGroupProps{ Service: Service, BlueGreenDeploymentConfig: &EcsBlueGreenDeploymentConfig{ BlueTargetGroup: *BlueTargetGroup, GreenTargetGroup: *GreenTargetGroup, Listener: *Listener, }, DeploymentConfig: codedeploy.EcsDeploymentConfig_CANARY_10PERCENT_5MINUTES(), })
type DeploymentControllerType ¶
type DeploymentControllerType string
The deployment controller type to use for the service.
Example:
var myApplication ecsApplication var cluster cluster var taskDefinition fargateTaskDefinition var blueTargetGroup iTargetGroup var greenTargetGroup iTargetGroup var listener iApplicationListener service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DeploymentController: &DeploymentController{ Type: ecs.DeploymentControllerType_CODE_DEPLOY, }, }) codedeploy.NewEcsDeploymentGroup(this, jsii.String("BlueGreenDG"), &EcsDeploymentGroupProps{ Service: Service, BlueGreenDeploymentConfig: &EcsBlueGreenDeploymentConfig{ BlueTargetGroup: *BlueTargetGroup, GreenTargetGroup: *GreenTargetGroup, Listener: *Listener, }, DeploymentConfig: codedeploy.EcsDeploymentConfig_CANARY_10PERCENT_5MINUTES(), })
const ( // The rolling update (ECS) deployment type involves replacing the current running version of the container with the latest version. DeploymentControllerType_ECS DeploymentControllerType = "ECS" // The blue/green (CODE_DEPLOY) deployment type uses the blue/green deployment model powered by AWS CodeDeploy. DeploymentControllerType_CODE_DEPLOY DeploymentControllerType = "CODE_DEPLOY" // The external (EXTERNAL) deployment type enables you to use any third-party deployment controller. DeploymentControllerType_EXTERNAL DeploymentControllerType = "EXTERNAL" )
type Device ¶
type Device struct { // The path for the device on the host container instance. HostPath *string `field:"required" json:"hostPath" yaml:"hostPath"` // The path inside the container at which to expose the host device. // Default: Same path as the host. // ContainerPath *string `field:"optional" json:"containerPath" yaml:"containerPath"` // The explicit permissions to provide to the container for the device. // // By default, the container has permissions for read, write, and mknod for the device. // Default: Readonly. // Permissions *[]DevicePermission `field:"optional" json:"permissions" yaml:"permissions"` }
A container instance host device.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" device := &Device{ HostPath: jsii.String("hostPath"), // the properties below are optional ContainerPath: jsii.String("containerPath"), Permissions: []devicePermission{ awscdk.Aws_ecs.*devicePermission_READ, }, }
type DevicePermission ¶
type DevicePermission string
Permissions for device access.
const ( // Read. DevicePermission_READ DevicePermission = "READ" // Write. DevicePermission_WRITE DevicePermission = "WRITE" // Make a node. DevicePermission_MKNOD DevicePermission = "MKNOD" )
type DockerVolumeConfiguration ¶
type DockerVolumeConfiguration struct { // The Docker volume driver to use. Driver *string `field:"required" json:"driver" yaml:"driver"` // The scope for the Docker volume that determines its lifecycle. Scope Scope `field:"required" json:"scope" yaml:"scope"` // Specifies whether the Docker volume should be created if it does not already exist. // // If true is specified, the Docker volume will be created for you. // Default: false. // Autoprovision *bool `field:"optional" json:"autoprovision" yaml:"autoprovision"` // A map of Docker driver-specific options passed through. // Default: No options. // DriverOpts *map[string]*string `field:"optional" json:"driverOpts" yaml:"driverOpts"` // Custom metadata to add to your Docker volume. // Default: No labels. // Labels *map[string]*string `field:"optional" json:"labels" yaml:"labels"` }
The configuration for a Docker volume.
Docker volumes are only supported when you are using the EC2 launch type.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dockerVolumeConfiguration := &DockerVolumeConfiguration{ Driver: jsii.String("driver"), Scope: awscdk.Aws_ecs.Scope_TASK, // the properties below are optional Autoprovision: jsii.Boolean(false), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, }
type EBSTagSpecification ¶ added in v2.122.0
type EBSTagSpecification struct { // Specifies whether to propagate the tags from the task definition or the service to the task. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION // Default: - undefined. // PropagateTags EbsPropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // The tags to apply to the volume. // Default: - No tags. // Tags *map[string]*string `field:"optional" json:"tags" yaml:"tags"` }
Tag Specification for EBS volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" eBSTagSpecification := &EBSTagSpecification{ PropagateTags: awscdk.Aws_ecs.EbsPropagatedTagSource_SERVICE, Tags: map[string]*string{ "tagsKey": jsii.String("tags"), }, }
type EbsPropagatedTagSource ¶ added in v2.122.0
type EbsPropagatedTagSource string
Propagate tags for EBS Volume Configuration from either service or task definition.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
const ( // SERVICE. EbsPropagatedTagSource_SERVICE EbsPropagatedTagSource = "SERVICE" // TASK_DEFINITION. EbsPropagatedTagSource_TASK_DEFINITION EbsPropagatedTagSource = "TASK_DEFINITION" )
type Ec2Service ¶
type Ec2Service interface { BaseService IEc2Service // The details of the AWS Cloud Map service. CloudmapService() awsservicediscovery.Service SetCloudmapService(val awsservicediscovery.Service) // The CloudMap service created for this service, if any. CloudMapService() awsservicediscovery.IService // The cluster that hosts the service. Cluster() ICluster // The security groups which manage the allowed network traffic for the service. Connections() awsec2.Connections // The deployment alarms property - this will be rendered directly and lazily as the CfnService.alarms property. DeploymentAlarms() *CfnService_DeploymentAlarmsProperty SetDeploymentAlarms(val *CfnService_DeploymentAlarmsProperty) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. LoadBalancers() *[]*CfnService_LoadBalancerProperty SetLoadBalancers(val *[]*CfnService_LoadBalancerProperty) // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. NetworkConfiguration() *CfnService_NetworkConfigurationProperty SetNetworkConfiguration(val *CfnService_NetworkConfigurationProperty) // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The Amazon Resource Name (ARN) of the service. ServiceArn() *string // The name of the service. ServiceName() *string // The details of the service discovery registries to assign to this service. // // For more information, see Service Discovery. ServiceRegistries() *[]*CfnService_ServiceRegistryProperty SetServiceRegistries(val *[]*CfnService_ServiceRegistryProperty) // The stack in which this resource is defined. Stack() awscdk.Stack // The task definition to use for tasks in the service. TaskDefinition() TaskDefinition // Adds one or more placement constraints to use for tasks in the service. // // For more information, see // [Amazon ECS Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html). AddPlacementConstraints(constraints ...PlacementConstraint) // Adds one or more placement strategies to use for tasks in the service. // // For more information, see // [Amazon ECS Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html). AddPlacementStrategies(strategies ...PlacementStrategy) // Adds a volume to the Service. AddVolume(volume ServiceManagedVolume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Associates this service with a CloudMap service. AssociateCloudMapService(options *AssociateCloudMapServiceOptions) // This method is called to attach this service to an Application Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToApplicationTargetGroup(targetGroup awselasticloadbalancingv2.IApplicationTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // Registers the service as a target of a Classic Load Balancer (CLB). // // Don't call this. Call `loadBalancer.addTarget()` instead. AttachToClassicLB(loadBalancer awselasticloadbalancing.LoadBalancer) // This method is called to attach this service to a Network Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToNetworkTargetGroup(targetGroup awselasticloadbalancingv2.INetworkTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // An attribute representing the minimum and maximum task count for an AutoScalingGroup. AutoScaleTaskCount(props *awsapplicationautoscaling.EnableScalingProps) ScalableTaskCount // This method is called to create a networkConfiguration. ConfigureAwsVpcNetworkingWithSecurityGroups(vpc awsec2.IVpc, assignPublicIp *bool, vpcSubnets *awsec2.SubnetSelection, securityGroups *[]awsec2.ISecurityGroup) // Enable CloudMap service discovery for the service. // // Returns: The created CloudMap service. EnableCloudMap(options *CloudMapOptions) awsservicediscovery.Service // Enable Deployment Alarms which take advantage of arbitrary alarms and configure them after service initialization. // // If you have already enabled deployment alarms, this function can be used to tell ECS about additional alarms that // should interrupt a deployment. // // New alarms specified in subsequent calls of this function will be appended to the existing list of alarms. // // The same Alarm Behavior must be used on all deployment alarms. If you specify different AlarmBehavior values in // multiple calls to this function, or the Alarm Behavior used here doesn't match the one used in the service // constructor, an error will be thrown. // // If the alarm's metric references the service, you cannot pass `Alarm.alarmName` here. That will cause a circular // dependency between the service and its deployment alarm. See this package's README for options to alarm on service // metrics, and avoid this circular dependency. EnableDeploymentAlarms(alarmNames *[]*string, options *DeploymentAlarmOptions) // Enable Service Connect on this service. EnableServiceConnect(config *ServiceConnectProps) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Return a load balancing target for a specific container and port. // // Use this function to create a load balancer target if you want to load balance to // another container than the first essential container or the first mapped port on // the container. // // Use the return value of this function where you would normally use a load balancer // target, instead of the `Service` object itself. // // Example: // declare const listener: elbv2.ApplicationListener; // declare const service: ecs.BaseService; // listener.addTargets('ECS', { // port: 80, // targets: [service.loadBalancerTarget({ // containerName: 'MyContainer', // containerPort: 1234, // })], // }); // LoadBalancerTarget(options *LoadBalancerTargetOptions) IEcsLoadBalancerTarget // This method returns the specified CloudWatch metric name for this service. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's CPU utilization. // Default: average over 5 minutes. // MetricCpuUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's memory utilization. // Default: average over 5 minutes. // MetricMemoryUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Use this function to create all load balancer targets to be registered in this service, add them to target groups, and attach target groups to listeners accordingly. // // Alternatively, you can use `listener.addTargets()` to create targets and add them to target groups. // // Example: // declare const listener: elbv2.ApplicationListener; // declare const service: ecs.BaseService; // service.registerLoadBalancerTargets( // { // containerName: 'web', // containerPort: 80, // newTargetGroupId: 'ECS', // listener: ecs.ListenerConfig.applicationListener(listener, { // protocol: elbv2.ApplicationProtocol.HTTPS // }), // }, // ) // RegisterLoadBalancerTargets(targets ...*EcsTarget) // Returns a string representation of this construct. ToString() *string }
This creates a service using the EC2 launch type on an ECS cluster.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, }) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), }) lb.AddTarget(service.LoadBalancerTarget(&LoadBalancerTargetOptions{ ContainerName: jsii.String("MyContainer"), ContainerPort: jsii.Number(80), }))
func NewEc2Service ¶
func NewEc2Service(scope constructs.Construct, id *string, props *Ec2ServiceProps) Ec2Service
Constructs a new instance of the Ec2Service class.
type Ec2ServiceAttributes ¶
type Ec2ServiceAttributes struct { // The cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // The service ARN. // Default: - either this, or `serviceName`, is required. // ServiceArn *string `field:"optional" json:"serviceArn" yaml:"serviceArn"` // The name of the service. // Default: - either this, or `serviceArn`, is required. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` }
The properties to import from the service using the EC2 launch type.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster ec2ServiceAttributes := &Ec2ServiceAttributes{ Cluster: cluster, // the properties below are optional ServiceArn: jsii.String("serviceArn"), ServiceName: jsii.String("serviceName"), }
type Ec2ServiceProps ¶
type Ec2ServiceProps struct { // The name of the cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // A list of Capacity Provider strategies used to place a service. // Default: - undefined. // CapacityProviderStrategies *[]*CapacityProviderStrategy `field:"optional" json:"capacityProviderStrategies" yaml:"capacityProviderStrategies"` // Whether to enable the deployment circuit breaker. // // If this property is defined, circuit breaker will be implicitly // enabled. // Default: - disabled. // CircuitBreaker *DeploymentCircuitBreaker `field:"optional" json:"circuitBreaker" yaml:"circuitBreaker"` // The options for configuring an Amazon ECS service to use service discovery. // Default: - AWS Cloud Map service discovery is not enabled. // CloudMapOptions *CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. // Default: - No alarms will be monitored during deployment. // DeploymentAlarms *DeploymentAlarmConfig `field:"optional" json:"deploymentAlarms" yaml:"deploymentAlarms"` // Specifies which deployment controller to use for the service. // // For more information, see // [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // Default: - Rolling update (ECS). // DeploymentController *DeploymentController `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to enable Amazon ECS managed tags for the tasks within the service. // // For more information, see // [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) // Default: false. // EnableECSManagedTags *bool `field:"optional" json:"enableECSManagedTags" yaml:"enableECSManagedTags"` // Whether to enable the ability to execute into a container. // Default: - undefined. // EnableExecuteCommand *bool `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set. // HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. // Default: - 100 if daemon, otherwise 200. // MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. // Default: - 0 if daemon, otherwise 50. // MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE // Default: PropagatedTagSource.NONE // PropagateTags PropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // Configuration for Service Connect. // Default: No ports are advertised via Service Connect on this service, and the service // cannot make requests to other services via Service Connect. // ServiceConnectConfiguration *ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of the service. // Default: - CloudFormation-generated name. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // Revision number for the task definition or `latest` to use the latest active task revision. // Default: - Uses the revision of the passed task definition deployed by CloudFormation. // TaskDefinitionRevision TaskDefinitionRevision `field:"optional" json:"taskDefinitionRevision" yaml:"taskDefinitionRevision"` // Configuration details for a volume used by the service. // // This allows you to specify // details about the EBS volume that can be attched to ECS tasks. // Default: - undefined. // VolumeConfigurations *[]ServiceManagedVolume `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` // The task definition to use for tasks in the service. // // [disable-awslint:ref-via-interface]. TaskDefinition TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // Specifies whether the task's elastic network interface receives a public IP address. // // If true, each task will receive a public IP address. // // This property is only used for tasks that use the awsvpc network mode. // Default: false. // AssignPublicIp *bool `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"` // Specifies whether the service will use the daemon scheduling strategy. // // If true, the service scheduler deploys exactly one task on each container instance in your cluster. // // When you are using this strategy, do not specify a desired number of tasks orany task placement strategies. // Default: false. // Daemon *bool `field:"optional" json:"daemon" yaml:"daemon"` // The placement constraints to use for tasks in the service. // // For more information, see // [Amazon ECS Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html). // Default: - No constraints. // PlacementConstraints *[]PlacementConstraint `field:"optional" json:"placementConstraints" yaml:"placementConstraints"` // The placement strategies to use for tasks in the service. // // For more information, see // [Amazon ECS Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html). // Default: - No strategies. // PlacementStrategies *[]PlacementStrategy `field:"optional" json:"placementStrategies" yaml:"placementStrategies"` // The security groups to associate with the service. // // If you do not specify a security group, a new security group is created. // // This property is only used for tasks that use the awsvpc network mode. // Default: - A new security group is created. // SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The subnets to associate with the service. // // This property is only used for tasks that use the awsvpc network mode. // Default: - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order. // VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` }
The properties for defining a service using the EC2 launch type.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, }) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), }) lb.AddTarget(service.LoadBalancerTarget(&LoadBalancerTargetOptions{ ContainerName: jsii.String("MyContainer"), ContainerPort: jsii.Number(80), }))
type Ec2TaskDefinition ¶
type Ec2TaskDefinition interface { TaskDefinition IEc2TaskDefinition // The task launch type compatibility requirement. Compatibility() Compatibility // The container definitions. Containers() *[]ContainerDefinition // Default container for this task. // // Load balancers will send traffic to this container. The first // essential container that is added to this task will become the default // container. DefaultContainer() ContainerDefinition SetDefaultContainer(val ContainerDefinition) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The amount (in GiB) of ephemeral storage to be allocated to the task. // // Only supported in Fargate platform version 1.4.0 or later. EphemeralStorageGiB() *float64 // Execution role for this task definition. ExecutionRole() awsiam.IRole // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. Family() *string // Public getter method to access list of inference accelerators attached to the instance. InferenceAccelerators() *[]*InferenceAccelerator // Return true if the task definition can be run on an EC2 cluster. IsEc2Compatible() *bool // Return true if the task definition can be run on a ECS anywhere cluster. IsExternalCompatible() *bool // Return true if the task definition can be run on a Fargate cluster. IsFargateCompatible() *bool // The networking mode to use for the containers in the task. NetworkMode() NetworkMode // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The stack in which this resource is defined. Stack() awscdk.Stack // The full Amazon Resource Name (ARN) of the task definition. TaskDefinitionArn() *string // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. TaskRole() awsiam.IRole // Tasks running in AWSVPC networking mode requires an additional environment variable for the region to be sourced. // // This override adds in the additional environment variable as required. AddContainer(id *string, props *ContainerDefinitionOptions) ContainerDefinition // Adds the specified extension to the task definition. // // Extension can be used to apply a packaged modification to // a task definition. AddExtension(extension ITaskDefinitionExtension) // Adds a firelens log router to the task definition. AddFirelensLogRouter(id *string, props *FirelensLogRouterDefinitionOptions) FirelensLogRouter // Adds an inference accelerator to the task definition. AddInferenceAccelerator(inferenceAccelerator *InferenceAccelerator) // Adds the specified placement constraint to the task definition. AddPlacementConstraint(constraint PlacementConstraint) // Adds a policy statement to the task execution IAM role. AddToExecutionRolePolicy(statement awsiam.PolicyStatement) // Adds a policy statement to the task IAM role. AddToTaskRolePolicy(statement awsiam.PolicyStatement) // Adds a volume to the task definition. AddVolume(volume *Volume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns the container that match the provided containerName. FindContainer(containerName *string) ContainerDefinition // Determine the existing port mapping for the provided name. // // Returns: PortMapping for the provided name, if it exists. FindPortMappingByName(name *string) *PortMapping GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grants permissions to run this task definition. // // This will grant the following permissions: // // - ecs:RunTask // - iam:PassRole. GrantRun(grantee awsiam.IGrantable) awsiam.Grant // Creates the task execution IAM role if it doesn't already exist. ObtainExecutionRole() awsiam.IRole // Returns a string representation of this construct. ToString() *string }
The details of a task definition run on an EC2 cluster.
Example:
var secret secret // Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Splunk(&SplunkLogDriverProps{ SecretToken: secret, Url: jsii.String("my-splunk-url"), }), })
func NewEc2TaskDefinition ¶
func NewEc2TaskDefinition(scope constructs.Construct, id *string, props *Ec2TaskDefinitionProps) Ec2TaskDefinition
Constructs a new instance of the Ec2TaskDefinition class.
type Ec2TaskDefinitionAttributes ¶
type Ec2TaskDefinitionAttributes struct { // The arn of the task definition. TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"` // The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. // // Some tasks do not have an execution role. // Default: - undefined. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The networking mode to use for the containers in the task. // Default: Network mode cannot be provided to the imported task. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: Permissions cannot be granted to the imported task. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` }
Attributes used to import an existing EC2 task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role ec2TaskDefinitionAttributes := &Ec2TaskDefinitionAttributes{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional ExecutionRole: role, NetworkMode: awscdk.Aws_ecs.NetworkMode_NONE, TaskRole: role, }
type Ec2TaskDefinitionProps ¶
type Ec2TaskDefinitionProps struct { // The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. // // The role will be used to retrieve container images from ECR and create CloudWatch log groups. // Default: - An execution role will be automatically created if you use ECR images in your task definition. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. // Default: - Automatically generated name. // Family *string `field:"optional" json:"family" yaml:"family"` // The configuration details for the App Mesh proxy. // Default: - No proxy configuration. // ProxyConfiguration ProxyConfiguration `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // The list of volume definitions for the task. // // For more information, see // [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes). // Default: - No volumes are passed to the Docker daemon on a container instance. // Volumes *[]*Volume `field:"optional" json:"volumes" yaml:"volumes"` // The inference accelerators to use for the containers in the task. // // Not supported in Fargate. // Default: - No inference accelerators. // InferenceAccelerators *[]*InferenceAccelerator `field:"optional" json:"inferenceAccelerators" yaml:"inferenceAccelerators"` // The IPC resource namespace to use for the containers in the task. // // Not supported in Fargate and Windows containers. // Default: - IpcMode used by the task is not specified. // IpcMode IpcMode `field:"optional" json:"ipcMode" yaml:"ipcMode"` // The Docker networking mode to use for the containers in the task. // // The valid values are NONE, BRIDGE, AWS_VPC, and HOST. // Default: - NetworkMode.BRIDGE for EC2 tasks, AWS_VPC for Fargate tasks. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The process namespace to use for the containers in the task. // // Not supported in Fargate and Windows containers. // Default: - PidMode used by the task is not specified. // PidMode PidMode `field:"optional" json:"pidMode" yaml:"pidMode"` // An array of placement constraint objects to use for the task. // // You can // specify a maximum of 10 constraints per task (this limit includes // constraints in the task definition and those specified at run time). // Default: - No placement constraints. // PlacementConstraints *[]PlacementConstraint `field:"optional" json:"placementConstraints" yaml:"placementConstraints"` }
The properties for a task definition run on an EC2 cluster.
Example:
ec2TaskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef"), &Ec2TaskDefinitionProps{ NetworkMode: ecs.NetworkMode_BRIDGE, }) container := ec2TaskDefinition.AddContainer(jsii.String("WebContainer"), &ContainerDefinitionOptions{ // Use an image from DockerHub Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), })
type EcrImage ¶
type EcrImage interface { ContainerImage // The image name. Images in Amazon ECR repositories can be specified by either using the full registry/repository:tag or registry/repository@digest. // // For example, 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>:latest or // 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE. ImageName() *string // Called when the image is used by a ContainerDefinition. Bind(_scope constructs.Construct, containerDefinition ContainerDefinition) *ContainerImageConfig }
An image from an Amazon ECR repository.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var dockerImageAsset dockerImageAsset ecrImage := awscdk.Aws_ecs.EcrImage_FromDockerImageAsset(dockerImageAsset)
func AssetImage_FromEcrRepository ¶
func AssetImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
Reference an image in an ECR repository.
func ContainerImage_FromEcrRepository ¶
func ContainerImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
Reference an image in an ECR repository.
func EcrImage_FromEcrRepository ¶
func EcrImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
Reference an image in an ECR repository.
func NewEcrImage ¶
func NewEcrImage(repository awsecr.IRepository, tagOrDigest *string) EcrImage
Constructs a new instance of the EcrImage class.
func RepositoryImage_FromEcrRepository ¶
func RepositoryImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
Reference an image in an ECR repository.
func TagParameterContainerImage_FromEcrRepository ¶
func TagParameterContainerImage_FromEcrRepository(repository awsecr.IRepository, tag *string) EcrImage
Reference an image in an ECR repository.
type EcsOptimizedImage ¶
type EcsOptimizedImage interface { awsec2.IMachineImage // Return the correct image. GetImage(scope constructs.Construct) *awsec2.MachineImageConfig }
Construct a Linux or Windows machine image from the latest ECS Optimized AMI published in SSM.
Example:
var vpc vpc cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, }) // Either add default capacity cluster.AddCapacity(jsii.String("DefaultAutoScalingGroupCapacity"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.xlarge")), DesiredCapacity: jsii.Number(3), }) // Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI. autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ Vpc: Vpc, InstanceType: ec2.NewInstanceType(jsii.String("t2.xlarge")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux(), // Or use Amazon ECS-Optimized Amazon Linux 2 AMI // machineImage: EcsOptimizedImage.amazonLinux2(), DesiredCapacity: jsii.Number(3), }) capacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String("AsgCapacityProvider"), &AsgCapacityProviderProps{ AutoScalingGroup: AutoScalingGroup, }) cluster.AddAsgCapacityProvider(capacityProvider)
func EcsOptimizedImage_AmazonLinux ¶
func EcsOptimizedImage_AmazonLinux(options *EcsOptimizedImageOptions) EcsOptimizedImage
Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.
func EcsOptimizedImage_AmazonLinux2 ¶
func EcsOptimizedImage_AmazonLinux2(hardwareType AmiHardwareType, options *EcsOptimizedImageOptions) EcsOptimizedImage
Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.
func EcsOptimizedImage_AmazonLinux2023 ¶ added in v2.96.0
func EcsOptimizedImage_AmazonLinux2023(hardwareType AmiHardwareType, options *EcsOptimizedImageOptions) EcsOptimizedImage
Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.
func EcsOptimizedImage_Windows ¶
func EcsOptimizedImage_Windows(windowsVersion WindowsOptimizedVersion, options *EcsOptimizedImageOptions) EcsOptimizedImage
Construct a Windows image from the latest ECS Optimized AMI published in SSM.
type EcsOptimizedImageOptions ¶
type EcsOptimizedImageOptions struct { // Whether the AMI ID is cached to be stable between deployments. // // By default, the newest image is used on each deployment. This will cause // instances to be replaced whenever a new version is released, and may cause // downtime if there aren't enough running instances in the AutoScalingGroup // to reschedule the tasks on. // // If set to true, the AMI ID will be cached in `cdk.context.json` and the // same value will be used on future runs. Your instances will not be replaced // but your AMI version will grow old over time. To refresh the AMI lookup, // you will have to evict the value from the cache using the `cdk context` // command. See https://docs.aws.amazon.com/cdk/latest/guide/context.html for // more information. // // Can not be set to `true` in environment-agnostic stacks. // Default: false. // CachedInContext *bool `field:"optional" json:"cachedInContext" yaml:"cachedInContext"` }
Additional configuration properties for EcsOptimizedImage factory functions.
Example:
var vpc vpc autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ MachineImage: ecs.EcsOptimizedImage_AmazonLinux(&EcsOptimizedImageOptions{ CachedInContext: jsii.Boolean(true), }), Vpc: Vpc, InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), })
type EcsTarget ¶
type EcsTarget struct { // The name of the container. ContainerName *string `field:"required" json:"containerName" yaml:"containerName"` // Listener and properties for adding target group to the listener. Listener ListenerConfig `field:"required" json:"listener" yaml:"listener"` // ID for a target group to be created. NewTargetGroupId *string `field:"required" json:"newTargetGroupId" yaml:"newTargetGroupId"` // The port number of the container. // // Only applicable when using application/network load balancers. // Default: - Container port of the first added port mapping. // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The protocol used for the port mapping. // // Only applicable when using application load balancers. // Default: Protocol.TCP // Protocol Protocol `field:"optional" json:"protocol" yaml:"protocol"` }
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elbv2.NewApplicationLoadBalancer(this, jsii.String("LB"), &ApplicationLoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), }) listener := lb.AddListener(jsii.String("Listener"), &BaseApplicationListenerProps{ Port: jsii.Number(80), }) service.RegisterLoadBalancerTargets(&EcsTarget{ ContainerName: jsii.String("web"), ContainerPort: jsii.Number(80), NewTargetGroupId: jsii.String("ECS"), Listener: ecs.ListenerConfig_ApplicationListener(listener, &AddApplicationTargetsProps{ Protocol: elbv2.ApplicationProtocol_HTTPS, }), })
type EfsVolumeConfiguration ¶
type EfsVolumeConfiguration struct { // The Amazon EFS file system ID to use. FileSystemId *string `field:"required" json:"fileSystemId" yaml:"fileSystemId"` // The authorization configuration details for the Amazon EFS file system. // Default: No configuration. // AuthorizationConfig *AuthorizationConfig `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"` // The directory within the Amazon EFS file system to mount as the root directory inside the host. // // Specifying / will have the same effect as omitting this parameter. // Default: The root of the Amazon EFS volume. // RootDirectory *string `field:"optional" json:"rootDirectory" yaml:"rootDirectory"` // Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. // // Transit encryption must be enabled if Amazon EFS IAM authorization is used. // // Valid values: ENABLED | DISABLED. // Default: DISABLED. // TransitEncryption *string `field:"optional" json:"transitEncryption" yaml:"transitEncryption"` // The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. // // EFS mount helper uses. // Default: Port selection strategy that the Amazon EFS mount helper uses. // TransitEncryptionPort *float64 `field:"optional" json:"transitEncryptionPort" yaml:"transitEncryptionPort"` }
The configuration for an Elastic FileSystem volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" efsVolumeConfiguration := &EfsVolumeConfiguration{ FileSystemId: jsii.String("fileSystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfig{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }
type EnvironmentFile ¶
type EnvironmentFile interface { // Called when the container is initialized to allow this object to bind to the stack. Bind(scope constructs.Construct) *EnvironmentFileConfig }
Constructs for types of environment files.
Example:
var secret secret var dbSecret secret var parameter stringParameter var taskDefinition taskDefinition var s3Bucket bucket newContainer := taskDefinition.AddContainer(jsii.String("container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), Environment: map[string]*string{ // clear text, not for sensitive data "STAGE": jsii.String("prod"), }, EnvironmentFiles: []environmentFile{ ecs.*environmentFile_FromAsset(jsii.String("./demo-env-file.env")), ecs.*environmentFile_FromBucket(s3Bucket, jsii.String("assets/demo-env-file.env")), }, Secrets: map[string]secret{ // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store at container start-up. "SECRET": ecs.*secret_fromSecretsManager(secret), "DB_PASSWORD": ecs.*secret_fromSecretsManager(dbSecret, jsii.String("password")), // Reference a specific JSON field, (requires platform version 1.4.0 or later for Fargate tasks) "API_KEY": ecs.*secret_fromSecretsManagerVersion(secret, &SecretVersionInfo{ "versionId": jsii.String("12345"), }, jsii.String("apiKey")), // Reference a specific version of the secret by its version id or version stage (requires platform version 1.4.0 or later for Fargate tasks) "PARAMETER": ecs.*secret_fromSsmParameter(parameter), }, }) newContainer.AddEnvironment(jsii.String("QUEUE_NAME"), jsii.String("MyQueue")) newContainer.AddSecret(jsii.String("API_KEY"), ecs.secret_FromSecretsManager(secret)) newContainer.AddSecret(jsii.String("DB_PASSWORD"), ecs.secret_FromSecretsManager(secret, jsii.String("password")))
type EnvironmentFileConfig ¶
type EnvironmentFileConfig struct { // The type of environment file. FileType EnvironmentFileType `field:"required" json:"fileType" yaml:"fileType"` // The location of the environment file in S3. S3Location *awss3.Location `field:"required" json:"s3Location" yaml:"s3Location"` }
Configuration for the environment file.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentFileConfig := &EnvironmentFileConfig{ FileType: awscdk.Aws_ecs.EnvironmentFileType_S3, S3Location: &Location{ BucketName: jsii.String("bucketName"), ObjectKey: jsii.String("objectKey"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, }
type EnvironmentFileType ¶
type EnvironmentFileType string
Type of environment file to be included in the container definition.
const ( // Environment file hosted on S3, referenced by object ARN. EnvironmentFileType_S3 EnvironmentFileType = "S3" )
type ExecuteCommandConfiguration ¶
type ExecuteCommandConfiguration struct { // The AWS Key Management Service key ID to encrypt the data between the local client and the container. // Default: - none. // KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"` // The log configuration for the results of the execute command actions. // // The logs can be sent to CloudWatch Logs or an Amazon S3 bucket. // Default: - none. // LogConfiguration *ExecuteCommandLogConfiguration `field:"optional" json:"logConfiguration" yaml:"logConfiguration"` // The log settings to use for logging the execute command session. // Default: - none. // Logging ExecuteCommandLogging `field:"optional" json:"logging" yaml:"logging"` }
The details of the execute command configuration.
For more information, see ExecuteCommandConfiguration https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html
Example:
var vpc vpc kmsKey := kms.NewKey(this, jsii.String("KmsKey")) // Pass the KMS key in the `encryptionKey` field to associate the key to the log group logGroup := logs.NewLogGroup(this, jsii.String("LogGroup"), &LogGroupProps{ EncryptionKey: kmsKey, }) // Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket execBucket := s3.NewBucket(this, jsii.String("EcsExecBucket"), &BucketProps{ EncryptionKey: kmsKey, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, ExecuteCommandConfiguration: &ExecuteCommandConfiguration{ KmsKey: *KmsKey, LogConfiguration: &ExecuteCommandLogConfiguration{ CloudWatchLogGroup: logGroup, CloudWatchEncryptionEnabled: jsii.Boolean(true), S3Bucket: execBucket, S3EncryptionEnabled: jsii.Boolean(true), S3KeyPrefix: jsii.String("exec-command-output"), }, Logging: ecs.ExecuteCommandLogging_OVERRIDE, }, })
type ExecuteCommandLogConfiguration ¶
type ExecuteCommandLogConfiguration struct { // Whether or not to enable encryption on the CloudWatch logs. // Default: - encryption will be disabled. // CloudWatchEncryptionEnabled *bool `field:"optional" json:"cloudWatchEncryptionEnabled" yaml:"cloudWatchEncryptionEnabled"` // The name of the CloudWatch log group to send logs to. // // The CloudWatch log group must already be created. // Default: - none. // CloudWatchLogGroup awslogs.ILogGroup `field:"optional" json:"cloudWatchLogGroup" yaml:"cloudWatchLogGroup"` // The name of the S3 bucket to send logs to. // // The S3 bucket must already be created. // Default: - none. // S3Bucket awss3.IBucket `field:"optional" json:"s3Bucket" yaml:"s3Bucket"` // Whether or not to enable encryption on the S3 bucket. // Default: - encryption will be disabled. // S3EncryptionEnabled *bool `field:"optional" json:"s3EncryptionEnabled" yaml:"s3EncryptionEnabled"` // An optional folder in the S3 bucket to place logs in. // Default: - none. // S3KeyPrefix *string `field:"optional" json:"s3KeyPrefix" yaml:"s3KeyPrefix"` }
The log configuration for the results of the execute command actions.
The logs can be sent to CloudWatch Logs and/ or an Amazon S3 bucket. For more information, see ExecuteCommandLogConfiguration https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html
Example:
var vpc vpc kmsKey := kms.NewKey(this, jsii.String("KmsKey")) // Pass the KMS key in the `encryptionKey` field to associate the key to the log group logGroup := logs.NewLogGroup(this, jsii.String("LogGroup"), &LogGroupProps{ EncryptionKey: kmsKey, }) // Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket execBucket := s3.NewBucket(this, jsii.String("EcsExecBucket"), &BucketProps{ EncryptionKey: kmsKey, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, ExecuteCommandConfiguration: &ExecuteCommandConfiguration{ KmsKey: *KmsKey, LogConfiguration: &ExecuteCommandLogConfiguration{ CloudWatchLogGroup: logGroup, CloudWatchEncryptionEnabled: jsii.Boolean(true), S3Bucket: execBucket, S3EncryptionEnabled: jsii.Boolean(true), S3KeyPrefix: jsii.String("exec-command-output"), }, Logging: ecs.ExecuteCommandLogging_OVERRIDE, }, })
type ExecuteCommandLogging ¶
type ExecuteCommandLogging string
The log settings to use to for logging the execute command session.
For more information, see [Logging] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logging
Example:
var vpc vpc kmsKey := kms.NewKey(this, jsii.String("KmsKey")) // Pass the KMS key in the `encryptionKey` field to associate the key to the log group logGroup := logs.NewLogGroup(this, jsii.String("LogGroup"), &LogGroupProps{ EncryptionKey: kmsKey, }) // Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket execBucket := s3.NewBucket(this, jsii.String("EcsExecBucket"), &BucketProps{ EncryptionKey: kmsKey, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, ExecuteCommandConfiguration: &ExecuteCommandConfiguration{ KmsKey: *KmsKey, LogConfiguration: &ExecuteCommandLogConfiguration{ CloudWatchLogGroup: logGroup, CloudWatchEncryptionEnabled: jsii.Boolean(true), S3Bucket: execBucket, S3EncryptionEnabled: jsii.Boolean(true), S3KeyPrefix: jsii.String("exec-command-output"), }, Logging: ecs.ExecuteCommandLogging_OVERRIDE, }, })
const ( // The execute command session is not logged. ExecuteCommandLogging_NONE ExecuteCommandLogging = "NONE" // The awslogs configuration in the task definition is used. // // If no logging parameter is specified, it defaults to this value. If no awslogs log driver is configured in the task definition, the output won't be logged. ExecuteCommandLogging_DEFAULT ExecuteCommandLogging = "DEFAULT" // Specify the logging details as a part of logConfiguration. ExecuteCommandLogging_OVERRIDE ExecuteCommandLogging = "OVERRIDE" )
type ExternalService ¶
type ExternalService interface { BaseService IExternalService // The details of the AWS Cloud Map service. CloudmapService() awsservicediscovery.Service SetCloudmapService(val awsservicediscovery.Service) // The CloudMap service created for this service, if any. CloudMapService() awsservicediscovery.IService // The cluster that hosts the service. Cluster() ICluster // The security groups which manage the allowed network traffic for the service. Connections() awsec2.Connections // The deployment alarms property - this will be rendered directly and lazily as the CfnService.alarms property. DeploymentAlarms() *CfnService_DeploymentAlarmsProperty SetDeploymentAlarms(val *CfnService_DeploymentAlarmsProperty) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. LoadBalancers() *[]*CfnService_LoadBalancerProperty SetLoadBalancers(val *[]*CfnService_LoadBalancerProperty) // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. NetworkConfiguration() *CfnService_NetworkConfigurationProperty SetNetworkConfiguration(val *CfnService_NetworkConfigurationProperty) // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The Amazon Resource Name (ARN) of the service. ServiceArn() *string // The name of the service. ServiceName() *string // The details of the service discovery registries to assign to this service. // // For more information, see Service Discovery. ServiceRegistries() *[]*CfnService_ServiceRegistryProperty SetServiceRegistries(val *[]*CfnService_ServiceRegistryProperty) // The stack in which this resource is defined. Stack() awscdk.Stack // The task definition to use for tasks in the service. TaskDefinition() TaskDefinition // Adds a volume to the Service. AddVolume(volume ServiceManagedVolume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Overriden method to throw error as `associateCloudMapService` is not supported for external service. AssociateCloudMapService(_options *AssociateCloudMapServiceOptions) // Overriden method to throw error as `attachToApplicationTargetGroup` is not supported for external service. AttachToApplicationTargetGroup(_targetGroup awselasticloadbalancingv2.IApplicationTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // Registers the service as a target of a Classic Load Balancer (CLB). // // Don't call this. Call `loadBalancer.addTarget()` instead. AttachToClassicLB(loadBalancer awselasticloadbalancing.LoadBalancer) // This method is called to attach this service to a Network Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToNetworkTargetGroup(targetGroup awselasticloadbalancingv2.INetworkTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // Overriden method to throw error as `autoScaleTaskCount` is not supported for external service. AutoScaleTaskCount(_props *awsapplicationautoscaling.EnableScalingProps) ScalableTaskCount // Overriden method to throw error as `configureAwsVpcNetworkingWithSecurityGroups` is not supported for external service. ConfigureAwsVpcNetworkingWithSecurityGroups(_vpc awsec2.IVpc, _assignPublicIp *bool, _vpcSubnets *awsec2.SubnetSelection, _securityGroups *[]awsec2.ISecurityGroup) // Overriden method to throw error as `enableCloudMap` is not supported for external service. EnableCloudMap(_options *CloudMapOptions) awsservicediscovery.Service // Enable Deployment Alarms which take advantage of arbitrary alarms and configure them after service initialization. // // If you have already enabled deployment alarms, this function can be used to tell ECS about additional alarms that // should interrupt a deployment. // // New alarms specified in subsequent calls of this function will be appended to the existing list of alarms. // // The same Alarm Behavior must be used on all deployment alarms. If you specify different AlarmBehavior values in // multiple calls to this function, or the Alarm Behavior used here doesn't match the one used in the service // constructor, an error will be thrown. // // If the alarm's metric references the service, you cannot pass `Alarm.alarmName` here. That will cause a circular // dependency between the service and its deployment alarm. See this package's README for options to alarm on service // metrics, and avoid this circular dependency. EnableDeploymentAlarms(alarmNames *[]*string, options *DeploymentAlarmOptions) // Enable Service Connect on this service. EnableServiceConnect(config *ServiceConnectProps) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Overriden method to throw error as `loadBalancerTarget` is not supported for external service. LoadBalancerTarget(_options *LoadBalancerTargetOptions) IEcsLoadBalancerTarget // This method returns the specified CloudWatch metric name for this service. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's CPU utilization. // Default: average over 5 minutes. // MetricCpuUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's memory utilization. // Default: average over 5 minutes. // MetricMemoryUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Overriden method to throw error as `registerLoadBalancerTargets` is not supported for external service. RegisterLoadBalancerTargets(_targets ...*EcsTarget) // Returns a string representation of this construct. ToString() *string }
This creates a service using the External launch type on an ECS cluster.
Example:
var cluster cluster var taskDefinition taskDefinition service := ecs.NewExternalService(this, jsii.String("Service"), &ExternalServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DesiredCount: jsii.Number(5), })
func NewExternalService ¶
func NewExternalService(scope constructs.Construct, id *string, props *ExternalServiceProps) ExternalService
Constructs a new instance of the ExternalService class.
type ExternalServiceAttributes ¶
type ExternalServiceAttributes struct { // The cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // The service ARN. // Default: - either this, or `serviceName`, is required. // ServiceArn *string `field:"optional" json:"serviceArn" yaml:"serviceArn"` // The name of the service. // Default: - either this, or `serviceArn`, is required. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` }
The properties to import from the service using the External launch type.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster externalServiceAttributes := &ExternalServiceAttributes{ Cluster: cluster, // the properties below are optional ServiceArn: jsii.String("serviceArn"), ServiceName: jsii.String("serviceName"), }
type ExternalServiceProps ¶
type ExternalServiceProps struct { // The name of the cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // A list of Capacity Provider strategies used to place a service. // Default: - undefined. // CapacityProviderStrategies *[]*CapacityProviderStrategy `field:"optional" json:"capacityProviderStrategies" yaml:"capacityProviderStrategies"` // Whether to enable the deployment circuit breaker. // // If this property is defined, circuit breaker will be implicitly // enabled. // Default: - disabled. // CircuitBreaker *DeploymentCircuitBreaker `field:"optional" json:"circuitBreaker" yaml:"circuitBreaker"` // The options for configuring an Amazon ECS service to use service discovery. // Default: - AWS Cloud Map service discovery is not enabled. // CloudMapOptions *CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. // Default: - No alarms will be monitored during deployment. // DeploymentAlarms *DeploymentAlarmConfig `field:"optional" json:"deploymentAlarms" yaml:"deploymentAlarms"` // Specifies which deployment controller to use for the service. // // For more information, see // [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // Default: - Rolling update (ECS). // DeploymentController *DeploymentController `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to enable Amazon ECS managed tags for the tasks within the service. // // For more information, see // [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) // Default: false. // EnableECSManagedTags *bool `field:"optional" json:"enableECSManagedTags" yaml:"enableECSManagedTags"` // Whether to enable the ability to execute into a container. // Default: - undefined. // EnableExecuteCommand *bool `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set. // HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. // Default: - 100 if daemon, otherwise 200. // MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. // Default: - 0 if daemon, otherwise 50. // MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE // Default: PropagatedTagSource.NONE // PropagateTags PropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // Configuration for Service Connect. // Default: No ports are advertised via Service Connect on this service, and the service // cannot make requests to other services via Service Connect. // ServiceConnectConfiguration *ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of the service. // Default: - CloudFormation-generated name. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // Revision number for the task definition or `latest` to use the latest active task revision. // Default: - Uses the revision of the passed task definition deployed by CloudFormation. // TaskDefinitionRevision TaskDefinitionRevision `field:"optional" json:"taskDefinitionRevision" yaml:"taskDefinitionRevision"` // Configuration details for a volume used by the service. // // This allows you to specify // details about the EBS volume that can be attched to ECS tasks. // Default: - undefined. // VolumeConfigurations *[]ServiceManagedVolume `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` // The task definition to use for tasks in the service. // // [disable-awslint:ref-via-interface]. TaskDefinition TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // The security groups to associate with the service. // // If you do not specify a security group, a new security group is created. // Default: - A new security group is created. // SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` }
The properties for defining a service using the External launch type.
Example:
var cluster cluster var taskDefinition taskDefinition service := ecs.NewExternalService(this, jsii.String("Service"), &ExternalServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DesiredCount: jsii.Number(5), })
type ExternalTaskDefinition ¶
type ExternalTaskDefinition interface { TaskDefinition IExternalTaskDefinition // The task launch type compatibility requirement. Compatibility() Compatibility // The container definitions. Containers() *[]ContainerDefinition // Default container for this task. // // Load balancers will send traffic to this container. The first // essential container that is added to this task will become the default // container. DefaultContainer() ContainerDefinition SetDefaultContainer(val ContainerDefinition) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The amount (in GiB) of ephemeral storage to be allocated to the task. // // Only supported in Fargate platform version 1.4.0 or later. EphemeralStorageGiB() *float64 // Execution role for this task definition. ExecutionRole() awsiam.IRole // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. Family() *string // Public getter method to access list of inference accelerators attached to the instance. InferenceAccelerators() *[]*InferenceAccelerator // Return true if the task definition can be run on an EC2 cluster. IsEc2Compatible() *bool // Return true if the task definition can be run on a ECS anywhere cluster. IsExternalCompatible() *bool // Return true if the task definition can be run on a Fargate cluster. IsFargateCompatible() *bool // The networking mode to use for the containers in the task. NetworkMode() NetworkMode // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The stack in which this resource is defined. Stack() awscdk.Stack // The full Amazon Resource Name (ARN) of the task definition. TaskDefinitionArn() *string // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. TaskRole() awsiam.IRole // Adds a new container to the task definition. AddContainer(id *string, props *ContainerDefinitionOptions) ContainerDefinition // Adds the specified extension to the task definition. // // Extension can be used to apply a packaged modification to // a task definition. AddExtension(extension ITaskDefinitionExtension) // Adds a firelens log router to the task definition. AddFirelensLogRouter(id *string, props *FirelensLogRouterDefinitionOptions) FirelensLogRouter // Overriden method to throw error as interface accelerators are not supported for external tasks. AddInferenceAccelerator(_inferenceAccelerator *InferenceAccelerator) // Adds the specified placement constraint to the task definition. AddPlacementConstraint(constraint PlacementConstraint) // Adds a policy statement to the task execution IAM role. AddToExecutionRolePolicy(statement awsiam.PolicyStatement) // Adds a policy statement to the task IAM role. AddToTaskRolePolicy(statement awsiam.PolicyStatement) // Adds a volume to the task definition. AddVolume(volume *Volume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns the container that match the provided containerName. FindContainer(containerName *string) ContainerDefinition // Determine the existing port mapping for the provided name. // // Returns: PortMapping for the provided name, if it exists. FindPortMappingByName(name *string) *PortMapping GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grants permissions to run this task definition. // // This will grant the following permissions: // // - ecs:RunTask // - iam:PassRole. GrantRun(grantee awsiam.IGrantable) awsiam.Grant // Creates the task execution IAM role if it doesn't already exist. ObtainExecutionRole() awsiam.IRole // Returns a string representation of this construct. ToString() *string }
The details of a task definition run on an External cluster.
Example:
externalTaskDefinition := ecs.NewExternalTaskDefinition(this, jsii.String("TaskDef")) container := externalTaskDefinition.AddContainer(jsii.String("WebContainer"), &ContainerDefinitionOptions{ // Use an image from DockerHub Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), })
func NewExternalTaskDefinition ¶
func NewExternalTaskDefinition(scope constructs.Construct, id *string, props *ExternalTaskDefinitionProps) ExternalTaskDefinition
Constructs a new instance of the ExternalTaskDefinition class.
type ExternalTaskDefinitionAttributes ¶
type ExternalTaskDefinitionAttributes struct { // The arn of the task definition. TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"` // The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. // // Some tasks do not have an execution role. // Default: - undefined. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The networking mode to use for the containers in the task. // Default: Network mode cannot be provided to the imported task. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: Permissions cannot be granted to the imported task. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` }
Attributes used to import an existing External task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role externalTaskDefinitionAttributes := &ExternalTaskDefinitionAttributes{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional ExecutionRole: role, NetworkMode: awscdk.Aws_ecs.NetworkMode_NONE, TaskRole: role, }
type ExternalTaskDefinitionProps ¶
type ExternalTaskDefinitionProps struct { // The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. // // The role will be used to retrieve container images from ECR and create CloudWatch log groups. // Default: - An execution role will be automatically created if you use ECR images in your task definition. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. // Default: - Automatically generated name. // Family *string `field:"optional" json:"family" yaml:"family"` // The configuration details for the App Mesh proxy. // Default: - No proxy configuration. // ProxyConfiguration ProxyConfiguration `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // The list of volume definitions for the task. // // For more information, see // [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes). // Default: - No volumes are passed to the Docker daemon on a container instance. // Volumes *[]*Volume `field:"optional" json:"volumes" yaml:"volumes"` // The networking mode to use for the containers in the task. // // With ECS Anywhere, supported modes are bridge, host and none. // Default: NetworkMode.BRIDGE // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` }
The properties for a task definition run on an External cluster.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var proxyConfiguration proxyConfiguration var role role externalTaskDefinitionProps := &ExternalTaskDefinitionProps{ ExecutionRole: role, Family: jsii.String("family"), NetworkMode: awscdk.Aws_ecs.NetworkMode_NONE, ProxyConfiguration: proxyConfiguration, TaskRole: role, Volumes: []volume{ &volume{ Name: jsii.String("name"), // the properties below are optional ConfiguredAtLaunch: jsii.Boolean(false), DockerVolumeConfiguration: &DockerVolumeConfiguration{ Driver: jsii.String("driver"), Scope: awscdk.*Aws_ecs.Scope_TASK, // the properties below are optional Autoprovision: jsii.Boolean(false), DriverOpts: map[string]*string{ "driverOptsKey": jsii.String("driverOpts"), }, Labels: map[string]*string{ "labelsKey": jsii.String("labels"), }, }, EfsVolumeConfiguration: &EfsVolumeConfiguration{ FileSystemId: jsii.String("fileSystemId"), // the properties below are optional AuthorizationConfig: &AuthorizationConfig{ AccessPointId: jsii.String("accessPointId"), Iam: jsii.String("iam"), }, RootDirectory: jsii.String("rootDirectory"), TransitEncryption: jsii.String("transitEncryption"), TransitEncryptionPort: jsii.Number(123), }, Host: &Host{ SourcePath: jsii.String("sourcePath"), }, }, }, }
type FargatePlatformVersion ¶
type FargatePlatformVersion string
The platform version on which to run your service.
Example:
var cluster cluster scheduledFargateTask := ecsPatterns.NewScheduledFargateTask(this, jsii.String("ScheduledFargateTask"), &ScheduledFargateTaskProps{ Cluster: Cluster, ScheduledFargateTaskImageOptions: &ScheduledFargateTaskImageOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(512), }, Schedule: appscaling.Schedule_Expression(jsii.String("rate(1 minute)")), PlatformVersion: ecs.FargatePlatformVersion_LATEST, })
See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html
const ( // The latest, recommended platform version. FargatePlatformVersion_LATEST FargatePlatformVersion = "LATEST" // Version 1.4.0. // // Supports EFS endpoints, CAP_SYS_PTRACE Linux capability, // network performance metrics in CloudWatch Container Insights, // consolidated 20 GB ephemeral volume. FargatePlatformVersion_VERSION1_4 FargatePlatformVersion = "VERSION1_4" // Version 1.3.0. // // Supports secrets, task recycling. FargatePlatformVersion_VERSION1_3 FargatePlatformVersion = "VERSION1_3" // Version 1.2.0. // // Supports private registries. FargatePlatformVersion_VERSION1_2 FargatePlatformVersion = "VERSION1_2" // Version 1.1.0. // // Supports task metadata, health checks, service discovery. FargatePlatformVersion_VERSION1_1 FargatePlatformVersion = "VERSION1_1" // Initial release. // // Based on Amazon Linux 2017.09. FargatePlatformVersion_VERSION1_0 FargatePlatformVersion = "VERSION1_0" )
type FargateService ¶
type FargateService interface { BaseService IFargateService // The details of the AWS Cloud Map service. CloudmapService() awsservicediscovery.Service SetCloudmapService(val awsservicediscovery.Service) // The CloudMap service created for this service, if any. CloudMapService() awsservicediscovery.IService // The cluster that hosts the service. Cluster() ICluster // The security groups which manage the allowed network traffic for the service. Connections() awsec2.Connections // The deployment alarms property - this will be rendered directly and lazily as the CfnService.alarms property. DeploymentAlarms() *CfnService_DeploymentAlarmsProperty SetDeploymentAlarms(val *CfnService_DeploymentAlarmsProperty) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. LoadBalancers() *[]*CfnService_LoadBalancerProperty SetLoadBalancers(val *[]*CfnService_LoadBalancerProperty) // A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer. NetworkConfiguration() *CfnService_NetworkConfigurationProperty SetNetworkConfiguration(val *CfnService_NetworkConfigurationProperty) // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The Amazon Resource Name (ARN) of the service. ServiceArn() *string // The name of the service. ServiceName() *string // The details of the service discovery registries to assign to this service. // // For more information, see Service Discovery. ServiceRegistries() *[]*CfnService_ServiceRegistryProperty SetServiceRegistries(val *[]*CfnService_ServiceRegistryProperty) // The stack in which this resource is defined. Stack() awscdk.Stack // The task definition to use for tasks in the service. TaskDefinition() TaskDefinition // Adds a volume to the Service. AddVolume(volume ServiceManagedVolume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Associates this service with a CloudMap service. AssociateCloudMapService(options *AssociateCloudMapServiceOptions) // This method is called to attach this service to an Application Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToApplicationTargetGroup(targetGroup awselasticloadbalancingv2.IApplicationTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // Registers the service as a target of a Classic Load Balancer (CLB). // // Don't call this. Call `loadBalancer.addTarget()` instead. AttachToClassicLB(loadBalancer awselasticloadbalancing.LoadBalancer) // This method is called to attach this service to a Network Load Balancer. // // Don't call this function directly. Instead, call `listener.addTargets()` // to add this service to a load balancer. AttachToNetworkTargetGroup(targetGroup awselasticloadbalancingv2.INetworkTargetGroup) *awselasticloadbalancingv2.LoadBalancerTargetProps // An attribute representing the minimum and maximum task count for an AutoScalingGroup. AutoScaleTaskCount(props *awsapplicationautoscaling.EnableScalingProps) ScalableTaskCount // This method is called to create a networkConfiguration. ConfigureAwsVpcNetworkingWithSecurityGroups(vpc awsec2.IVpc, assignPublicIp *bool, vpcSubnets *awsec2.SubnetSelection, securityGroups *[]awsec2.ISecurityGroup) // Enable CloudMap service discovery for the service. // // Returns: The created CloudMap service. EnableCloudMap(options *CloudMapOptions) awsservicediscovery.Service // Enable Deployment Alarms which take advantage of arbitrary alarms and configure them after service initialization. // // If you have already enabled deployment alarms, this function can be used to tell ECS about additional alarms that // should interrupt a deployment. // // New alarms specified in subsequent calls of this function will be appended to the existing list of alarms. // // The same Alarm Behavior must be used on all deployment alarms. If you specify different AlarmBehavior values in // multiple calls to this function, or the Alarm Behavior used here doesn't match the one used in the service // constructor, an error will be thrown. // // If the alarm's metric references the service, you cannot pass `Alarm.alarmName` here. That will cause a circular // dependency between the service and its deployment alarm. See this package's README for options to alarm on service // metrics, and avoid this circular dependency. EnableDeploymentAlarms(alarmNames *[]*string, options *DeploymentAlarmOptions) // Enable Service Connect on this service. EnableServiceConnect(config *ServiceConnectProps) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Return a load balancing target for a specific container and port. // // Use this function to create a load balancer target if you want to load balance to // another container than the first essential container or the first mapped port on // the container. // // Use the return value of this function where you would normally use a load balancer // target, instead of the `Service` object itself. // // Example: // declare const listener: elbv2.ApplicationListener; // declare const service: ecs.BaseService; // listener.addTargets('ECS', { // port: 80, // targets: [service.loadBalancerTarget({ // containerName: 'MyContainer', // containerPort: 1234, // })], // }); // LoadBalancerTarget(options *LoadBalancerTargetOptions) IEcsLoadBalancerTarget // This method returns the specified CloudWatch metric name for this service. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's CPU utilization. // Default: average over 5 minutes. // MetricCpuUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // This method returns the CloudWatch metric for this service's memory utilization. // Default: average over 5 minutes. // MetricMemoryUtilization(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Use this function to create all load balancer targets to be registered in this service, add them to target groups, and attach target groups to listeners accordingly. // // Alternatively, you can use `listener.addTargets()` to create targets and add them to target groups. // // Example: // declare const listener: elbv2.ApplicationListener; // declare const service: ecs.BaseService; // service.registerLoadBalancerTargets( // { // containerName: 'web', // containerPort: 80, // newTargetGroupId: 'ECS', // listener: ecs.ListenerConfig.applicationListener(listener, { // protocol: elbv2.ApplicationProtocol.HTTPS // }), // }, // ) // RegisterLoadBalancerTargets(targets ...*EcsTarget) // Returns a string representation of this construct. ToString() *string }
This creates a service using the Fargate launch type on an ECS cluster.
Example:
import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var taskDefinition taskDefinition serviceName := "MyFargateService" service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ ServiceName: jsii.String(ServiceName), Cluster: Cluster, TaskDefinition: TaskDefinition, }) cpuMetric := cw.NewMetric(&MetricProps{ MetricName: jsii.String("CPUUtilization"), Namespace: jsii.String("AWS/ECS"), Period: awscdk.Duration_Minutes(jsii.Number(5)), Statistic: jsii.String("Average"), DimensionsMap: map[string]*string{ "ClusterName": cluster.clusterName, // Using `service.serviceName` here will cause a circular dependency "ServiceName": serviceName, }, }) myAlarm := cw.NewAlarm(this, jsii.String("CPUAlarm"), &AlarmProps{ AlarmName: jsii.String("cpuAlarmName"), Metric: cpuMetric, EvaluationPeriods: jsii.Number(2), Threshold: jsii.Number(80), }) service.EnableDeploymentAlarms([]*string{ myAlarm.AlarmName, }, &DeploymentAlarmOptions{ Behavior: ecs.AlarmBehavior_FAIL_ON_ALARM, })
func NewFargateService ¶
func NewFargateService(scope constructs.Construct, id *string, props *FargateServiceProps) FargateService
Constructs a new instance of the FargateService class.
type FargateServiceAttributes ¶
type FargateServiceAttributes struct { // The cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // The service ARN. // Default: - either this, or `serviceName`, is required. // ServiceArn *string `field:"optional" json:"serviceArn" yaml:"serviceArn"` // The name of the service. // Default: - either this, or `serviceArn`, is required. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` }
The properties to import from the service using the Fargate launch type.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster fargateServiceAttributes := &FargateServiceAttributes{ Cluster: cluster, // the properties below are optional ServiceArn: jsii.String("serviceArn"), ServiceName: jsii.String("serviceName"), }
type FargateServiceProps ¶
type FargateServiceProps struct { // The name of the cluster that hosts the service. Cluster ICluster `field:"required" json:"cluster" yaml:"cluster"` // A list of Capacity Provider strategies used to place a service. // Default: - undefined. // CapacityProviderStrategies *[]*CapacityProviderStrategy `field:"optional" json:"capacityProviderStrategies" yaml:"capacityProviderStrategies"` // Whether to enable the deployment circuit breaker. // // If this property is defined, circuit breaker will be implicitly // enabled. // Default: - disabled. // CircuitBreaker *DeploymentCircuitBreaker `field:"optional" json:"circuitBreaker" yaml:"circuitBreaker"` // The options for configuring an Amazon ECS service to use service discovery. // Default: - AWS Cloud Map service discovery is not enabled. // CloudMapOptions *CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. // Default: - No alarms will be monitored during deployment. // DeploymentAlarms *DeploymentAlarmConfig `field:"optional" json:"deploymentAlarms" yaml:"deploymentAlarms"` // Specifies which deployment controller to use for the service. // // For more information, see // [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // Default: - Rolling update (ECS). // DeploymentController *DeploymentController `field:"optional" json:"deploymentController" yaml:"deploymentController"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // Specifies whether to enable Amazon ECS managed tags for the tasks within the service. // // For more information, see // [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) // Default: false. // EnableECSManagedTags *bool `field:"optional" json:"enableECSManagedTags" yaml:"enableECSManagedTags"` // Whether to enable the ability to execute into a container. // Default: - undefined. // EnableExecuteCommand *bool `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"` // The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. // Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set. // HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. // Default: - 100 if daemon, otherwise 200. // MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. // Default: - 0 if daemon, otherwise 50. // MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. // // Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE // Default: PropagatedTagSource.NONE // PropagateTags PropagatedTagSource `field:"optional" json:"propagateTags" yaml:"propagateTags"` // Configuration for Service Connect. // Default: No ports are advertised via Service Connect on this service, and the service // cannot make requests to other services via Service Connect. // ServiceConnectConfiguration *ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` // The name of the service. // Default: - CloudFormation-generated name. // ServiceName *string `field:"optional" json:"serviceName" yaml:"serviceName"` // Revision number for the task definition or `latest` to use the latest active task revision. // Default: - Uses the revision of the passed task definition deployed by CloudFormation. // TaskDefinitionRevision TaskDefinitionRevision `field:"optional" json:"taskDefinitionRevision" yaml:"taskDefinitionRevision"` // Configuration details for a volume used by the service. // // This allows you to specify // details about the EBS volume that can be attched to ECS tasks. // Default: - undefined. // VolumeConfigurations *[]ServiceManagedVolume `field:"optional" json:"volumeConfigurations" yaml:"volumeConfigurations"` // The task definition to use for tasks in the service. // // [disable-awslint:ref-via-interface]. TaskDefinition TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // Specifies whether the task's elastic network interface receives a public IP address. // // If true, each task will receive a public IP address. // Default: false. // AssignPublicIp *bool `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"` // The platform version on which to run your service. // // If one is not specified, the LATEST platform version is used by default. For more information, see // [AWS Fargate Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) // in the Amazon Elastic Container Service Developer Guide. // Default: Latest. // PlatformVersion FargatePlatformVersion `field:"optional" json:"platformVersion" yaml:"platformVersion"` // The security groups to associate with the service. // // If you do not specify a security group, a new security group is created. // Default: - A new security group is created. // SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The subnets to associate with the service. // Default: - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order. // VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` }
The properties for defining a service using the Fargate launch type.
Example:
import "github.com/aws/aws-cdk-go/awscdk" var cluster cluster var taskDefinition taskDefinition serviceName := "MyFargateService" service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ ServiceName: jsii.String(ServiceName), Cluster: Cluster, TaskDefinition: TaskDefinition, }) cpuMetric := cw.NewMetric(&MetricProps{ MetricName: jsii.String("CPUUtilization"), Namespace: jsii.String("AWS/ECS"), Period: awscdk.Duration_Minutes(jsii.Number(5)), Statistic: jsii.String("Average"), DimensionsMap: map[string]*string{ "ClusterName": cluster.clusterName, // Using `service.serviceName` here will cause a circular dependency "ServiceName": serviceName, }, }) myAlarm := cw.NewAlarm(this, jsii.String("CPUAlarm"), &AlarmProps{ AlarmName: jsii.String("cpuAlarmName"), Metric: cpuMetric, EvaluationPeriods: jsii.Number(2), Threshold: jsii.Number(80), }) service.EnableDeploymentAlarms([]*string{ myAlarm.AlarmName, }, &DeploymentAlarmOptions{ Behavior: ecs.AlarmBehavior_FAIL_ON_ALARM, })
type FargateTaskDefinition ¶
type FargateTaskDefinition interface { TaskDefinition IFargateTaskDefinition // The task launch type compatibility requirement. Compatibility() Compatibility // The container definitions. Containers() *[]ContainerDefinition // Default container for this task. // // Load balancers will send traffic to this container. The first // essential container that is added to this task will become the default // container. DefaultContainer() ContainerDefinition SetDefaultContainer(val ContainerDefinition) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The amount (in GiB) of ephemeral storage to be allocated to the task. EphemeralStorageGiB() *float64 // Execution role for this task definition. ExecutionRole() awsiam.IRole // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. Family() *string // Public getter method to access list of inference accelerators attached to the instance. InferenceAccelerators() *[]*InferenceAccelerator // Return true if the task definition can be run on an EC2 cluster. IsEc2Compatible() *bool // Return true if the task definition can be run on a ECS anywhere cluster. IsExternalCompatible() *bool // Return true if the task definition can be run on a Fargate cluster. IsFargateCompatible() *bool // The Docker networking mode to use for the containers in the task. // // Fargate tasks require the awsvpc network mode. NetworkMode() NetworkMode // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The stack in which this resource is defined. Stack() awscdk.Stack // The full Amazon Resource Name (ARN) of the task definition. TaskDefinitionArn() *string // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. TaskRole() awsiam.IRole // Adds a new container to the task definition. AddContainer(id *string, props *ContainerDefinitionOptions) ContainerDefinition // Adds the specified extension to the task definition. // // Extension can be used to apply a packaged modification to // a task definition. AddExtension(extension ITaskDefinitionExtension) // Adds a firelens log router to the task definition. AddFirelensLogRouter(id *string, props *FirelensLogRouterDefinitionOptions) FirelensLogRouter // Adds an inference accelerator to the task definition. AddInferenceAccelerator(inferenceAccelerator *InferenceAccelerator) // Adds the specified placement constraint to the task definition. AddPlacementConstraint(constraint PlacementConstraint) // Adds a policy statement to the task execution IAM role. AddToExecutionRolePolicy(statement awsiam.PolicyStatement) // Adds a policy statement to the task IAM role. AddToTaskRolePolicy(statement awsiam.PolicyStatement) // Adds a volume to the task definition. AddVolume(volume *Volume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns the container that match the provided containerName. FindContainer(containerName *string) ContainerDefinition // Determine the existing port mapping for the provided name. // // Returns: PortMapping for the provided name, if it exists. FindPortMappingByName(name *string) *PortMapping GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grants permissions to run this task definition. // // This will grant the following permissions: // // - ecs:RunTask // - iam:PassRole. GrantRun(grantee awsiam.IGrantable) awsiam.Grant // Creates the task execution IAM role if it doesn't already exist. ObtainExecutionRole() awsiam.IRole // Returns a string representation of this construct. ToString() *string }
The details of a task definition run on a Fargate cluster.
Example:
var vpc vpc cluster := ecs.NewCluster(this, jsii.String("FargateCPCluster"), &ClusterProps{ Vpc: Vpc, EnableFargateCapacityProviders: jsii.Boolean(true), }) taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), }) ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CapacityProviderStrategies: []capacityProviderStrategy{ &capacityProviderStrategy{ CapacityProvider: jsii.String("FARGATE_SPOT"), Weight: jsii.Number(2), }, &capacityProviderStrategy{ CapacityProvider: jsii.String("FARGATE"), Weight: jsii.Number(1), }, }, })
func NewFargateTaskDefinition ¶
func NewFargateTaskDefinition(scope constructs.Construct, id *string, props *FargateTaskDefinitionProps) FargateTaskDefinition
Constructs a new instance of the FargateTaskDefinition class.
type FargateTaskDefinitionAttributes ¶
type FargateTaskDefinitionAttributes struct { // The arn of the task definition. TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"` // The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. // // Some tasks do not have an execution role. // Default: - undefined. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The networking mode to use for the containers in the task. // Default: Network mode cannot be provided to the imported task. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: Permissions cannot be granted to the imported task. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` }
Attributes used to import an existing Fargate task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role fargateTaskDefinitionAttributes := &FargateTaskDefinitionAttributes{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional ExecutionRole: role, NetworkMode: awscdk.Aws_ecs.NetworkMode_NONE, TaskRole: role, }
type FargateTaskDefinitionProps ¶
type FargateTaskDefinitionProps struct { // The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. // // The role will be used to retrieve container images from ECR and create CloudWatch log groups. // Default: - An execution role will be automatically created if you use ECR images in your task definition. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. // Default: - Automatically generated name. // Family *string `field:"optional" json:"family" yaml:"family"` // The configuration details for the App Mesh proxy. // Default: - No proxy configuration. // ProxyConfiguration ProxyConfiguration `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // The list of volume definitions for the task. // // For more information, see // [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes). // Default: - No volumes are passed to the Docker daemon on a container instance. // Volumes *[]*Volume `field:"optional" json:"volumes" yaml:"volumes"` // The number of cpu units used by the task. // // For tasks using the Fargate launch type, // this field is required and you must use one of the following values, // which determines your range of valid values for the memory parameter: // // 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) // // 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) // // 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) // // 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) // // 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) // // 8192 (8 vCPU) - Available memory values: Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) // // 16384 (16 vCPU) - Available memory values: Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB). // Default: 256. // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // The amount (in GiB) of ephemeral storage to be allocated to the task. // // The maximum supported value is 200 GiB. // // NOTE: This parameter is only supported for tasks hosted on AWS Fargate using platform version 1.4.0 or later. // Default: 20. // EphemeralStorageGiB *float64 `field:"optional" json:"ephemeralStorageGiB" yaml:"ephemeralStorageGiB"` // The amount (in MiB) of memory used by the task. // // For tasks using the Fargate launch type, // this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter: // // 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) // // 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) // // 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) // // Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU) // // Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU) // // Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU) // // Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU). // Default: 512. // MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The operating system that your task definitions are running on. // // A runtimePlatform is supported only for tasks using the Fargate launch type. // Default: - Undefined. // RuntimePlatform *RuntimePlatform `field:"optional" json:"runtimePlatform" yaml:"runtimePlatform"` }
The properties for a task definition.
Example:
// Create a Task Definition for the Windows container to start taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{ RuntimePlatform: &RuntimePlatform{ OperatingSystemFamily: ecs.OperatingSystemFamily_WINDOWS_SERVER_2019_CORE(), CpuArchitecture: ecs.CpuArchitecture_X86_64(), }, Cpu: jsii.Number(1024), MemoryLimitMiB: jsii.Number(2048), }) taskDefinition.AddContainer(jsii.String("windowsservercore"), &ContainerDefinitionOptions{ Logging: ecs.LogDriver_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("win-iis-on-fargate"), }), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), }, }, Image: ecs.ContainerImage_FromRegistry(jsii.String("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")), })
type FileSystemType ¶ added in v2.122.0
type FileSystemType string
FileSystemType for Service Managed EBS Volume Configuration.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
const ( // ext3 type. FileSystemType_EXT3 FileSystemType = "EXT3" // ext4 type. FileSystemType_EXT4 FileSystemType = "EXT4" // xfs type. FileSystemType_XFS FileSystemType = "XFS" )
type FireLensLogDriver ¶
type FireLensLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
FireLens enables you to use task definition parameters to route logs to an AWS service or AWS Partner Network (APN) destination for log storage and analytics.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var secret secret fireLensLogDriver := awscdk.Aws_ecs.NewFireLensLogDriver(&FireLensLogDriverProps{ Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: map[string]*secret{ "secretOptionsKey": secret, }, Tag: jsii.String("tag"), })
func NewFireLensLogDriver ¶
func NewFireLensLogDriver(props *FireLensLogDriverProps) FireLensLogDriver
Constructs a new instance of the FireLensLogDriver class.
type FireLensLogDriverProps ¶
type FireLensLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // The configuration options to send to the log driver. // Default: - the log driver options. // Options *map[string]*string `field:"optional" json:"options" yaml:"options"` // The secrets to pass to the log configuration. // Default: - No secret options provided. // SecretOptions *map[string]Secret `field:"optional" json:"secretOptions" yaml:"secretOptions"` }
Specifies the firelens log driver configuration options.
Example:
// Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Firelens(&FireLensLogDriverProps{ Options: map[string]*string{ "Name": jsii.String("firehose"), "region": jsii.String("us-west-2"), "delivery_stream": jsii.String("my-stream"), }, }), })
type FirelensConfig ¶
type FirelensConfig struct { // The log router to use. // Default: - fluentbit. // Type FirelensLogRouterType `field:"required" json:"type" yaml:"type"` // Firelens options. // Default: - no additional options. // Options *FirelensOptions `field:"optional" json:"options" yaml:"options"` }
Firelens Configuration https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html#firelens-taskdef.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" firelensConfig := &FirelensConfig{ Type: awscdk.Aws_ecs.FirelensLogRouterType_FLUENTBIT, // the properties below are optional Options: &FirelensOptions{ ConfigFileType: awscdk.*Aws_ecs.FirelensConfigFileType_S3, ConfigFileValue: jsii.String("configFileValue"), EnableECSLogMetadata: jsii.Boolean(false), }, }
type FirelensConfigFileType ¶
type FirelensConfigFileType string
Firelens configuration file type, s3 or file path.
const ( // s3. FirelensConfigFileType_S3 FirelensConfigFileType = "S3" // fluentd. FirelensConfigFileType_FILE FirelensConfigFileType = "FILE" )
type FirelensLogRouter ¶
type FirelensLogRouter interface { ContainerDefinition // An array dependencies defined for container startup and shutdown. ContainerDependencies() *[]*ContainerDependency // The name of this container. ContainerName() *string // The port the container will listen on. ContainerPort() *float64 // The number of cpu units reserved for the container. Cpu() *float64 // The environment files for this container. EnvironmentFiles() *[]*EnvironmentFileConfig // Specifies whether the container will be marked essential. // // If the essential parameter of a container is marked as true, and that container // fails or stops for any reason, all other containers that are part of the task are // stopped. If the essential parameter of a container is marked as false, then its // failure does not affect the rest of the containers in a task. // // If this parameter is omitted, a container is assumed to be essential. Essential() *bool // Firelens configuration. FirelensConfig() *FirelensConfig // The name of the image referenced by this container. ImageName() *string // The inbound rules associated with the security group the task or service will use. // // This property is only used for tasks that use the awsvpc network mode. IngressPort() *float64 // The Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. LinuxParameters() LinuxParameters // The log configuration specification for the container. LogDriverConfig() *LogDriverConfig // Whether there was at least one memory limit specified in this definition. MemoryLimitSpecified() *bool // The mount points for data volumes in your container. MountPoints() *[]*MountPoint // The tree node. Node() constructs.Node // The list of port mappings for the container. // // Port mappings allow containers to access ports // on the host container instance to send or receive traffic. PortMappings() *[]*PortMapping // Specifies whether a TTY must be allocated for this container. PseudoTerminal() *bool // Whether this container definition references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The name of the task definition that includes this container definition. TaskDefinition() TaskDefinition // An array of ulimits to set in the container. Ulimits() *[]*Ulimit // The data volumes to mount from another container in the same task definition. VolumesFrom() *[]*VolumeFrom // This method adds one or more container dependencies to the container. AddContainerDependencies(containerDependencies ...*ContainerDependency) // This method adds an environment variable to the container. AddEnvironment(name *string, value *string) // This method adds one or more resources to the container. AddInferenceAcceleratorResource(inferenceAcceleratorResources ...*string) // This method adds a link which allows containers to communicate with each other without the need for port mappings. // // This parameter is only supported if the task definition is using the bridge network mode. // Warning: The --link flag is a legacy feature of Docker. It may eventually be removed. AddLink(container ContainerDefinition, alias *string) // This method adds one or more mount points for data volumes to the container. AddMountPoints(mountPoints ...*MountPoint) // This method adds one or more port mappings to the container. AddPortMappings(portMappings ...*PortMapping) // This method mounts temporary disk space to the container. // // This adds the correct container mountPoint and task definition volume. AddScratch(scratch *ScratchSpace) // This method adds a secret as environment variable to the container. AddSecret(name *string, secret Secret) // This method adds the specified statement to the IAM task execution policy in the task definition. AddToExecutionPolicy(statement awsiam.PolicyStatement) // This method adds one or more ulimits to the container. AddUlimits(ulimits ...*Ulimit) // This method adds one or more volumes to the container. AddVolumesFrom(volumesFrom ...*VolumeFrom) // Returns the host port for the requested container port if it exists. FindPortMapping(containerPort *float64, protocol Protocol) *PortMapping // Returns the port mapping with the given name, if it exists. FindPortMappingByName(name *string) *PortMapping // Render this container definition to a CloudFormation object. RenderContainerDefinition(_taskDefinition TaskDefinition) *CfnTaskDefinition_ContainerDefinitionProperty // Returns a string representation of this construct. ToString() *string }
Firelens log router.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol var containerImage containerImage var environmentFile environmentFile var linuxParameters linuxParameters var logDriver logDriver var secret secret var taskDefinition taskDefinition firelensLogRouter := awscdk.Aws_ecs.NewFirelensLogRouter(this, jsii.String("MyFirelensLogRouter"), &FirelensLogRouterProps{ FirelensConfig: &FirelensConfig{ Type: awscdk.*Aws_ecs.FirelensLogRouterType_FLUENTBIT, // the properties below are optional Options: &FirelensOptions{ ConfigFileType: awscdk.*Aws_ecs.FirelensConfigFileType_S3, ConfigFileValue: jsii.String("configFileValue"), EnableECSLogMetadata: jsii.Boolean(false), }, }, Image: containerImage, TaskDefinition: taskDefinition, // the properties below are optional Command: []*string{ jsii.String("command"), }, ContainerName: jsii.String("containerName"), Cpu: jsii.Number(123), DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentFiles: []*environmentFile{ environmentFile, }, Essential: jsii.Boolean(false), ExtraHosts: map[string]*string{ "extraHostsKey": jsii.String("extraHosts"), }, GpuCount: jsii.Number(123), HealthCheck: &HealthCheck{ Command: []*string{ jsii.String("command"), }, // the properties below are optional Interval: cdk.Duration_Minutes(jsii.Number(30)), Retries: jsii.Number(123), StartPeriod: cdk.Duration_*Minutes(jsii.Number(30)), Timeout: cdk.Duration_*Minutes(jsii.Number(30)), }, Hostname: jsii.String("hostname"), InferenceAcceleratorResources: []*string{ jsii.String("inferenceAcceleratorResources"), }, Interactive: jsii.Boolean(false), LinuxParameters: linuxParameters, Logging: logDriver, MemoryLimitMiB: jsii.Number(123), MemoryReservationMiB: jsii.Number(123), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.*Aws_ecs.Protocol_TCP, }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), Secrets: map[string]*secret{ "secretsKey": secret, }, StartTimeout: cdk.Duration_*Minutes(jsii.Number(30)), StopTimeout: cdk.Duration_*Minutes(jsii.Number(30)), SystemControls: []systemControl{ &systemControl{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []ulimit{ &ulimit{ HardLimit: jsii.Number(123), Name: awscdk.*Aws_ecs.UlimitName_CORE, SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), WorkingDirectory: jsii.String("workingDirectory"), })
func NewFirelensLogRouter ¶
func NewFirelensLogRouter(scope constructs.Construct, id *string, props *FirelensLogRouterProps) FirelensLogRouter
Constructs a new instance of the FirelensLogRouter class.
type FirelensLogRouterDefinitionOptions ¶
type FirelensLogRouterDefinitionOptions struct { // The image used to start a container. // // This string is passed directly to the Docker daemon. // Images in the Docker Hub registry are available by default. // Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. // TODO: Update these to specify using classes of IContainerImage. Image ContainerImage `field:"required" json:"image" yaml:"image"` // The command that is passed to the container. // // If you provide a shell command as a single string, you have to quote command-line arguments. // Default: - CMD value built into container image. // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The name of the container. // Default: - id of node associated with ContainerDefinition. // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The minimum number of CPU units to reserve for the container. // Default: - No minimum CPU units reserved. // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // Specifies whether networking is disabled within the container. // // When this parameter is true, networking is disabled within the container. // Default: false. // DisableNetworking *bool `field:"optional" json:"disableNetworking" yaml:"disableNetworking"` // A list of DNS search domains that are presented to the container. // Default: - No search domains. // DnsSearchDomains *[]*string `field:"optional" json:"dnsSearchDomains" yaml:"dnsSearchDomains"` // A list of DNS servers that are presented to the container. // Default: - Default DNS servers. // DnsServers *[]*string `field:"optional" json:"dnsServers" yaml:"dnsServers"` // A key/value map of labels to add to the container. // Default: - No labels. // DockerLabels *map[string]*string `field:"optional" json:"dockerLabels" yaml:"dockerLabels"` // A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. // Default: - No security labels. // DockerSecurityOptions *[]*string `field:"optional" json:"dockerSecurityOptions" yaml:"dockerSecurityOptions"` // The ENTRYPOINT value to pass to the container. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Default: - Entry point configured in container. // EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // The environment variables to pass to the container. // Default: - No environment variables. // Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The environment files to pass to the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html // // Default: - No environment files. // EnvironmentFiles *[]EnvironmentFile `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // Specifies whether the container is marked essential. // // If the essential parameter of a container is marked as true, and that container fails // or stops for any reason, all other containers that are part of the task are stopped. // If the essential parameter of a container is marked as false, then its failure does not // affect the rest of the containers in a task. All tasks must have at least one essential container. // // If this parameter is omitted, a container is assumed to be essential. // Default: true. // Essential *bool `field:"optional" json:"essential" yaml:"essential"` // A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. // Default: - No extra hosts. // ExtraHosts *map[string]*string `field:"optional" json:"extraHosts" yaml:"extraHosts"` // The number of GPUs assigned to the container. // Default: - No GPUs assigned. // GpuCount *float64 `field:"optional" json:"gpuCount" yaml:"gpuCount"` // The health check command and associated configuration parameters for the container. // Default: - Health check configuration from container. // HealthCheck *HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The hostname to use for your container. // Default: - Automatic hostname. // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // The inference accelerators referenced by the container. // Default: - No inference accelerators assigned. // InferenceAcceleratorResources *[]*string `field:"optional" json:"inferenceAcceleratorResources" yaml:"inferenceAcceleratorResources"` // When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive // // Default: - false. // Interactive *bool `field:"optional" json:"interactive" yaml:"interactive"` // Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. // // For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). // Default: - No Linux parameters. // LinuxParameters LinuxParameters `field:"optional" json:"linuxParameters" yaml:"linuxParameters"` // The log configuration specification for the container. // Default: - Containers use the same logging driver that the Docker daemon uses. // Logging LogDriver `field:"optional" json:"logging" yaml:"logging"` // The amount (in MiB) of memory to present to the container. // // If your container attempts to exceed the allocated memory, the container // is terminated. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory limit. // MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under heavy contention, Docker attempts to keep the // container memory to this soft limit. However, your container can consume more // memory when it needs to, up to either the hard limit specified with the memory // parameter (if applicable), or all of the available memory on the container // instance, whichever comes first. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory reserved. // MemoryReservationMiB *float64 `field:"optional" json:"memoryReservationMiB" yaml:"memoryReservationMiB"` // The port mappings to add to the container definition. // Default: - No ports are mapped. // PortMappings *[]*PortMapping `field:"optional" json:"portMappings" yaml:"portMappings"` // Specifies whether the container is marked as privileged. // // When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). // Default: false. // Privileged *bool `field:"optional" json:"privileged" yaml:"privileged"` // When this parameter is true, a TTY is allocated. // // This parameter maps to Tty in the "Create a container section" of the // Docker Remote API and the --tty option to `docker run`. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_pseudoterminal // // Default: - false. // PseudoTerminal *bool `field:"optional" json:"pseudoTerminal" yaml:"pseudoTerminal"` // When this parameter is true, the container is given read-only access to its root file system. // Default: false. // ReadonlyRootFilesystem *bool `field:"optional" json:"readonlyRootFilesystem" yaml:"readonlyRootFilesystem"` // The secret environment variables to pass to the container. // Default: - No secret environment variables. // Secrets *map[string]Secret `field:"optional" json:"secrets" yaml:"secrets"` // Time duration (in seconds) to wait before giving up on resolving dependencies for a container. // Default: - none. // StartTimeout awscdk.Duration `field:"optional" json:"startTimeout" yaml:"startTimeout"` // Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. // Default: - none. // StopTimeout awscdk.Duration `field:"optional" json:"stopTimeout" yaml:"stopTimeout"` // A list of namespaced kernel parameters to set in the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols // // Default: - No system controls are set. // SystemControls *[]*SystemControl `field:"optional" json:"systemControls" yaml:"systemControls"` // An array of ulimits to set in the container. Ulimits *[]*Ulimit `field:"optional" json:"ulimits" yaml:"ulimits"` // The user to use inside the container. // // This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#ContainerDefinition-user // // Default: root. // User *string `field:"optional" json:"user" yaml:"user"` // The working directory in which to run commands inside the container. // Default: /. // WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` // Firelens configuration. FirelensConfig *FirelensConfig `field:"required" json:"firelensConfig" yaml:"firelensConfig"` }
The options for creating a firelens log router.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol var containerImage containerImage var environmentFile environmentFile var linuxParameters linuxParameters var logDriver logDriver var secret secret firelensLogRouterDefinitionOptions := &FirelensLogRouterDefinitionOptions{ FirelensConfig: &FirelensConfig{ Type: awscdk.Aws_ecs.FirelensLogRouterType_FLUENTBIT, // the properties below are optional Options: &FirelensOptions{ ConfigFileType: awscdk.*Aws_ecs.FirelensConfigFileType_S3, ConfigFileValue: jsii.String("configFileValue"), EnableECSLogMetadata: jsii.Boolean(false), }, }, Image: containerImage, // the properties below are optional Command: []*string{ jsii.String("command"), }, ContainerName: jsii.String("containerName"), Cpu: jsii.Number(123), DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentFiles: []*environmentFile{ environmentFile, }, Essential: jsii.Boolean(false), ExtraHosts: map[string]*string{ "extraHostsKey": jsii.String("extraHosts"), }, GpuCount: jsii.Number(123), HealthCheck: &HealthCheck{ Command: []*string{ jsii.String("command"), }, // the properties below are optional Interval: cdk.Duration_Minutes(jsii.Number(30)), Retries: jsii.Number(123), StartPeriod: cdk.Duration_*Minutes(jsii.Number(30)), Timeout: cdk.Duration_*Minutes(jsii.Number(30)), }, Hostname: jsii.String("hostname"), InferenceAcceleratorResources: []*string{ jsii.String("inferenceAcceleratorResources"), }, Interactive: jsii.Boolean(false), LinuxParameters: linuxParameters, Logging: logDriver, MemoryLimitMiB: jsii.Number(123), MemoryReservationMiB: jsii.Number(123), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.*Aws_ecs.Protocol_TCP, }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), Secrets: map[string]*secret{ "secretsKey": secret, }, StartTimeout: cdk.Duration_*Minutes(jsii.Number(30)), StopTimeout: cdk.Duration_*Minutes(jsii.Number(30)), SystemControls: []systemControl{ &systemControl{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []ulimit{ &ulimit{ HardLimit: jsii.Number(123), Name: awscdk.*Aws_ecs.UlimitName_CORE, SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), WorkingDirectory: jsii.String("workingDirectory"), }
type FirelensLogRouterProps ¶
type FirelensLogRouterProps struct { // The image used to start a container. // // This string is passed directly to the Docker daemon. // Images in the Docker Hub registry are available by default. // Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. // TODO: Update these to specify using classes of IContainerImage. Image ContainerImage `field:"required" json:"image" yaml:"image"` // The command that is passed to the container. // // If you provide a shell command as a single string, you have to quote command-line arguments. // Default: - CMD value built into container image. // Command *[]*string `field:"optional" json:"command" yaml:"command"` // The name of the container. // Default: - id of node associated with ContainerDefinition. // ContainerName *string `field:"optional" json:"containerName" yaml:"containerName"` // The minimum number of CPU units to reserve for the container. // Default: - No minimum CPU units reserved. // Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // Specifies whether networking is disabled within the container. // // When this parameter is true, networking is disabled within the container. // Default: false. // DisableNetworking *bool `field:"optional" json:"disableNetworking" yaml:"disableNetworking"` // A list of DNS search domains that are presented to the container. // Default: - No search domains. // DnsSearchDomains *[]*string `field:"optional" json:"dnsSearchDomains" yaml:"dnsSearchDomains"` // A list of DNS servers that are presented to the container. // Default: - Default DNS servers. // DnsServers *[]*string `field:"optional" json:"dnsServers" yaml:"dnsServers"` // A key/value map of labels to add to the container. // Default: - No labels. // DockerLabels *map[string]*string `field:"optional" json:"dockerLabels" yaml:"dockerLabels"` // A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. // Default: - No security labels. // DockerSecurityOptions *[]*string `field:"optional" json:"dockerSecurityOptions" yaml:"dockerSecurityOptions"` // The ENTRYPOINT value to pass to the container. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Default: - Entry point configured in container. // EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // The environment variables to pass to the container. // Default: - No environment variables. // Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The environment files to pass to the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html // // Default: - No environment files. // EnvironmentFiles *[]EnvironmentFile `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // Specifies whether the container is marked essential. // // If the essential parameter of a container is marked as true, and that container fails // or stops for any reason, all other containers that are part of the task are stopped. // If the essential parameter of a container is marked as false, then its failure does not // affect the rest of the containers in a task. All tasks must have at least one essential container. // // If this parameter is omitted, a container is assumed to be essential. // Default: true. // Essential *bool `field:"optional" json:"essential" yaml:"essential"` // A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. // Default: - No extra hosts. // ExtraHosts *map[string]*string `field:"optional" json:"extraHosts" yaml:"extraHosts"` // The number of GPUs assigned to the container. // Default: - No GPUs assigned. // GpuCount *float64 `field:"optional" json:"gpuCount" yaml:"gpuCount"` // The health check command and associated configuration parameters for the container. // Default: - Health check configuration from container. // HealthCheck *HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The hostname to use for your container. // Default: - Automatic hostname. // Hostname *string `field:"optional" json:"hostname" yaml:"hostname"` // The inference accelerators referenced by the container. // Default: - No inference accelerators assigned. // InferenceAcceleratorResources *[]*string `field:"optional" json:"inferenceAcceleratorResources" yaml:"inferenceAcceleratorResources"` // When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-interactive // // Default: - false. // Interactive *bool `field:"optional" json:"interactive" yaml:"interactive"` // Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. // // For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). // Default: - No Linux parameters. // LinuxParameters LinuxParameters `field:"optional" json:"linuxParameters" yaml:"linuxParameters"` // The log configuration specification for the container. // Default: - Containers use the same logging driver that the Docker daemon uses. // Logging LogDriver `field:"optional" json:"logging" yaml:"logging"` // The amount (in MiB) of memory to present to the container. // // If your container attempts to exceed the allocated memory, the container // is terminated. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory limit. // MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under heavy contention, Docker attempts to keep the // container memory to this soft limit. However, your container can consume more // memory when it needs to, up to either the hard limit specified with the memory // parameter (if applicable), or all of the available memory on the container // instance, whichever comes first. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. // Default: - No memory reserved. // MemoryReservationMiB *float64 `field:"optional" json:"memoryReservationMiB" yaml:"memoryReservationMiB"` // The port mappings to add to the container definition. // Default: - No ports are mapped. // PortMappings *[]*PortMapping `field:"optional" json:"portMappings" yaml:"portMappings"` // Specifies whether the container is marked as privileged. // // When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). // Default: false. // Privileged *bool `field:"optional" json:"privileged" yaml:"privileged"` // When this parameter is true, a TTY is allocated. // // This parameter maps to Tty in the "Create a container section" of the // Docker Remote API and the --tty option to `docker run`. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_pseudoterminal // // Default: - false. // PseudoTerminal *bool `field:"optional" json:"pseudoTerminal" yaml:"pseudoTerminal"` // When this parameter is true, the container is given read-only access to its root file system. // Default: false. // ReadonlyRootFilesystem *bool `field:"optional" json:"readonlyRootFilesystem" yaml:"readonlyRootFilesystem"` // The secret environment variables to pass to the container. // Default: - No secret environment variables. // Secrets *map[string]Secret `field:"optional" json:"secrets" yaml:"secrets"` // Time duration (in seconds) to wait before giving up on resolving dependencies for a container. // Default: - none. // StartTimeout awscdk.Duration `field:"optional" json:"startTimeout" yaml:"startTimeout"` // Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. // Default: - none. // StopTimeout awscdk.Duration `field:"optional" json:"stopTimeout" yaml:"stopTimeout"` // A list of namespaced kernel parameters to set in the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols // // Default: - No system controls are set. // SystemControls *[]*SystemControl `field:"optional" json:"systemControls" yaml:"systemControls"` // An array of ulimits to set in the container. Ulimits *[]*Ulimit `field:"optional" json:"ulimits" yaml:"ulimits"` // The user to use inside the container. // // This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#ContainerDefinition-user // // Default: root. // User *string `field:"optional" json:"user" yaml:"user"` // The working directory in which to run commands inside the container. // Default: /. // WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` // The name of the task definition that includes this container definition. // // [disable-awslint:ref-via-interface]. TaskDefinition TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // Firelens configuration. FirelensConfig *FirelensConfig `field:"required" json:"firelensConfig" yaml:"firelensConfig"` }
The properties in a firelens log router.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol var containerImage containerImage var environmentFile environmentFile var linuxParameters linuxParameters var logDriver logDriver var secret secret var taskDefinition taskDefinition firelensLogRouterProps := &FirelensLogRouterProps{ FirelensConfig: &FirelensConfig{ Type: awscdk.Aws_ecs.FirelensLogRouterType_FLUENTBIT, // the properties below are optional Options: &FirelensOptions{ ConfigFileType: awscdk.*Aws_ecs.FirelensConfigFileType_S3, ConfigFileValue: jsii.String("configFileValue"), EnableECSLogMetadata: jsii.Boolean(false), }, }, Image: containerImage, TaskDefinition: taskDefinition, // the properties below are optional Command: []*string{ jsii.String("command"), }, ContainerName: jsii.String("containerName"), Cpu: jsii.Number(123), DisableNetworking: jsii.Boolean(false), DnsSearchDomains: []*string{ jsii.String("dnsSearchDomains"), }, DnsServers: []*string{ jsii.String("dnsServers"), }, DockerLabels: map[string]*string{ "dockerLabelsKey": jsii.String("dockerLabels"), }, DockerSecurityOptions: []*string{ jsii.String("dockerSecurityOptions"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentFiles: []*environmentFile{ environmentFile, }, Essential: jsii.Boolean(false), ExtraHosts: map[string]*string{ "extraHostsKey": jsii.String("extraHosts"), }, GpuCount: jsii.Number(123), HealthCheck: &HealthCheck{ Command: []*string{ jsii.String("command"), }, // the properties below are optional Interval: cdk.Duration_Minutes(jsii.Number(30)), Retries: jsii.Number(123), StartPeriod: cdk.Duration_*Minutes(jsii.Number(30)), Timeout: cdk.Duration_*Minutes(jsii.Number(30)), }, Hostname: jsii.String("hostname"), InferenceAcceleratorResources: []*string{ jsii.String("inferenceAcceleratorResources"), }, Interactive: jsii.Boolean(false), LinuxParameters: linuxParameters, Logging: logDriver, MemoryLimitMiB: jsii.Number(123), MemoryReservationMiB: jsii.Number(123), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.*Aws_ecs.Protocol_TCP, }, }, Privileged: jsii.Boolean(false), PseudoTerminal: jsii.Boolean(false), ReadonlyRootFilesystem: jsii.Boolean(false), Secrets: map[string]*secret{ "secretsKey": secret, }, StartTimeout: cdk.Duration_*Minutes(jsii.Number(30)), StopTimeout: cdk.Duration_*Minutes(jsii.Number(30)), SystemControls: []systemControl{ &systemControl{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }, }, Ulimits: []ulimit{ &ulimit{ HardLimit: jsii.Number(123), Name: awscdk.*Aws_ecs.UlimitName_CORE, SoftLimit: jsii.Number(123), }, }, User: jsii.String("user"), WorkingDirectory: jsii.String("workingDirectory"), }
type FirelensLogRouterType ¶
type FirelensLogRouterType string
Firelens log router type, fluentbit or fluentd.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html
const ( // fluentbit. FirelensLogRouterType_FLUENTBIT FirelensLogRouterType = "FLUENTBIT" // fluentd. FirelensLogRouterType_FLUENTD FirelensLogRouterType = "FLUENTD" )
type FirelensOptions ¶
type FirelensOptions struct { // Custom configuration file, s3 or file. // // Both configFileType and configFileValue must be used together // to define a custom configuration source. // Default: - determined by checking configFileValue with S3 ARN. // ConfigFileType FirelensConfigFileType `field:"optional" json:"configFileType" yaml:"configFileType"` // Custom configuration file, S3 ARN or a file path Both configFileType and configFileValue must be used together to define a custom configuration source. // Default: - no config file value. // ConfigFileValue *string `field:"optional" json:"configFileValue" yaml:"configFileValue"` // By default, Amazon ECS adds additional fields in your log entries that help identify the source of the logs. // // You can disable this action by setting enable-ecs-log-metadata to false. // Default: - true. // EnableECSLogMetadata *bool `field:"optional" json:"enableECSLogMetadata" yaml:"enableECSLogMetadata"` }
The options for firelens log router https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html#firelens-taskdef-customconfig.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" firelensOptions := &FirelensOptions{ ConfigFileType: awscdk.Aws_ecs.FirelensConfigFileType_S3, ConfigFileValue: jsii.String("configFileValue"), EnableECSLogMetadata: jsii.Boolean(false), }
type FluentdLogDriver ¶
type FluentdLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to journald Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import cdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" fluentdLogDriver := awscdk.Aws_ecs.NewFluentdLogDriver(&FluentdLogDriverProps{ Address: jsii.String("address"), AsyncConnect: jsii.Boolean(false), BufferLimit: jsii.Number(123), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, MaxRetries: jsii.Number(123), RetryWait: cdk.Duration_Minutes(jsii.Number(30)), SubSecondPrecision: jsii.Boolean(false), Tag: jsii.String("tag"), })
func NewFluentdLogDriver ¶
func NewFluentdLogDriver(props *FluentdLogDriverProps) FluentdLogDriver
Constructs a new instance of the FluentdLogDriver class.
type FluentdLogDriverProps ¶
type FluentdLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // By default, the logging driver connects to localhost:24224. // // Supply the // address option to connect to a different address. tcp(default) and unix // sockets are supported. // Default: - address not set. // Address *string `field:"optional" json:"address" yaml:"address"` // Docker connects to Fluentd in the background. // // Messages are buffered until // the connection is established. // Default: - false. // AsyncConnect *bool `field:"optional" json:"asyncConnect" yaml:"asyncConnect"` // The amount of data to buffer before flushing to disk. // Default: - The amount of RAM available to the container. // BufferLimit *float64 `field:"optional" json:"bufferLimit" yaml:"bufferLimit"` // The maximum number of retries. // Default: - 4294967295 (2**32 - 1). // MaxRetries *float64 `field:"optional" json:"maxRetries" yaml:"maxRetries"` // How long to wait between retries. // Default: - 1 second. // RetryWait awscdk.Duration `field:"optional" json:"retryWait" yaml:"retryWait"` // Generates event logs in nanosecond resolution. // Default: - false. // SubSecondPrecision *bool `field:"optional" json:"subSecondPrecision" yaml:"subSecondPrecision"` }
Specifies the fluentd log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/fluentd/)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import cdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" fluentdLogDriverProps := &FluentdLogDriverProps{ Address: jsii.String("address"), AsyncConnect: jsii.Boolean(false), BufferLimit: jsii.Number(123), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, MaxRetries: jsii.Number(123), RetryWait: cdk.Duration_Minutes(jsii.Number(30)), SubSecondPrecision: jsii.Boolean(false), Tag: jsii.String("tag"), }
type GelfCompressionType ¶
type GelfCompressionType string
The type of compression the GELF driver uses to compress each log message.
const ( GelfCompressionType_GZIP GelfCompressionType = "GZIP" GelfCompressionType_ZLIB GelfCompressionType = "ZLIB" GelfCompressionType_NONE GelfCompressionType = "NONE" )
type GelfLogDriver ¶
type GelfLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to journald Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import cdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" gelfLogDriver := awscdk.Aws_ecs.NewGelfLogDriver(&GelfLogDriverProps{ Address: jsii.String("address"), // the properties below are optional CompressionLevel: jsii.Number(123), CompressionType: awscdk.*Aws_ecs.GelfCompressionType_GZIP, Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), TcpMaxReconnect: jsii.Number(123), TcpReconnectDelay: cdk.Duration_Minutes(jsii.Number(30)), })
func NewGelfLogDriver ¶
func NewGelfLogDriver(props *GelfLogDriverProps) GelfLogDriver
Constructs a new instance of the GelfLogDriver class.
type GelfLogDriverProps ¶
type GelfLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // The address of the GELF server. // // tcp and udp are the only supported URI // specifier and you must specify the port. Address *string `field:"required" json:"address" yaml:"address"` // UDP Only The level of compression when gzip or zlib is the gelf-compression-type. // // An integer in the range of -1 to 9 (BestCompression). Higher levels provide more // compression at lower speed. Either -1 or 0 disables compression. // Default: - 1. // CompressionLevel *float64 `field:"optional" json:"compressionLevel" yaml:"compressionLevel"` // UDP Only The type of compression the GELF driver uses to compress each log message. // // Allowed values are gzip, zlib and none. // Default: - gzip. // CompressionType GelfCompressionType `field:"optional" json:"compressionType" yaml:"compressionType"` // TCP Only The maximum number of reconnection attempts when the connection drop. // // A positive integer. // Default: - 3. // TcpMaxReconnect *float64 `field:"optional" json:"tcpMaxReconnect" yaml:"tcpMaxReconnect"` // TCP Only The number of seconds to wait between reconnection attempts. // // A positive integer. // Default: - 1. // TcpReconnectDelay awscdk.Duration `field:"optional" json:"tcpReconnectDelay" yaml:"tcpReconnectDelay"` }
Specifies the journald log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/gelf/)
Example:
// Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Gelf(&GelfLogDriverProps{ Address: jsii.String("my-gelf-address"), }), })
type GenericLogDriver ¶
type GenericLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends logs to the specified driver.
Example:
// Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.NewGenericLogDriver(&GenericLogDriverProps{ LogDriver: jsii.String("fluentd"), Options: map[string]*string{ "tag": jsii.String("example-tag"), }, }), })
func NewGenericLogDriver ¶
func NewGenericLogDriver(props *GenericLogDriverProps) GenericLogDriver
Constructs a new instance of the GenericLogDriver class.
type GenericLogDriverProps ¶
type GenericLogDriverProps struct { // The log driver to use for the container. // // The valid values listed for this parameter are log drivers // that the Amazon ECS container agent can communicate with by default. // // For tasks using the Fargate launch type, the supported log drivers are awslogs and splunk. // For tasks using the EC2 launch type, the supported log drivers are awslogs, syslog, gelf, fluentd, splunk, journald, and json-file. // // For more information about using the awslogs log driver, see // [Using the awslogs Log Driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) // in the Amazon Elastic Container Service Developer Guide. LogDriver *string `field:"required" json:"logDriver" yaml:"logDriver"` // The configuration options to send to the log driver. // Default: - the log driver options. // Options *map[string]*string `field:"optional" json:"options" yaml:"options"` // The secrets to pass to the log configuration. // Default: - no secret options provided. // SecretOptions *map[string]Secret `field:"optional" json:"secretOptions" yaml:"secretOptions"` }
The configuration to use when creating a log driver.
Example:
// Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.NewGenericLogDriver(&GenericLogDriverProps{ LogDriver: jsii.String("fluentd"), Options: map[string]*string{ "tag": jsii.String("example-tag"), }, }), })
type HealthCheck ¶
type HealthCheck struct { // A string array representing the command that the container runs to determine if it is healthy. // // The string array must start with CMD to execute the command arguments directly, or // CMD-SHELL to run the command with the container's default shell. // // For example: [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]. Command *[]*string `field:"required" json:"command" yaml:"command"` // The time period in seconds between each health check execution. // // You may specify between 5 and 300 seconds. // Default: Duration.seconds(30) // Interval awscdk.Duration `field:"optional" json:"interval" yaml:"interval"` // The number of times to retry a failed health check before the container is considered unhealthy. // // You may specify between 1 and 10 retries. // Default: 3. // Retries *float64 `field:"optional" json:"retries" yaml:"retries"` // The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. // // You may specify between 0 and 300 seconds. // Default: No start period. // StartPeriod awscdk.Duration `field:"optional" json:"startPeriod" yaml:"startPeriod"` // The time period in seconds to wait for a health check to succeed before it is considered a failure. // // You may specify between 2 and 60 seconds. // Default: Duration.seconds(5) // Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` }
The health check command and associated configuration parameters for the container.
Example:
var vpc vpc var securityGroup securityGroup queueProcessingFargateService := ecsPatterns.NewQueueProcessingFargateService(this, jsii.String("Service"), &QueueProcessingFargateServiceProps{ Vpc: Vpc, MemoryLimitMiB: jsii.Number(512), Image: ecs.ContainerImage_FromRegistry(jsii.String("test")), HealthCheck: &HealthCheck{ Command: []*string{ jsii.String("CMD-SHELL"), jsii.String("curl -f http://localhost/ || exit 1"), }, // the properties below are optional Interval: awscdk.Duration_Minutes(jsii.Number(30)), Retries: jsii.Number(123), StartPeriod: awscdk.Duration_*Minutes(jsii.Number(30)), Timeout: awscdk.Duration_*Minutes(jsii.Number(30)), }, })
type Host ¶
type Host struct { // Specifies the path on the host container instance that is presented to the container. // // If the sourcePath value does not exist on the host container instance, the Docker daemon creates it. // If the location does exist, the contents of the source path folder are exported. // // This property is not supported for tasks that use the Fargate launch type. SourcePath *string `field:"optional" json:"sourcePath" yaml:"sourcePath"` }
The details on a container instance bind mount host volume.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" host := &Host{ SourcePath: jsii.String("sourcePath"), }
type IBaseService ¶
The interface for BaseService.
func BaseService_FromServiceArnWithCluster ¶ added in v2.10.0
func BaseService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
Import an existing ECS/Fargate Service using the service cluster format.
The format is the "new" format "arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name". See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
func Ec2Service_FromEc2ServiceAttributes ¶
func Ec2Service_FromEc2ServiceAttributes(scope constructs.Construct, id *string, attrs *Ec2ServiceAttributes) IBaseService
Imports from the specified service attributes.
func Ec2Service_FromServiceArnWithCluster ¶ added in v2.10.0
func Ec2Service_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
Import an existing ECS/Fargate Service using the service cluster format.
The format is the "new" format "arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name". See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
func ExternalService_FromExternalServiceAttributes ¶
func ExternalService_FromExternalServiceAttributes(scope constructs.Construct, id *string, attrs *ExternalServiceAttributes) IBaseService
Imports from the specified service attributes.
func ExternalService_FromServiceArnWithCluster ¶ added in v2.10.0
func ExternalService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
Import an existing ECS/Fargate Service using the service cluster format.
The format is the "new" format "arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name". See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
func FargateService_FromFargateServiceAttributes ¶
func FargateService_FromFargateServiceAttributes(scope constructs.Construct, id *string, attrs *FargateServiceAttributes) IBaseService
Imports from the specified service attributes.
func FargateService_FromServiceArnWithCluster ¶ added in v2.10.0
func FargateService_FromServiceArnWithCluster(scope constructs.Construct, id *string, serviceArn *string) IBaseService
Import an existing ECS/Fargate Service using the service cluster format.
The format is the "new" format "arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name". See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
type ICluster ¶
type ICluster interface { awscdk.IResource // The autoscaling group added to the cluster if capacity is associated to the cluster. AutoscalingGroup() awsautoscaling.IAutoScalingGroup // The Amazon Resource Name (ARN) that identifies the cluster. ClusterArn() *string // The name of the cluster. ClusterName() *string // Manage the allowed network connections for the cluster with Security Groups. Connections() awsec2.Connections // The AWS Cloud Map namespace to associate with the cluster. DefaultCloudMapNamespace() awsservicediscovery.INamespace // The execute command configuration for the cluster. ExecuteCommandConfiguration() *ExecuteCommandConfiguration // Specifies whether the cluster has EC2 instance capacity. HasEc2Capacity() *bool // The VPC associated with the cluster. Vpc() awsec2.IVpc }
A regional grouping of one or more container instances on which you can run tasks and services.
func Cluster_FromClusterArn ¶ added in v2.10.0
Import an existing cluster to the stack from the cluster ARN.
This does not provide access to the vpc, hasEc2Capacity, or connections - use the `fromClusterAttributes` method to access those properties.
func Cluster_FromClusterAttributes ¶
func Cluster_FromClusterAttributes(scope constructs.Construct, id *string, attrs *ClusterAttributes) ICluster
Import an existing cluster to the stack from its attributes.
type IEc2Service ¶
type IEc2Service interface { IService }
The interface for a service using the EC2 launch type on an ECS cluster.
func Ec2Service_FromEc2ServiceArn ¶
func Ec2Service_FromEc2ServiceArn(scope constructs.Construct, id *string, ec2ServiceArn *string) IEc2Service
Imports from the specified service ARN.
type IEc2TaskDefinition ¶
type IEc2TaskDefinition interface { ITaskDefinition }
The interface of a task definition run on an EC2 cluster.
func Ec2TaskDefinition_FromEc2TaskDefinitionArn ¶
func Ec2TaskDefinition_FromEc2TaskDefinitionArn(scope constructs.Construct, id *string, ec2TaskDefinitionArn *string) IEc2TaskDefinition
Imports a task definition from the specified task definition ARN.
func Ec2TaskDefinition_FromEc2TaskDefinitionAttributes ¶
func Ec2TaskDefinition_FromEc2TaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *Ec2TaskDefinitionAttributes) IEc2TaskDefinition
Imports an existing Ec2 task definition from its attributes.
type IEcsLoadBalancerTarget ¶
type IEcsLoadBalancerTarget interface { awselasticloadbalancingv2.IApplicationLoadBalancerTarget awselasticloadbalancing.ILoadBalancerTarget awselasticloadbalancingv2.INetworkLoadBalancerTarget }
Interface for ECS load balancer target.
type IExternalService ¶
type IExternalService interface { IService }
The interface for a service using the External launch type on an ECS cluster.
func ExternalService_FromExternalServiceArn ¶
func ExternalService_FromExternalServiceArn(scope constructs.Construct, id *string, externalServiceArn *string) IExternalService
Imports from the specified service ARN.
type IExternalTaskDefinition ¶
type IExternalTaskDefinition interface { ITaskDefinition }
The interface of a task definition run on an External cluster.
func ExternalTaskDefinition_FromEc2TaskDefinitionArn ¶
func ExternalTaskDefinition_FromEc2TaskDefinitionArn(scope constructs.Construct, id *string, externalTaskDefinitionArn *string) IExternalTaskDefinition
Imports a task definition from the specified task definition ARN.
func ExternalTaskDefinition_FromExternalTaskDefinitionAttributes ¶
func ExternalTaskDefinition_FromExternalTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *ExternalTaskDefinitionAttributes) IExternalTaskDefinition
Imports an existing External task definition from its attributes.
type IFargateService ¶
type IFargateService interface { IService }
The interface for a service using the Fargate launch type on an ECS cluster.
func FargateService_FromFargateServiceArn ¶
func FargateService_FromFargateServiceArn(scope constructs.Construct, id *string, fargateServiceArn *string) IFargateService
Imports from the specified service ARN.
type IFargateTaskDefinition ¶
type IFargateTaskDefinition interface { ITaskDefinition }
The interface of a task definition run on a Fargate cluster.
func FargateTaskDefinition_FromFargateTaskDefinitionArn ¶
func FargateTaskDefinition_FromFargateTaskDefinitionArn(scope constructs.Construct, id *string, fargateTaskDefinitionArn *string) IFargateTaskDefinition
Imports a task definition from the specified task definition ARN.
func FargateTaskDefinition_FromFargateTaskDefinitionAttributes ¶
func FargateTaskDefinition_FromFargateTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *FargateTaskDefinitionAttributes) IFargateTaskDefinition
Import an existing Fargate task definition from its attributes.
type IService ¶
type IService interface { awscdk.IResource // The Amazon Resource Name (ARN) of the service. ServiceArn() *string // The name of the service. ServiceName() *string }
The interface for a service.
type ITaskDefinition ¶
type ITaskDefinition interface { awscdk.IResource // What launch types this task definition should be compatible with. Compatibility() Compatibility // Execution role for this task definition. ExecutionRole() awsiam.IRole // Return true if the task definition can be run on an EC2 cluster. IsEc2Compatible() *bool // Return true if the task definition can be run on a ECS Anywhere cluster. IsExternalCompatible() *bool // Return true if the task definition can be run on a Fargate cluster. IsFargateCompatible() *bool // The networking mode to use for the containers in the task. NetworkMode() NetworkMode // ARN of this task definition. TaskDefinitionArn() *string // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. TaskRole() awsiam.IRole }
The interface for all task definitions.
func Ec2TaskDefinition_FromTaskDefinitionArn ¶
func Ec2TaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
Imports a task definition from the specified task definition ARN.
The task will have a compatibility of EC2+Fargate.
func Ec2TaskDefinition_FromTaskDefinitionAttributes ¶
func Ec2TaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
Create a task definition from a task definition reference.
func ExternalTaskDefinition_FromTaskDefinitionArn ¶
func ExternalTaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
Imports a task definition from the specified task definition ARN.
The task will have a compatibility of EC2+Fargate.
func ExternalTaskDefinition_FromTaskDefinitionAttributes ¶
func ExternalTaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
Create a task definition from a task definition reference.
func FargateTaskDefinition_FromTaskDefinitionArn ¶
func FargateTaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
Imports a task definition from the specified task definition ARN.
The task will have a compatibility of EC2+Fargate.
func FargateTaskDefinition_FromTaskDefinitionAttributes ¶
func FargateTaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
Create a task definition from a task definition reference.
func TaskDefinition_FromTaskDefinitionArn ¶
func TaskDefinition_FromTaskDefinitionArn(scope constructs.Construct, id *string, taskDefinitionArn *string) ITaskDefinition
Imports a task definition from the specified task definition ARN.
The task will have a compatibility of EC2+Fargate.
func TaskDefinition_FromTaskDefinitionAttributes ¶
func TaskDefinition_FromTaskDefinitionAttributes(scope constructs.Construct, id *string, attrs *TaskDefinitionAttributes) ITaskDefinition
Create a task definition from a task definition reference.
type ITaskDefinitionExtension ¶
type ITaskDefinitionExtension interface { // Apply the extension to the given TaskDefinition. Extend(taskDefinition TaskDefinition) }
An extension for Task Definitions.
Classes that want to make changes to a TaskDefinition (such as adding helper containers) can implement this interface, and can then be "added" to a TaskDefinition like so:
taskDefinition.addExtension(new MyExtension("some_parameter"));
type InferenceAccelerator ¶
type InferenceAccelerator struct { // The Elastic Inference accelerator device name. // Default: - empty. // DeviceName *string `field:"optional" json:"deviceName" yaml:"deviceName"` // The Elastic Inference accelerator type to use. // // The allowed values are: eia2.medium, eia2.large and eia2.xlarge. // Default: - empty. // DeviceType *string `field:"optional" json:"deviceType" yaml:"deviceType"` }
Elastic Inference Accelerator.
For more information, see [Elastic Inference Basics](https://docs.aws.amazon.com/elastic-inference/latest/developerguide/basics.html)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" inferenceAccelerator := &InferenceAccelerator{ DeviceName: jsii.String("deviceName"), DeviceType: jsii.String("deviceType"), }
type IpcMode ¶
type IpcMode string
The IPC resource namespace to use for the containers in the task.
const ( // If none is specified, then IPC resources within the containers of a task are private and not shared with other containers in a task or on the container instance. IpcMode_NONE IpcMode = "NONE" // If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. IpcMode_HOST IpcMode = "HOST" // If task is specified, all containers within the specified task share the same IPC resources. IpcMode_TASK IpcMode = "TASK" )
type JournaldLogDriver ¶
type JournaldLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to journald Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" journaldLogDriver := awscdk.Aws_ecs.NewJournaldLogDriver(&JournaldLogDriverProps{ Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), })
func NewJournaldLogDriver ¶
func NewJournaldLogDriver(props *JournaldLogDriverProps) JournaldLogDriver
Constructs a new instance of the JournaldLogDriver class.
type JournaldLogDriverProps ¶
type JournaldLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` }
Specifies the journald log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/journald/)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" journaldLogDriverProps := &JournaldLogDriverProps{ Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), }
type JsonFileLogDriver ¶
type JsonFileLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to json-file Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" jsonFileLogDriver := awscdk.Aws_ecs.NewJsonFileLogDriver(&JsonFileLogDriverProps{ Compress: jsii.Boolean(false), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, MaxFile: jsii.Number(123), MaxSize: jsii.String("maxSize"), Tag: jsii.String("tag"), })
func NewJsonFileLogDriver ¶
func NewJsonFileLogDriver(props *JsonFileLogDriverProps) JsonFileLogDriver
Constructs a new instance of the JsonFileLogDriver class.
type JsonFileLogDriverProps ¶
type JsonFileLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // Toggles compression for rotated logs. // Default: - false. // Compress *bool `field:"optional" json:"compress" yaml:"compress"` // The maximum number of log files that can be present. // // If rolling the logs creates // excess files, the oldest file is removed. Only effective when max-size is also set. // A positive integer. // Default: - 1. // MaxFile *float64 `field:"optional" json:"maxFile" yaml:"maxFile"` // The maximum size of the log before it is rolled. // // A positive integer plus a modifier // representing the unit of measure (k, m, or g). // Default: - -1 (unlimited). // MaxSize *string `field:"optional" json:"maxSize" yaml:"maxSize"` }
Specifies the json-file log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/json-file/)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" jsonFileLogDriverProps := &JsonFileLogDriverProps{ Compress: jsii.Boolean(false), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Labels: []*string{ jsii.String("labels"), }, MaxFile: jsii.Number(123), MaxSize: jsii.String("maxSize"), Tag: jsii.String("tag"), }
type LaunchType ¶
type LaunchType string
The launch type of an ECS service.
const ( // The service will be launched using the EC2 launch type. LaunchType_EC2 LaunchType = "EC2" // The service will be launched using the FARGATE launch type. LaunchType_FARGATE LaunchType = "FARGATE" // The service will be launched using the EXTERNAL launch type. LaunchType_EXTERNAL LaunchType = "EXTERNAL" )
type LinuxParameters ¶
type LinuxParameters interface { constructs.Construct // The tree node. Node() constructs.Node // Adds one or more Linux capabilities to the Docker configuration of a container. // // Tasks launched on Fargate only support adding the 'SYS_PTRACE' kernel capability. AddCapabilities(cap ...Capability) // Adds one or more host devices to a container. AddDevices(device ...*Device) // Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container. // // Only works with EC2 launch type. AddTmpfs(tmpfs ...*Tmpfs) // Removes one or more Linux capabilities to the Docker configuration of a container. DropCapabilities(cap ...Capability) // Renders the Linux parameters to a CloudFormation object. RenderLinuxParameters() *CfnTaskDefinition_LinuxParametersProperty // Returns a string representation of this construct. ToString() *string }
Linux-specific options that are applied to the container.
Example:
var taskDefinition taskDefinition taskDefinition.AddContainer(jsii.String("container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), LinuxParameters: ecs.NewLinuxParameters(this, jsii.String("LinuxParameters"), &LinuxParametersProps{ InitProcessEnabled: jsii.Boolean(true), SharedMemorySize: jsii.Number(1024), MaxSwap: awscdk.Size_Mebibytes(jsii.Number(5000)), Swappiness: jsii.Number(90), }), })
func NewLinuxParameters ¶
func NewLinuxParameters(scope constructs.Construct, id *string, props *LinuxParametersProps) LinuxParameters
Constructs a new instance of the LinuxParameters class.
type LinuxParametersProps ¶
type LinuxParametersProps struct { // Specifies whether to run an init process inside the container that forwards signals and reaps processes. // Default: false. // InitProcessEnabled *bool `field:"optional" json:"initProcessEnabled" yaml:"initProcessEnabled"` // The total amount of swap memory a container can use. // // This parameter // will be translated to the --memory-swap option to docker run. // // This parameter is only supported when you are using the EC2 launch type. // Accepted values are positive integers. // Default: No swap. // MaxSwap awscdk.Size `field:"optional" json:"maxSwap" yaml:"maxSwap"` // Default: No shared memory. // SharedMemorySize *float64 `field:"optional" json:"sharedMemorySize" yaml:"sharedMemorySize"` // This allows you to tune a container's memory swappiness behavior. // // This parameter // maps to the --memory-swappiness option to docker run. The swappiness relates // to the kernel's tendency to swap memory. A value of 0 will cause swapping to // not happen unless absolutely necessary. A value of 100 will cause pages to // be swapped very aggressively. // // This parameter is only supported when you are using the EC2 launch type. // Accepted values are whole numbers between 0 and 100. If a value is not // specified for maxSwap then this parameter is ignored. // Default: 60. // Swappiness *float64 `field:"optional" json:"swappiness" yaml:"swappiness"` }
The properties for defining Linux-specific options that are applied to the container.
Example:
var taskDefinition taskDefinition taskDefinition.AddContainer(jsii.String("container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), LinuxParameters: ecs.NewLinuxParameters(this, jsii.String("LinuxParameters"), &LinuxParametersProps{ InitProcessEnabled: jsii.Boolean(true), SharedMemorySize: jsii.Number(1024), MaxSwap: awscdk.Size_Mebibytes(jsii.Number(5000)), Swappiness: jsii.Number(90), }), })
type ListenerConfig ¶
type ListenerConfig interface { // Create and attach a target group to listener. AddTargets(id *string, target *LoadBalancerTargetOptions, service BaseService) }
Base class for configuring listener when registering targets.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elbv2.NewApplicationLoadBalancer(this, jsii.String("LB"), &ApplicationLoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), }) listener := lb.AddListener(jsii.String("Listener"), &BaseApplicationListenerProps{ Port: jsii.Number(80), }) service.RegisterLoadBalancerTargets(&EcsTarget{ ContainerName: jsii.String("web"), ContainerPort: jsii.Number(80), NewTargetGroupId: jsii.String("ECS"), Listener: ecs.ListenerConfig_ApplicationListener(listener, &AddApplicationTargetsProps{ Protocol: elbv2.ApplicationProtocol_HTTPS, }), })
func ListenerConfig_ApplicationListener ¶
func ListenerConfig_ApplicationListener(listener awselasticloadbalancingv2.ApplicationListener, props *awselasticloadbalancingv2.AddApplicationTargetsProps) ListenerConfig
Create a config for adding target group to ALB listener.
func ListenerConfig_NetworkListener ¶
func ListenerConfig_NetworkListener(listener awselasticloadbalancingv2.NetworkListener, props *awselasticloadbalancingv2.AddNetworkTargetsProps) ListenerConfig
Create a config for adding target group to NLB listener.
type LoadBalancerTargetOptions ¶
type LoadBalancerTargetOptions struct { // The name of the container. ContainerName *string `field:"required" json:"containerName" yaml:"containerName"` // The port number of the container. // // Only applicable when using application/network load balancers. // Default: - Container port of the first added port mapping. // ContainerPort *float64 `field:"optional" json:"containerPort" yaml:"containerPort"` // The protocol used for the port mapping. // // Only applicable when using application load balancers. // Default: Protocol.TCP // Protocol Protocol `field:"optional" json:"protocol" yaml:"protocol"` }
Properties for defining an ECS target.
The port mapping for it must already have been created through addPortMapping().
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, }) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), }) lb.AddTarget(service.LoadBalancerTarget(&LoadBalancerTargetOptions{ ContainerName: jsii.String("MyContainer"), ContainerPort: jsii.Number(80), }))
type LogDriver ¶
type LogDriver interface { // Called when the log driver is configured on a container. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *LogDriverConfig }
The base class for log drivers.
Example:
// Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("EventDemo"), Mode: ecs.AwsLogDriverMode_NON_BLOCKING, MaxBufferSize: awscdk.Size_Mebibytes(jsii.Number(25)), }), })
func AwsLogDriver_AwsLogs ¶
func AwsLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func FireLensLogDriver_AwsLogs ¶
func FireLensLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func FluentdLogDriver_AwsLogs ¶
func FluentdLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func GelfLogDriver_AwsLogs ¶
func GelfLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func GenericLogDriver_AwsLogs ¶
func GenericLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func JournaldLogDriver_AwsLogs ¶
func JournaldLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func JsonFileLogDriver_AwsLogs ¶
func JsonFileLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func LogDriver_AwsLogs ¶
func LogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func LogDrivers_AwsLogs ¶
func LogDrivers_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func LogDrivers_Firelens ¶
func LogDrivers_Firelens(props *FireLensLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to firelens log router.
For detail configurations, please refer to Amazon ECS FireLens Examples: https://github.com/aws-samples/amazon-ecs-firelens-examples
func LogDrivers_Fluentd ¶
func LogDrivers_Fluentd(props *FluentdLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to fluentd Logs.
func LogDrivers_Gelf ¶
func LogDrivers_Gelf(props *GelfLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to gelf Logs.
func LogDrivers_Journald ¶
func LogDrivers_Journald(props *JournaldLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to journald Logs.
func LogDrivers_JsonFile ¶
func LogDrivers_JsonFile(props *JsonFileLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to json-file Logs.
func LogDrivers_Splunk ¶
func LogDrivers_Splunk(props *SplunkLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to splunk Logs.
func LogDrivers_Syslog ¶
func LogDrivers_Syslog(props *SyslogLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to syslog Logs.
func SplunkLogDriver_AwsLogs ¶
func SplunkLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
func SyslogLogDriver_AwsLogs ¶
func SyslogLogDriver_AwsLogs(props *AwsLogDriverProps) LogDriver
Creates a log driver configuration that sends log information to CloudWatch Logs.
type LogDriverConfig ¶
type LogDriverConfig struct { // The log driver to use for the container. // // The valid values listed for this parameter are log drivers // that the Amazon ECS container agent can communicate with by default. // // For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens. // For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, // logentries,syslog, splunk, and awsfirelens. // // For more information about using the awslogs log driver, see // [Using the awslogs Log Driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) // in the Amazon Elastic Container Service Developer Guide. // // For more information about using the awsfirelens log driver, see // [Custom Log Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) // in the Amazon Elastic Container Service Developer Guide. LogDriver *string `field:"required" json:"logDriver" yaml:"logDriver"` // The configuration options to send to the log driver. Options *map[string]*string `field:"optional" json:"options" yaml:"options"` // The secrets to pass to the log configuration. // Default: - No secret options provided. // SecretOptions *[]*CfnTaskDefinition_SecretProperty `field:"optional" json:"secretOptions" yaml:"secretOptions"` }
The configuration to use when creating a log driver.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" logDriverConfig := &LogDriverConfig{ LogDriver: jsii.String("logDriver"), // the properties below are optional Options: map[string]*string{ "optionsKey": jsii.String("options"), }, SecretOptions: []secretProperty{ &secretProperty{ Name: jsii.String("name"), ValueFrom: jsii.String("valueFrom"), }, }, }
type LogDrivers ¶
type LogDrivers interface { }
The base class for log drivers.
Example:
var secret secret // Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Splunk(&SplunkLogDriverProps{ SecretToken: secret, Url: jsii.String("my-splunk-url"), }), })
func NewLogDrivers ¶
func NewLogDrivers() LogDrivers
type MachineImageType ¶
type MachineImageType string
The machine image type.
Example:
var vpc vpc launchTemplate := ec2.NewLaunchTemplate(this, jsii.String("ASG-LaunchTemplate"), &LaunchTemplateProps{ InstanceType: ec2.NewInstanceType(jsii.String("t3.medium")), MachineImage: ecs.EcsOptimizedImage_AmazonLinux2(), UserData: ec2.UserData_ForLinux(), }) autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{ Vpc: Vpc, MixedInstancesPolicy: &MixedInstancesPolicy{ InstancesDistribution: &InstancesDistribution{ OnDemandPercentageAboveBaseCapacity: jsii.Number(50), }, LaunchTemplate: launchTemplate, }, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: Vpc, }) capacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String("AsgCapacityProvider"), &AsgCapacityProviderProps{ AutoScalingGroup: AutoScalingGroup, MachineImageType: ecs.MachineImageType_AMAZON_LINUX_2, }) cluster.AddAsgCapacityProvider(capacityProvider)
const ( // Amazon ECS-optimized Amazon Linux 2 AMI. MachineImageType_AMAZON_LINUX_2 MachineImageType = "AMAZON_LINUX_2" // Bottlerocket AMI. MachineImageType_BOTTLEROCKET MachineImageType = "BOTTLEROCKET" )
type MemoryUtilizationScalingProps ¶
type MemoryUtilizationScalingProps struct { // Indicates whether scale in by the target tracking policy is disabled. // // If the value is true, scale in is disabled and the target tracking policy // won't remove capacity from the scalable resource. Otherwise, scale in is // enabled and the target tracking policy can remove capacity from the // scalable resource. // Default: false. // DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"` // A name for the scaling policy. // Default: - Automatically generated name. // PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` // Period after a scale in activity completes before another scale in activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // Period after a scale out activity completes before another scale out activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // The target value for memory utilization across all tasks in the service. TargetUtilizationPercent *float64 `field:"required" json:"targetUtilizationPercent" yaml:"targetUtilizationPercent"` }
The properties for enabling scaling based on memory utilization.
Example:
var cluster cluster loadBalancedFargateService := ecsPatterns.NewApplicationLoadBalancedFargateService(this, jsii.String("Service"), &ApplicationLoadBalancedFargateServiceProps{ Cluster: Cluster, MemoryLimitMiB: jsii.Number(1024), DesiredCount: jsii.Number(1), Cpu: jsii.Number(512), TaskImageOptions: &ApplicationLoadBalancedTaskImageOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), }, }) scalableTarget := loadBalancedFargateService.Service.AutoScaleTaskCount(&EnableScalingProps{ MinCapacity: jsii.Number(1), MaxCapacity: jsii.Number(20), }) scalableTarget.ScaleOnCpuUtilization(jsii.String("CpuScaling"), &CpuUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), }) scalableTarget.ScaleOnMemoryUtilization(jsii.String("MemoryScaling"), &MemoryUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), })
type MountPoint ¶
type MountPoint struct { // The path on the container to mount the host volume at. ContainerPath *string `field:"required" json:"containerPath" yaml:"containerPath"` // Specifies whether to give the container read-only access to the volume. // // If this value is true, the container has read-only access to the volume. // If this value is false, then the container can write to the volume. ReadOnly *bool `field:"required" json:"readOnly" yaml:"readOnly"` // The name of the volume to mount. // // Must be a volume name referenced in the name parameter of task definition volume. SourceVolume *string `field:"required" json:"sourceVolume" yaml:"sourceVolume"` }
The details of data volume mount points for a container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" mountPoint := &MountPoint{ ContainerPath: jsii.String("containerPath"), ReadOnly: jsii.Boolean(false), SourceVolume: jsii.String("sourceVolume"), }
type NetworkMode ¶
type NetworkMode string
The networking mode to use for the containers in the task.
Example:
ec2TaskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef"), &Ec2TaskDefinitionProps{ NetworkMode: ecs.NetworkMode_BRIDGE, }) container := ec2TaskDefinition.AddContainer(jsii.String("WebContainer"), &ContainerDefinitionOptions{ // Use an image from DockerHub Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), })
const ( // The task's containers do not have external connectivity and port mappings can't be specified in the container definition. NetworkMode_NONE NetworkMode = "NONE" // The task utilizes Docker's built-in virtual network which runs inside each container instance. NetworkMode_BRIDGE NetworkMode = "BRIDGE" // The task is allocated an elastic network interface. NetworkMode_AWS_VPC NetworkMode = "AWS_VPC" // The task bypasses Docker's built-in virtual network and maps container ports directly to the EC2 instance's network interface directly. // // In this mode, you can't run multiple instantiations of the same task on a // single container instance when port mappings are used. NetworkMode_HOST NetworkMode = "HOST" // The task utilizes NAT network mode required by Windows containers. // // This is the only supported network mode for Windows containers. For more information, see // [Task Definition Parameters](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#network_mode). NetworkMode_NAT NetworkMode = "NAT" )
type OperatingSystemFamily ¶ added in v2.7.0
type OperatingSystemFamily interface { }
The operating system for Fargate Runtime Platform.
Example:
// Create a Task Definition for the Windows container to start taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{ RuntimePlatform: &RuntimePlatform{ OperatingSystemFamily: ecs.OperatingSystemFamily_WINDOWS_SERVER_2019_CORE(), CpuArchitecture: ecs.CpuArchitecture_X86_64(), }, Cpu: jsii.Number(1024), MemoryLimitMiB: jsii.Number(2048), }) taskDefinition.AddContainer(jsii.String("windowsservercore"), &ContainerDefinitionOptions{ Logging: ecs.LogDriver_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("win-iis-on-fargate"), }), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), }, }, Image: ecs.ContainerImage_FromRegistry(jsii.String("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")), })
func OperatingSystemFamily_LINUX ¶ added in v2.7.0
func OperatingSystemFamily_LINUX() OperatingSystemFamily
func OperatingSystemFamily_Of ¶ added in v2.7.0
func OperatingSystemFamily_Of(family *string) OperatingSystemFamily
Other operating system family. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-runtimeplatform.html#cfn-ecs-taskdefinition-runtimeplatform-operatingsystemfamily for all available operating system family.
func OperatingSystemFamily_WINDOWS_SERVER_2004_CORE ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2004_CORE() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_2016_FULL ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2016_FULL() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_2019_CORE ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2019_CORE() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_2019_FULL ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2019_FULL() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_2022_CORE ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2022_CORE() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_2022_FULL ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_2022_FULL() OperatingSystemFamily
func OperatingSystemFamily_WINDOWS_SERVER_20H2_CORE ¶ added in v2.7.0
func OperatingSystemFamily_WINDOWS_SERVER_20H2_CORE() OperatingSystemFamily
type PidMode ¶
type PidMode string
The process namespace to use for the containers in the task.
const ( // If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. PidMode_HOST PidMode = "HOST" // If task is specified, all containers within the specified task share the same process namespace. PidMode_TASK PidMode = "TASK" )
type PlacementConstraint ¶
type PlacementConstraint interface { // Return the placement JSON. ToJson() *[]*CfnService_PlacementConstraintProperty }
The placement constraints to use for tasks in the service. For more information, see [Amazon ECS Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html).
Tasks will only be placed on instances that match these rules.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("Ec2Cluster"), &ClusterProps{ Vpc: Vpc, }) cluster.AddCapacity(jsii.String("DefaultAutoScalingGroup"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), VpcSubnets: &SubnetSelection{ SubnetType: ec2.SubnetType_PUBLIC, }, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ Compatibility: ecs.Compatibility_EC2, }) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("Run"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, LaunchTarget: tasks.NewEcsEc2LaunchTarget(&EcsEc2LaunchTargetOptions{ PlacementStrategies: []placementStrategy{ ecs.*placementStrategy_SpreadAcrossInstances(), ecs.*placementStrategy_PackedByCpu(), ecs.*placementStrategy_Randomly(), }, PlacementConstraints: []placementConstraint{ ecs.*placementConstraint_MemberOf(jsii.String("blieptuut")), }, }), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
func PlacementConstraint_DistinctInstances ¶
func PlacementConstraint_DistinctInstances() PlacementConstraint
Use distinctInstance to ensure that each task in a particular group is running on a different container instance.
func PlacementConstraint_MemberOf ¶
func PlacementConstraint_MemberOf(expressions ...*string) PlacementConstraint
Use memberOf to restrict the selection to a group of valid candidates specified by a query expression.
Multiple expressions can be specified. For more information, see [Cluster Query Language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html).
You can specify multiple expressions in one call. The tasks will only be placed on instances matching all expressions. See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html
type PlacementStrategy ¶
type PlacementStrategy interface { // Return the placement JSON. ToJson() *[]*CfnService_PlacementStrategyProperty }
The placement strategies to use for tasks in the service. For more information, see [Amazon ECS Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html).
Tasks will preferentially be placed on instances that match these rules.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("Ec2Cluster"), &ClusterProps{ Vpc: Vpc, }) cluster.AddCapacity(jsii.String("DefaultAutoScalingGroup"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), VpcSubnets: &SubnetSelection{ SubnetType: ec2.SubnetType_PUBLIC, }, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ Compatibility: ecs.Compatibility_EC2, }) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("Run"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, LaunchTarget: tasks.NewEcsEc2LaunchTarget(&EcsEc2LaunchTargetOptions{ PlacementStrategies: []placementStrategy{ ecs.*placementStrategy_SpreadAcrossInstances(), ecs.*placementStrategy_PackedByCpu(), ecs.*placementStrategy_Randomly(), }, PlacementConstraints: []placementConstraint{ ecs.*placementConstraint_MemberOf(jsii.String("blieptuut")), }, }), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
func PlacementStrategy_PackedBy ¶
func PlacementStrategy_PackedBy(resource BinPackResource) PlacementStrategy
Places tasks on the container instances with the least available capacity of the specified resource.
func PlacementStrategy_PackedByCpu ¶
func PlacementStrategy_PackedByCpu() PlacementStrategy
Places tasks on container instances with the least available amount of CPU capacity.
This minimizes the number of instances in use.
func PlacementStrategy_PackedByMemory ¶
func PlacementStrategy_PackedByMemory() PlacementStrategy
Places tasks on container instances with the least available amount of memory capacity.
This minimizes the number of instances in use.
func PlacementStrategy_Randomly ¶
func PlacementStrategy_Randomly() PlacementStrategy
Places tasks randomly.
func PlacementStrategy_SpreadAcross ¶
func PlacementStrategy_SpreadAcross(fields ...*string) PlacementStrategy
Places tasks evenly based on the specified value.
You can use one of the built-in attributes found on `BuiltInAttributes` or supply your own custom instance attributes. If more than one attribute is supplied, spreading is done in order. Default: attributes instanceId.
func PlacementStrategy_SpreadAcrossInstances ¶
func PlacementStrategy_SpreadAcrossInstances() PlacementStrategy
Places tasks evenly across all container instances in the cluster.
type PortMap ¶ added in v2.67.0
type PortMap interface { // The networking mode to use for the containers in the task. Networkmode() NetworkMode // Port mappings allow containers to access ports on the host container instance to send or receive traffic. Portmapping() *PortMapping // validate invalid portmapping and networkmode parameters. // // throw Error when invalid parameters. Validate() }
PortMap ValueObjectClass having by ContainerDefinition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol portMap := awscdk.Aws_ecs.NewPortMap(awscdk.Aws_ecs.NetworkMode_NONE, &PortMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.*Aws_ecs.Protocol_TCP, })
func NewPortMap ¶ added in v2.67.0
func NewPortMap(networkmode NetworkMode, pm *PortMapping) PortMap
type PortMapping ¶
type PortMapping struct { // The port number on the container that is bound to the user-specified or automatically assigned host port. // // If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. // If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, // your container automatically receives a host port in the ephemeral port range. // // For more information, see hostPort. // Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance. // // If you want to expose a port range, you must specify `CONTAINER_PORT_USE_RANGE` as container port. ContainerPort *float64 `field:"required" json:"containerPort" yaml:"containerPort"` // The protocol used by Service Connect. // // Valid values are AppProtocol.http, AppProtocol.http2, and // AppProtocol.grpc. The protocol determines what telemetry will be shown in the ECS Console for // Service Connect services using this port mapping. // // This field may only be set when the task definition uses Bridge or Awsvpc network modes. // Default: - no app protocol. // AppProtocol AppProtocol `field:"optional" json:"appProtocol" yaml:"appProtocol"` // The port number range on the container that's bound to the dynamically mapped host port range. // // The following rules apply when you specify a `containerPortRange`: // // - You must specify `CONTAINER_PORT_USE_RANGE` as `containerPort` // - You must use either the `bridge` network mode or the `awsvpc` network mode. // - The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of the `ecs-init` package // - You can specify a maximum of 100 port ranges per container. // - A port can only be included in one port mapping per container. // - You cannot specify overlapping port ranges. // - The first port in the range must be less than last port in the range. // // If you want to expose a single port, you must not set a range. ContainerPortRange *string `field:"optional" json:"containerPortRange" yaml:"containerPortRange"` // The port number on the container instance to reserve for your container. // // If you are using containers in a task with the awsvpc or host network mode, // the hostPort can either be left blank or set to the same value as the containerPort. // // If you are using containers in a task with the bridge network mode, // you can specify a non-reserved host port for your container port mapping, or // you can omit the hostPort (or set it to 0) while specifying a containerPort and // your container automatically receives a port in the ephemeral port range for // your container instance operating system and Docker version. HostPort *float64 `field:"optional" json:"hostPort" yaml:"hostPort"` // The name to give the port mapping. // // Name is required in order to use the port mapping with ECS Service Connect. // This field may only be set when the task definition uses Bridge or Awsvpc network modes. // Default: - no port mapping name. // Name *string `field:"optional" json:"name" yaml:"name"` // The protocol used for the port mapping. // // Valid values are Protocol.TCP and Protocol.UDP. // Default: TCP. // Protocol Protocol `field:"optional" json:"protocol" yaml:"protocol"` }
Port mappings allow containers to access ports on the host container instance to send or receive traffic.
Example:
var container containerDefinition container.AddPortMappings(&PortMapping{ ContainerPort: ecs.*containerDefinition_CONTAINER_PORT_USE_RANGE(), ContainerPortRange: jsii.String("8080-8081"), })
type PropagatedTagSource ¶
type PropagatedTagSource string
Propagate tags from either service or task definition.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("FargateCluster"), &ClusterProps{ Vpc: Vpc, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ MemoryMiB: jsii.String("512"), Cpu: jsii.String("256"), Compatibility: ecs.Compatibility_FARGATE, }) containerDefinition := taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("RunFargate"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, AssignPublicIp: jsii.Boolean(true), ContainerOverrides: []containerOverride{ &containerOverride{ ContainerDefinition: *ContainerDefinition, Environment: []taskEnvironmentVariable{ &taskEnvironmentVariable{ Name: jsii.String("SOME_KEY"), Value: sfn.JsonPath_StringAt(jsii.String("$.SomeKey")), }, }, }, }, LaunchTarget: tasks.NewEcsFargateLaunchTarget(), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
const ( // Propagate tags from service. PropagatedTagSource_SERVICE PropagatedTagSource = "SERVICE" // Propagate tags from task definition. PropagatedTagSource_TASK_DEFINITION PropagatedTagSource = "TASK_DEFINITION" // Do not propagate. PropagatedTagSource_NONE PropagatedTagSource = "NONE" )
type Protocol ¶
type Protocol string
Network protocol.
Example:
var taskDefinition taskDefinition var cluster cluster // Add a container to the task definition specificContainer := taskDefinition.AddContainer(jsii.String("Container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("/aws/aws-example-app")), MemoryLimitMiB: jsii.Number(2048), }) // Add a port mapping specificContainer.AddPortMappings(&PortMapping{ ContainerPort: jsii.Number(7600), Protocol: ecs.Protocol_TCP, }) ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, CloudMapOptions: &CloudMapOptions{ // Create SRV records - useful for bridge networking DnsRecordType: cloudmap.DnsRecordType_SRV, // Targets port TCP port 7600 `specificContainer` Container: specificContainer, ContainerPort: jsii.Number(7600), }, })
type ProxyConfiguration ¶
type ProxyConfiguration interface { // Called when the proxy configuration is configured on a task definition. Bind(_scope constructs.Construct, _taskDefinition TaskDefinition) *CfnTaskDefinition_ProxyConfigurationProperty }
The base class for proxy configurations.
func ProxyConfigurations_AppMeshProxyConfiguration ¶
func ProxyConfigurations_AppMeshProxyConfiguration(props *AppMeshProxyConfigurationConfigProps) ProxyConfiguration
Constructs a new instance of the ProxyConfiguration class.
type ProxyConfigurations ¶
type ProxyConfigurations interface { }
The base class for proxy configurations.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" proxyConfigurations := awscdk.Aws_ecs.NewProxyConfigurations()
func NewProxyConfigurations ¶
func NewProxyConfigurations() ProxyConfigurations
type RepositoryImage ¶
type RepositoryImage interface { ContainerImage // Called when the image is used by a ContainerDefinition. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *ContainerImageConfig }
An image hosted in a public or private repository.
For images hosted in Amazon ECR, see EcrImage(https://docs.aws.amazon.com/AmazonECR/latest/userguide/images.html).
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var dockerImageAsset dockerImageAsset repositoryImage := awscdk.Aws_ecs.RepositoryImage_FromDockerImageAsset(dockerImageAsset)
func AssetImage_FromRegistry ¶
func AssetImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
Reference an image on DockerHub or another online registry.
func ContainerImage_FromRegistry ¶
func ContainerImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
Reference an image on DockerHub or another online registry.
func EcrImage_FromRegistry ¶
func EcrImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
Reference an image on DockerHub or another online registry.
func NewRepositoryImage ¶
func NewRepositoryImage(imageName *string, props *RepositoryImageProps) RepositoryImage
Constructs a new instance of the RepositoryImage class.
func RepositoryImage_FromRegistry ¶
func RepositoryImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
Reference an image on DockerHub or another online registry.
func TagParameterContainerImage_FromRegistry ¶
func TagParameterContainerImage_FromRegistry(name *string, props *RepositoryImageProps) RepositoryImage
Reference an image on DockerHub or another online registry.
type RepositoryImageProps ¶
type RepositoryImageProps struct { // The secret to expose to the container that contains the credentials for the image repository. // // The supported value is the full ARN of an AWS Secrets Manager secret. Credentials awssecretsmanager.ISecret `field:"optional" json:"credentials" yaml:"credentials"` }
The properties for an image hosted in a public or private repository.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var secret secret repositoryImageProps := &RepositoryImageProps{ Credentials: secret, }
type RequestCountScalingProps ¶
type RequestCountScalingProps struct { // Indicates whether scale in by the target tracking policy is disabled. // // If the value is true, scale in is disabled and the target tracking policy // won't remove capacity from the scalable resource. Otherwise, scale in is // enabled and the target tracking policy can remove capacity from the // scalable resource. // Default: false. // DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"` // A name for the scaling policy. // Default: - Automatically generated name. // PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` // Period after a scale in activity completes before another scale in activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // Period after a scale out activity completes before another scale out activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // The number of ALB requests per target. RequestsPerTarget *float64 `field:"required" json:"requestsPerTarget" yaml:"requestsPerTarget"` // The ALB target group name. TargetGroup awselasticloadbalancingv2.ApplicationTargetGroup `field:"required" json:"targetGroup" yaml:"targetGroup"` }
The properties for enabling scaling based on Application Load Balancer (ALB) request counts.
Example:
var target applicationTargetGroup var service baseService scaling := service.AutoScaleTaskCount(&EnableScalingProps{ MaxCapacity: jsii.Number(10), }) scaling.ScaleOnCpuUtilization(jsii.String("CpuScaling"), &CpuUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), }) scaling.ScaleOnRequestCount(jsii.String("RequestScaling"), &RequestCountScalingProps{ RequestsPerTarget: jsii.Number(10000), TargetGroup: target, })
type RuntimePlatform ¶ added in v2.7.0
type RuntimePlatform struct { // The CpuArchitecture for Fargate Runtime Platform. // Default: - Undefined. // CpuArchitecture CpuArchitecture `field:"optional" json:"cpuArchitecture" yaml:"cpuArchitecture"` // The operating system for Fargate Runtime Platform. // Default: - Undefined. // OperatingSystemFamily OperatingSystemFamily `field:"optional" json:"operatingSystemFamily" yaml:"operatingSystemFamily"` }
The interface for Runtime Platform.
Example:
// Create a Task Definition for the Windows container to start taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef"), &FargateTaskDefinitionProps{ RuntimePlatform: &RuntimePlatform{ OperatingSystemFamily: ecs.OperatingSystemFamily_WINDOWS_SERVER_2019_CORE(), CpuArchitecture: ecs.CpuArchitecture_X86_64(), }, Cpu: jsii.Number(1024), MemoryLimitMiB: jsii.Number(2048), }) taskDefinition.AddContainer(jsii.String("windowsservercore"), &ContainerDefinitionOptions{ Logging: ecs.LogDriver_AwsLogs(&AwsLogDriverProps{ StreamPrefix: jsii.String("win-iis-on-fargate"), }), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), }, }, Image: ecs.ContainerImage_FromRegistry(jsii.String("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")), })
type S3EnvironmentFile ¶
type S3EnvironmentFile interface { EnvironmentFile // Called when the container is initialized to allow this object to bind to the stack. Bind(_scope constructs.Construct) *EnvironmentFileConfig }
Environment file from S3.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var bucket bucket s3EnvironmentFile := awscdk.Aws_ecs.NewS3EnvironmentFile(bucket, jsii.String("key"), jsii.String("objectVersion"))
func AssetEnvironmentFile_FromBucket ¶
func AssetEnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
Loads the environment file from an S3 bucket.
Returns: `S3EnvironmentFile` associated with the specified S3 object.
func EnvironmentFile_FromBucket ¶
func EnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
Loads the environment file from an S3 bucket.
Returns: `S3EnvironmentFile` associated with the specified S3 object.
func NewS3EnvironmentFile ¶
func NewS3EnvironmentFile(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
func S3EnvironmentFile_FromBucket ¶
func S3EnvironmentFile_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3EnvironmentFile
Loads the environment file from an S3 bucket.
Returns: `S3EnvironmentFile` associated with the specified S3 object.
type ScalableTaskCount ¶
type ScalableTaskCount interface { awsapplicationautoscaling.BaseScalableAttribute // The tree node. Node() constructs.Node Props() *awsapplicationautoscaling.BaseScalableAttributeProps // Scale out or in based on a metric value. DoScaleOnMetric(id *string, props *awsapplicationautoscaling.BasicStepScalingPolicyProps) // Scale out or in based on time. DoScaleOnSchedule(id *string, props *awsapplicationautoscaling.ScalingSchedule) // Scale out or in in order to keep a metric around a target value. DoScaleToTrackMetric(id *string, props *awsapplicationautoscaling.BasicTargetTrackingScalingPolicyProps) // Scales in or out to achieve a target CPU utilization. ScaleOnCpuUtilization(id *string, props *CpuUtilizationScalingProps) // Scales in or out to achieve a target memory utilization. ScaleOnMemoryUtilization(id *string, props *MemoryUtilizationScalingProps) // Scales in or out based on a specified metric value. ScaleOnMetric(id *string, props *awsapplicationautoscaling.BasicStepScalingPolicyProps) // Scales in or out to achieve a target Application Load Balancer request count per target. ScaleOnRequestCount(id *string, props *RequestCountScalingProps) // Scales in or out based on a specified scheduled time. ScaleOnSchedule(id *string, props *awsapplicationautoscaling.ScalingSchedule) // Scales in or out to achieve a target on a custom metric. ScaleToTrackCustomMetric(id *string, props *TrackCustomMetricProps) // Returns a string representation of this construct. ToString() *string }
The scalable attribute representing task count.
Example:
var cluster cluster loadBalancedFargateService := ecsPatterns.NewApplicationLoadBalancedFargateService(this, jsii.String("Service"), &ApplicationLoadBalancedFargateServiceProps{ Cluster: Cluster, MemoryLimitMiB: jsii.Number(1024), DesiredCount: jsii.Number(1), Cpu: jsii.Number(512), TaskImageOptions: &ApplicationLoadBalancedTaskImageOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), }, }) scalableTarget := loadBalancedFargateService.Service.AutoScaleTaskCount(&EnableScalingProps{ MinCapacity: jsii.Number(1), MaxCapacity: jsii.Number(20), }) scalableTarget.ScaleOnCpuUtilization(jsii.String("CpuScaling"), &CpuUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), }) scalableTarget.ScaleOnMemoryUtilization(jsii.String("MemoryScaling"), &MemoryUtilizationScalingProps{ TargetUtilizationPercent: jsii.Number(50), })
func NewScalableTaskCount ¶
func NewScalableTaskCount(scope constructs.Construct, id *string, props *ScalableTaskCountProps) ScalableTaskCount
Constructs a new instance of the ScalableTaskCount class.
type ScalableTaskCountProps ¶
type ScalableTaskCountProps struct { // Maximum capacity to scale to. MaxCapacity *float64 `field:"required" json:"maxCapacity" yaml:"maxCapacity"` // Minimum capacity to scale to. // Default: 1. // MinCapacity *float64 `field:"optional" json:"minCapacity" yaml:"minCapacity"` // Scalable dimension of the attribute. Dimension *string `field:"required" json:"dimension" yaml:"dimension"` // Resource ID of the attribute. ResourceId *string `field:"required" json:"resourceId" yaml:"resourceId"` // Role to use for scaling. Role awsiam.IRole `field:"required" json:"role" yaml:"role"` // Service namespace of the scalable attribute. ServiceNamespace awsapplicationautoscaling.ServiceNamespace `field:"required" json:"serviceNamespace" yaml:"serviceNamespace"` }
The properties of a scalable attribute representing task count.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role scalableTaskCountProps := &ScalableTaskCountProps{ Dimension: jsii.String("dimension"), MaxCapacity: jsii.Number(123), ResourceId: jsii.String("resourceId"), Role: role, ServiceNamespace: awscdk.Aws_applicationautoscaling.ServiceNamespace_ECS, // the properties below are optional MinCapacity: jsii.Number(123), }
type Scope ¶
type Scope string
The scope for the Docker volume that determines its lifecycle.
Docker volumes that are scoped to a task are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped as shared persist after the task stops.
type ScratchSpace ¶
type ScratchSpace struct { // The path on the container to mount the scratch volume at. ContainerPath *string `field:"required" json:"containerPath" yaml:"containerPath"` // The name of the scratch volume to mount. // // Must be a volume name referenced in the name parameter of task definition volume. Name *string `field:"required" json:"name" yaml:"name"` // Specifies whether to give the container read-only access to the scratch volume. // // If this value is true, the container has read-only access to the scratch volume. // If this value is false, then the container can write to the scratch volume. ReadOnly *bool `field:"required" json:"readOnly" yaml:"readOnly"` SourcePath *string `field:"required" json:"sourcePath" yaml:"sourcePath"` }
The temporary disk space mounted to the container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" scratchSpace := &ScratchSpace{ ContainerPath: jsii.String("containerPath"), Name: jsii.String("name"), ReadOnly: jsii.Boolean(false), SourcePath: jsii.String("sourcePath"), }
type Secret ¶
type Secret interface { // The ARN of the secret. Arn() *string // Whether this secret uses a specific JSON field. HasField() *bool // Grants reading the secret to a principal. GrantRead(grantee awsiam.IGrantable) awsiam.Grant }
A secret environment variable.
Example:
var secret secret var parameter stringParameter taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Firelens(&FireLensLogDriverProps{ Options: map[string]interface{}{ }, SecretOptions: map[string]secret{ // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store "apikey": ecs.*secret_fromSecretsManager(secret), "host": ecs.*secret_fromSsmParameter(parameter), }, }), })
func Secret_FromSecretsManager ¶
func Secret_FromSecretsManager(secret awssecretsmanager.ISecret, field *string) Secret
Creates a environment variable value from a secret stored in AWS Secrets Manager.
func Secret_FromSecretsManagerVersion ¶ added in v2.13.0
func Secret_FromSecretsManagerVersion(secret awssecretsmanager.ISecret, versionInfo *SecretVersionInfo, field *string) Secret
Creates a environment variable value from a secret stored in AWS Secrets Manager.
func Secret_FromSsmParameter ¶
func Secret_FromSsmParameter(parameter awsssm.IParameter) Secret
Creates an environment variable value from a parameter stored in AWS Systems Manager Parameter Store.
type SecretVersionInfo ¶ added in v2.13.0
type SecretVersionInfo struct { // version id of the secret. // Default: - use default version id. // VersionId *string `field:"optional" json:"versionId" yaml:"versionId"` // version stage of the secret. // Default: - use default version stage. // VersionStage *string `field:"optional" json:"versionStage" yaml:"versionStage"` }
Specify the secret's version id or version stage.
Example:
var secret secret var dbSecret secret var parameter stringParameter var taskDefinition taskDefinition var s3Bucket bucket newContainer := taskDefinition.AddContainer(jsii.String("container"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), MemoryLimitMiB: jsii.Number(1024), Environment: map[string]*string{ // clear text, not for sensitive data "STAGE": jsii.String("prod"), }, EnvironmentFiles: []environmentFile{ ecs.*environmentFile_FromAsset(jsii.String("./demo-env-file.env")), ecs.*environmentFile_FromBucket(s3Bucket, jsii.String("assets/demo-env-file.env")), }, Secrets: map[string]secret{ // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store at container start-up. "SECRET": ecs.*secret_fromSecretsManager(secret), "DB_PASSWORD": ecs.*secret_fromSecretsManager(dbSecret, jsii.String("password")), // Reference a specific JSON field, (requires platform version 1.4.0 or later for Fargate tasks) "API_KEY": ecs.*secret_fromSecretsManagerVersion(secret, &SecretVersionInfo{ "versionId": jsii.String("12345"), }, jsii.String("apiKey")), // Reference a specific version of the secret by its version id or version stage (requires platform version 1.4.0 or later for Fargate tasks) "PARAMETER": ecs.*secret_fromSsmParameter(parameter), }, }) newContainer.AddEnvironment(jsii.String("QUEUE_NAME"), jsii.String("MyQueue")) newContainer.AddSecret(jsii.String("API_KEY"), ecs.secret_FromSecretsManager(secret)) newContainer.AddSecret(jsii.String("DB_PASSWORD"), ecs.secret_FromSecretsManager(secret, jsii.String("password")))
type ServiceConnect ¶ added in v2.67.0
type ServiceConnect interface { // The networking mode to use for the containers in the task. Networkmode() NetworkMode // Port mappings allow containers to access ports on the host container instance to send or receive traffic. Portmapping() *PortMapping // Judge parameters can be serviceconnect logick. // // If parameters can be serviceConnect return true. IsServiceConnect() *bool // Judge serviceconnect parametes are valid. // // If invalid, throw Error. Validate() }
ServiceConnect ValueObjectClass having by ContainerDefinition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var appProtocol appProtocol serviceConnect := awscdk.Aws_ecs.NewServiceConnect(awscdk.Aws_ecs.NetworkMode_NONE, &PortMapping{ ContainerPort: jsii.Number(123), // the properties below are optional AppProtocol: appProtocol, ContainerPortRange: jsii.String("containerPortRange"), HostPort: jsii.Number(123), Name: jsii.String("name"), Protocol: awscdk.*Aws_ecs.Protocol_TCP, })
func NewServiceConnect ¶ added in v2.67.0
func NewServiceConnect(networkmode NetworkMode, pm *PortMapping) ServiceConnect
type ServiceConnectProps ¶ added in v2.52.0
type ServiceConnectProps struct { // The log driver configuration to use for the Service Connect agent logs. // Default: - none. // LogDriver LogDriver `field:"optional" json:"logDriver" yaml:"logDriver"` // The cloudmap namespace to register this service into. // Default: the cloudmap namespace specified on the cluster. // Namespace *string `field:"optional" json:"namespace" yaml:"namespace"` // The list of Services, including a port mapping, terse client alias, and optional intermediate DNS name. // // This property may be left blank if the current ECS service does not need to advertise any ports via Service Connect. // Default: none. // Services *[]*ServiceConnectService `field:"optional" json:"services" yaml:"services"` }
Interface for Service Connect configuration.
Example:
var cluster cluster var taskDefinition taskDefinition var containerOptions containerDefinitionOptions container := taskDefinition.AddContainer(jsii.String("MyContainer"), containerOptions) container.AddPortMappings(&PortMapping{ Name: jsii.String("api"), ContainerPort: jsii.Number(8080), }) cluster.AddDefaultCloudMapNamespace(&CloudMapNamespaceOptions{ Name: jsii.String("local"), }) service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, ServiceConnectConfiguration: &ServiceConnectProps{ Services: []serviceConnectService{ &serviceConnectService{ PortMappingName: jsii.String("api"), DnsName: jsii.String("http-api"), Port: jsii.Number(80), }, }, }, })
type ServiceConnectService ¶ added in v2.52.0
type ServiceConnectService struct { // portMappingName specifies which port and protocol combination should be used for this service connect service. PortMappingName *string `field:"required" json:"portMappingName" yaml:"portMappingName"` // Optionally specifies an intermediate dns name to register in the CloudMap namespace. // // This is required if you wish to use the same port mapping name in more than one service. // Default: - port mapping name. // DiscoveryName *string `field:"optional" json:"discoveryName" yaml:"discoveryName"` // The terse DNS alias to use for this port mapping in the service connect mesh. // // Service Connect-enabled clients will be able to reach this service at // http://dnsName:port. // Default: - No alias is created. The service is reachable at `portMappingName.namespace:port`. // DnsName *string `field:"optional" json:"dnsName" yaml:"dnsName"` // Optional. // // The port on the Service Connect agent container to use for traffic ingress to this service. // Default: - none. // IngressPortOverride *float64 `field:"optional" json:"ingressPortOverride" yaml:"ingressPortOverride"` // The port for clients to use to communicate with this service via Service Connect. // Default: the container port specified by the port mapping in portMappingName. // Port *float64 `field:"optional" json:"port" yaml:"port"` }
Interface for service connect Service props.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" serviceConnectService := &ServiceConnectService{ PortMappingName: jsii.String("portMappingName"), // the properties below are optional DiscoveryName: jsii.String("discoveryName"), DnsName: jsii.String("dnsName"), IngressPortOverride: jsii.Number(123), Port: jsii.Number(123), }
type ServiceManagedEBSVolumeConfiguration ¶ added in v2.122.0
type ServiceManagedEBSVolumeConfiguration struct { // Indicates whether the volume should be encrypted. // Default: - Default Amazon EBS encryption. // Encrypted *bool `field:"optional" json:"encrypted" yaml:"encrypted"` // The Linux filesystem type for the volume. // // For volumes created from a snapshot, you must specify the same filesystem type that // the volume was using when the snapshot was created. // The available filesystem types are ext3, ext4, and xfs. // Default: - FileSystemType.XFS // FileSystemType FileSystemType `field:"optional" json:"fileSystemType" yaml:"fileSystemType"` // The number of I/O operations per second (IOPS). // // For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned // for the volume. For gp2 volumes, this represents the baseline performance of the volume // and the rate at which the volume accumulates I/O credits for bursting. // // The following are the supported values for each volume type. // - gp3: 3,000 - 16,000 IOPS // - io1: 100 - 64,000 IOPS // - io2: 100 - 256,000 IOPS // // This parameter is required for io1 and io2 volume types. The default for gp3 volumes is // 3,000 IOPS. This parameter is not supported for st1, sc1, or standard volume types. // Default: - undefined. // Iops *float64 `field:"optional" json:"iops" yaml:"iops"` // AWS Key Management Service key to use for Amazon EBS encryption. // Default: - When `encryption` is turned on and no `kmsKey` is specified, // the default AWS managed key for Amazon EBS volumes is used. // KmsKeyId awskms.IKey `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // An IAM role that allows ECS to make calls to EBS APIs on your behalf. // // This role is required to create and manage the Amazon EBS volume. // Default: - automatically generated role. // Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // The size of the volume in GiB. // // You must specify either `size` or `snapshotId`. // You can optionally specify a volume size greater than or equal to the snapshot size. // // The following are the supported volume size values for each volume type. // - gp2 and gp3: 1-16,384 // - io1 and io2: 4-16,384 // - st1 and sc1: 125-16,384 // - standard: 1-1,024. // Default: - The snapshot size is used for the volume size if you specify `snapshotId`, // otherwise this parameter is required. // Size awscdk.Size `field:"optional" json:"size" yaml:"size"` // The snapshot that Amazon ECS uses to create the volume. // // You must specify either `size` or `snapshotId`. // Default: - No snapshot. // SnapShotId *string `field:"optional" json:"snapShotId" yaml:"snapShotId"` // Specifies the tags to apply to the volume and whether to propagate those tags to the volume. // Default: - No tags are specified. // TagSpecifications *[]*EBSTagSpecification `field:"optional" json:"tagSpecifications" yaml:"tagSpecifications"` // The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. // // This parameter is only supported for the gp3 volume type. // Default: - No throughput. // Throughput *float64 `field:"optional" json:"throughput" yaml:"throughput"` // The volume type. // Default: - ec2.EbsDeviceVolumeType.GP2 // VolumeType awsec2.EbsDeviceVolumeType `field:"optional" json:"volumeType" yaml:"volumeType"` }
Represents the configuration for an ECS Service managed EBS volume.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
type ServiceManagedVolume ¶ added in v2.122.0
type ServiceManagedVolume interface { constructs.Construct // Volume configuration. Config() *ServiceManagedEBSVolumeConfiguration // configuredAtLaunch indicates volume at launch time, referenced by taskdefinition volume. ConfiguredAtLaunch() *bool // Name of the volume, referenced by taskdefintion and mount point. Name() *string // The tree node. Node() constructs.Node // An IAM role that allows ECS to make calls to EBS APIs. // // If not provided, a new role with appropriate permissions will be created by default. Role() awsiam.IRole // Mounts the service managed volume to a specified container at a defined mount point. MountIn(container ContainerDefinition, mountPoint *ContainerMountPoint) // Returns a string representation of this construct. ToString() *string }
Represents a service-managed volume and always configured at launch.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
func NewServiceManagedVolume ¶ added in v2.122.0
func NewServiceManagedVolume(scope constructs.Construct, id *string, props *ServiceManagedVolumeProps) ServiceManagedVolume
type ServiceManagedVolumeProps ¶ added in v2.122.0
type ServiceManagedVolumeProps struct { // The name of the volume. // // This corresponds to the name provided in the ECS TaskDefinition. Name *string `field:"required" json:"name" yaml:"name"` // Configuration for an Amazon Elastic Block Store (EBS) volume managed by ECS. // Default: - undefined. // ManagedEBSVolume *ServiceManagedEBSVolumeConfiguration `field:"optional" json:"managedEBSVolume" yaml:"managedEBSVolume"` }
Represents the Volume configuration for an ECS service.
Example:
var cluster cluster taskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String("TaskDef")) container := taskDefinition.AddContainer(jsii.String("web"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), PortMappings: []portMapping{ &portMapping{ ContainerPort: jsii.Number(80), Protocol: ecs.Protocol_TCP, }, }, }) volume := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("ebs1"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ Size: awscdk.Size_Gibibytes(jsii.Number(15)), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, TagSpecifications: []eBSTagSpecification{ &eBSTagSpecification{ Tags: map[string]*string{ "purpose": jsii.String("production"), }, PropagateTags: ecs.EbsPropagatedTagSource_SERVICE, }, }, }, }) volume.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volume) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volume)
type SplunkLogDriver ¶
type SplunkLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to splunk Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var secret secret splunkLogDriver := awscdk.Aws_ecs.NewSplunkLogDriver(&SplunkLogDriverProps{ SecretToken: secret, Url: jsii.String("url"), // the properties below are optional CaName: jsii.String("caName"), CaPath: jsii.String("caPath"), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Format: awscdk.*Aws_ecs.SplunkLogFormat_INLINE, Gzip: jsii.Boolean(false), GzipLevel: jsii.Number(123), Index: jsii.String("index"), InsecureSkipVerify: jsii.String("insecureSkipVerify"), Labels: []*string{ jsii.String("labels"), }, Source: jsii.String("source"), SourceType: jsii.String("sourceType"), Tag: jsii.String("tag"), VerifyConnection: jsii.Boolean(false), })
func NewSplunkLogDriver ¶
func NewSplunkLogDriver(props *SplunkLogDriverProps) SplunkLogDriver
Constructs a new instance of the SplunkLogDriver class.
type SplunkLogDriverProps ¶
type SplunkLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // Splunk HTTP Event Collector token (Secret). // // The splunk-token is added to the SecretOptions property of the Log Driver Configuration. So the secret value will not be // resolved or viewable as plain text. SecretToken Secret `field:"required" json:"secretToken" yaml:"secretToken"` // Path to your Splunk Enterprise, self-service Splunk Cloud instance, or Splunk Cloud managed cluster (including port and scheme used by HTTP Event Collector) in one of the following formats: https://your_splunk_instance:8088 or https://input-prd-p-XXXXXXX.cloud.splunk.com:8088 or https://http-inputs-XXXXXXXX.splunkcloud.com. Url *string `field:"required" json:"url" yaml:"url"` // Name to use for validating server certificate. // Default: - The hostname of the splunk-url. // CaName *string `field:"optional" json:"caName" yaml:"caName"` // Path to root certificate. // Default: - caPath not set. // CaPath *string `field:"optional" json:"caPath" yaml:"caPath"` // Message format. // // Can be inline, json or raw. // Default: - inline. // Format SplunkLogFormat `field:"optional" json:"format" yaml:"format"` // Enable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance. // Default: - false. // Gzip *bool `field:"optional" json:"gzip" yaml:"gzip"` // Set compression level for gzip. // // Valid values are -1 (default), 0 (no compression), // 1 (best speed) ... 9 (best compression). // Default: - -1 (Default Compression). // GzipLevel *float64 `field:"optional" json:"gzipLevel" yaml:"gzipLevel"` // Event index. // Default: - index not set. // Index *string `field:"optional" json:"index" yaml:"index"` // Ignore server certificate validation. // Default: - insecureSkipVerify not set. // InsecureSkipVerify *string `field:"optional" json:"insecureSkipVerify" yaml:"insecureSkipVerify"` // Event source. // Default: - source not set. // Source *string `field:"optional" json:"source" yaml:"source"` // Event source type. // Default: - sourceType not set. // SourceType *string `field:"optional" json:"sourceType" yaml:"sourceType"` // Verify on start, that docker can connect to Splunk server. // Default: - true. // VerifyConnection *bool `field:"optional" json:"verifyConnection" yaml:"verifyConnection"` }
Specifies the splunk log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/splunk/)
Example:
var secret secret // Create a Task Definition for the container to start taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), MemoryLimitMiB: jsii.Number(256), Logging: ecs.LogDrivers_Splunk(&SplunkLogDriverProps{ SecretToken: secret, Url: jsii.String("my-splunk-url"), }), })
type SplunkLogFormat ¶
type SplunkLogFormat string
Log Message Format.
const ( SplunkLogFormat_INLINE SplunkLogFormat = "INLINE" SplunkLogFormat_JSON SplunkLogFormat = "JSON" SplunkLogFormat_RAW SplunkLogFormat = "RAW" )
type SyslogLogDriver ¶
type SyslogLogDriver interface { LogDriver // Called when the log driver is configured on a container. Bind(_scope constructs.Construct, _containerDefinition ContainerDefinition) *LogDriverConfig }
A log driver that sends log information to syslog Logs.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" syslogLogDriver := awscdk.Aws_ecs.NewSyslogLogDriver(&SyslogLogDriverProps{ Address: jsii.String("address"), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Facility: jsii.String("facility"), Format: jsii.String("format"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), TlsCaCert: jsii.String("tlsCaCert"), TlsCert: jsii.String("tlsCert"), TlsKey: jsii.String("tlsKey"), TlsSkipVerify: jsii.Boolean(false), })
func NewSyslogLogDriver ¶
func NewSyslogLogDriver(props *SyslogLogDriverProps) SyslogLogDriver
Constructs a new instance of the SyslogLogDriver class.
type SyslogLogDriverProps ¶
type SyslogLogDriverProps struct { // The env option takes an array of keys. // // If there is collision between // label and env keys, the value of the env takes precedence. Adds additional fields // to the extra attributes of a logging message. // Default: - No env. // Env *[]*string `field:"optional" json:"env" yaml:"env"` // The env-regex option is similar to and compatible with env. // // Its value is a regular // expression to match logging-related environment variables. It is used for advanced // log tag options. // Default: - No envRegex. // EnvRegex *string `field:"optional" json:"envRegex" yaml:"envRegex"` // The labels option takes an array of keys. // // If there is collision // between label and env keys, the value of the env takes precedence. Adds additional // fields to the extra attributes of a logging message. // Default: - No labels. // Labels *[]*string `field:"optional" json:"labels" yaml:"labels"` // By default, Docker uses the first 12 characters of the container ID to tag log messages. // // Refer to the log tag option documentation for customizing the // log tag format. // Default: - The first 12 characters of the container ID. // Tag *string `field:"optional" json:"tag" yaml:"tag"` // The address of an external syslog server. // // The URI specifier may be // [tcp|udp|tcp+tls]://host:port, unix://path, or unixgram://path. // Default: - If the transport is tcp, udp, or tcp+tls, the default port is 514. // Address *string `field:"optional" json:"address" yaml:"address"` // The syslog facility to use. // // Can be the number or name for any valid // syslog facility. See the syslog documentation: // https://tools.ietf.org/html/rfc5424#section-6.2.1. // Default: - facility not set. // Facility *string `field:"optional" json:"facility" yaml:"facility"` // The syslog message format to use. // // If not specified the local UNIX syslog // format is used, without a specified hostname. Specify rfc3164 for the RFC-3164 // compatible format, rfc5424 for RFC-5424 compatible format, or rfc5424micro // for RFC-5424 compatible format with microsecond timestamp resolution. // Default: - format not set. // Format *string `field:"optional" json:"format" yaml:"format"` // The absolute path to the trust certificates signed by the CA. // // Ignored // if the address protocol is not tcp+tls. // Default: - tlsCaCert not set. // TlsCaCert *string `field:"optional" json:"tlsCaCert" yaml:"tlsCaCert"` // The absolute path to the TLS certificate file. // // Ignored if the address // protocol is not tcp+tls. // Default: - tlsCert not set. // TlsCert *string `field:"optional" json:"tlsCert" yaml:"tlsCert"` // The absolute path to the TLS key file. // // Ignored if the address protocol // is not tcp+tls. // Default: - tlsKey not set. // TlsKey *string `field:"optional" json:"tlsKey" yaml:"tlsKey"` // If set to true, TLS verification is skipped when connecting to the syslog daemon. // // Ignored if the address protocol is not tcp+tls. // Default: - false. // TlsSkipVerify *bool `field:"optional" json:"tlsSkipVerify" yaml:"tlsSkipVerify"` }
Specifies the syslog log driver configuration options.
[Source](https://docs.docker.com/config/containers/logging/syslog/)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" syslogLogDriverProps := &SyslogLogDriverProps{ Address: jsii.String("address"), Env: []*string{ jsii.String("env"), }, EnvRegex: jsii.String("envRegex"), Facility: jsii.String("facility"), Format: jsii.String("format"), Labels: []*string{ jsii.String("labels"), }, Tag: jsii.String("tag"), TlsCaCert: jsii.String("tlsCaCert"), TlsCert: jsii.String("tlsCert"), TlsKey: jsii.String("tlsKey"), TlsSkipVerify: jsii.Boolean(false), }
type SystemControl ¶
type SystemControl struct { // The namespaced kernel parameter for which to set a value. Namespace *string `field:"required" json:"namespace" yaml:"namespace"` // The value for the namespaced kernel parameter specified in namespace. Value *string `field:"required" json:"value" yaml:"value"` }
Kernel parameters to set in the container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" systemControl := &SystemControl{ Namespace: jsii.String("namespace"), Value: jsii.String("value"), }
type TagParameterContainerImage ¶
type TagParameterContainerImage interface { ContainerImage // Returns the name of the CloudFormation Parameter that represents the tag of the image in the ECR repository. TagParameterName() *string // Returns the value of the CloudFormation Parameter that represents the tag of the image in the ECR repository. TagParameterValue() *string // Called when the image is used by a ContainerDefinition. Bind(scope constructs.Construct, containerDefinition ContainerDefinition) *ContainerImageConfig }
A special type of `ContainerImage` that uses an ECR repository for the image, but a CloudFormation Parameter for the tag of the image in that repository.
This allows providing this tag through the Parameter at deploy time, for example in a CodePipeline that pushes a new tag of the image to the repository during a build step, and then provides that new tag through the CloudFormation Parameter in the deploy step.
Example:
/** * These are the construction properties for `EcsAppStack`. * They extend the standard Stack properties, * but also require providing the ContainerImage that the service will use. * That Image will be provided from the Stack containing the CodePipeline. */ type ecsAppStackProps struct { stackProps image containerImage } /** * This is the Stack containing a simple ECS Service that uses the provided ContainerImage. */ type EcsAppStack struct { stack } func NewEcsAppStack(scope construct, id *string, props ecsAppStackProps) *EcsAppStack { this := &EcsAppStack{} cdk.NewStack_Override(this, scope, id, props) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TaskDefinition"), &TaskDefinitionProps{ Compatibility: ecs.Compatibility_FARGATE, Cpu: jsii.String("1024"), MemoryMiB: jsii.String("2048"), }) taskDefinition.AddContainer(jsii.String("AppContainer"), &ContainerDefinitionOptions{ Image: props.image, }) ecs.NewFargateService(this, jsii.String("EcsService"), &FargateServiceProps{ TaskDefinition: TaskDefinition, Cluster: ecs.NewCluster(this, jsii.String("Cluster"), &ClusterProps{ Vpc: ec2.NewVpc(this, jsii.String("Vpc"), &VpcProps{ MaxAzs: jsii.Number(1), }), }), }) return this } /** * This is the Stack containing the CodePipeline definition that deploys an ECS Service. */ type PipelineStack struct { stack tagParameterContainerImage tagParameterContainerImage }tagParameterContainerImage tagParameterContainerImage func NewPipelineStack(scope construct, id *string, props stackProps) *PipelineStack { this := &PipelineStack{} cdk.NewStack_Override(this, scope, id, props) /* ********** ECS part **************** */ // this is the ECR repository where the built Docker image will be pushed appEcrRepo := ecr.NewRepository(this, jsii.String("EcsDeployRepository")) // the build that creates the Docker image, and pushes it to the ECR repo appCodeDockerBuild := codebuild.NewPipelineProject(this, jsii.String("AppCodeDockerImageBuildAndPushProject"), &PipelineProjectProps{ Environment: &BuildEnvironment{ // we need to run Docker Privileged: jsii.Boolean(true), }, BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{ "version": jsii.String("0.2"), "phases": map[string]map[string][]*string{ "build": map[string][]*string{ "commands": []*string{ jsii.String("$(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)"), jsii.String("docker build -t $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION ."), }, }, "post_build": map[string][]*string{ "commands": []*string{ jsii.String("docker push $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION"), jsii.String("export imageTag=$CODEBUILD_RESOLVED_SOURCE_VERSION"), }, }, }, "env": map[string][]*string{ // save the imageTag environment variable as a CodePipeline Variable "exported-variables": []*string{ jsii.String("imageTag"), }, }, }), EnvironmentVariables: map[string]buildEnvironmentVariable{ "REPOSITORY_URI": &buildEnvironmentVariable{ "value": appEcrRepo.repositoryUri, }, }, }) // needed for `docker push` appEcrRepo.GrantPullPush(appCodeDockerBuild) // create the ContainerImage used for the ECS application Stack this.tagParameterContainerImage = ecs.NewTagParameterContainerImage(appEcrRepo) cdkCodeBuild := codebuild.NewPipelineProject(this, jsii.String("CdkCodeBuildProject"), &PipelineProjectProps{ BuildSpec: codebuild.BuildSpec_*FromObject(map[string]interface{}{ "version": jsii.String("0.2"), "phases": map[string]map[string][]*string{ "install": map[string][]*string{ "commands": []*string{ jsii.String("npm install"), }, }, "build": map[string][]*string{ "commands": []*string{ jsii.String("npx cdk synth --verbose"), }, }, }, "artifacts": map[string]*string{ // store the entire Cloud Assembly as the output artifact "base-directory": jsii.String("cdk.out"), "files": jsii.String("**/*"), }, }), }) /* ********** Pipeline part **************** */ appCodeSourceOutput := codepipeline.NewArtifact() cdkCodeSourceOutput := codepipeline.NewArtifact() cdkCodeBuildOutput := codepipeline.NewArtifact() appCodeBuildAction := codepipeline_actions.NewCodeBuildAction(&CodeBuildActionProps{ ActionName: jsii.String("AppCodeDockerImageBuildAndPush"), Project: appCodeDockerBuild, Input: appCodeSourceOutput, }) codepipeline.NewPipeline(this, jsii.String("CodePipelineDeployingEcsApplication"), &PipelineProps{ ArtifactBucket: s3.NewBucket(this, jsii.String("ArtifactBucket"), &BucketProps{ RemovalPolicy: cdk.RemovalPolicy_DESTROY, }), Stages: []stageProps{ &stageProps{ StageName: jsii.String("Source"), Actions: []iAction{ // this is the Action that takes the source of your application code codepipeline_actions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ ActionName: jsii.String("AppCodeSource"), Repository: codecommit.NewRepository(this, jsii.String("AppCodeSourceRepository"), &RepositoryProps{ RepositoryName: jsii.String("AppCodeSourceRepository"), }), Output: appCodeSourceOutput, }), // this is the Action that takes the source of your CDK code // (which would probably include this Pipeline code as well) codepipeline_actions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ ActionName: jsii.String("CdkCodeSource"), Repository: codecommit.NewRepository(this, jsii.String("CdkCodeSourceRepository"), &RepositoryProps{ RepositoryName: jsii.String("CdkCodeSourceRepository"), }), Output: cdkCodeSourceOutput, }), }, }, &stageProps{ StageName: jsii.String("Build"), Actions: []*iAction{ appCodeBuildAction, codepipeline_actions.NewCodeBuildAction(&CodeBuildActionProps{ ActionName: jsii.String("CdkCodeBuildAndSynth"), Project: cdkCodeBuild, Input: cdkCodeSourceOutput, Outputs: []artifact{ cdkCodeBuildOutput, }, }), }, }, &stageProps{ StageName: jsii.String("Deploy"), Actions: []*iAction{ codepipeline_actions.NewCloudFormationCreateUpdateStackAction(&CloudFormationCreateUpdateStackActionProps{ ActionName: jsii.String("CFN_Deploy"), StackName: jsii.String("SampleEcsStackDeployedFromCodePipeline"), // this name has to be the same name as used below in the CDK code for the application Stack TemplatePath: cdkCodeBuildOutput.AtPath(jsii.String("EcsStackDeployedInPipeline.template.json")), AdminPermissions: jsii.Boolean(true), ParameterOverrides: map[string]interface{}{ // read the tag pushed to the ECR repository from the CodePipeline Variable saved by the application build step, // and pass it as the CloudFormation Parameter for the tag this.tagParameterContainerImage.tagParameterName: appCodeBuildAction.variable(jsii.String("imageTag")), }, }), }, }, }, }) return this } app := cdk.NewApp() // the CodePipeline Stack needs to be created first pipelineStack := NewPipelineStack(app, jsii.String("aws-cdk-pipeline-ecs-separate-sources")) // we supply the image to the ECS application Stack from the CodePipeline Stack // we supply the image to the ECS application Stack from the CodePipeline Stack NewEcsAppStack(app, jsii.String("EcsStackDeployedInPipeline"), &ecsAppStackProps{ image: pipelineStack.tagParameterContainerImage, })
See: #tagParameterName.
func NewTagParameterContainerImage ¶
func NewTagParameterContainerImage(repository awsecr.IRepository) TagParameterContainerImage
type TaskDefinition ¶
type TaskDefinition interface { awscdk.Resource ITaskDefinition // The task launch type compatibility requirement. Compatibility() Compatibility // The container definitions. Containers() *[]ContainerDefinition // Default container for this task. // // Load balancers will send traffic to this container. The first // essential container that is added to this task will become the default // container. DefaultContainer() ContainerDefinition SetDefaultContainer(val ContainerDefinition) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The amount (in GiB) of ephemeral storage to be allocated to the task. // // Only supported in Fargate platform version 1.4.0 or later. EphemeralStorageGiB() *float64 // Execution role for this task definition. ExecutionRole() awsiam.IRole // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. Family() *string // Public getter method to access list of inference accelerators attached to the instance. InferenceAccelerators() *[]*InferenceAccelerator // Return true if the task definition can be run on an EC2 cluster. IsEc2Compatible() *bool // Return true if the task definition can be run on a ECS anywhere cluster. IsExternalCompatible() *bool // Return true if the task definition can be run on a Fargate cluster. IsFargateCompatible() *bool // The networking mode to use for the containers in the task. NetworkMode() NetworkMode // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager. ReferencesSecretJsonField() *bool // The stack in which this resource is defined. Stack() awscdk.Stack // The full Amazon Resource Name (ARN) of the task definition. TaskDefinitionArn() *string // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. TaskRole() awsiam.IRole // Adds a new container to the task definition. AddContainer(id *string, props *ContainerDefinitionOptions) ContainerDefinition // Adds the specified extension to the task definition. // // Extension can be used to apply a packaged modification to // a task definition. AddExtension(extension ITaskDefinitionExtension) // Adds a firelens log router to the task definition. AddFirelensLogRouter(id *string, props *FirelensLogRouterDefinitionOptions) FirelensLogRouter // Adds an inference accelerator to the task definition. AddInferenceAccelerator(inferenceAccelerator *InferenceAccelerator) // Adds the specified placement constraint to the task definition. AddPlacementConstraint(constraint PlacementConstraint) // Adds a policy statement to the task execution IAM role. AddToExecutionRolePolicy(statement awsiam.PolicyStatement) // Adds a policy statement to the task IAM role. AddToTaskRolePolicy(statement awsiam.PolicyStatement) // Adds a volume to the task definition. AddVolume(volume *Volume) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns the container that match the provided containerName. FindContainer(containerName *string) ContainerDefinition // Determine the existing port mapping for the provided name. // // Returns: PortMapping for the provided name, if it exists. FindPortMappingByName(name *string) *PortMapping GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grants permissions to run this task definition. // // This will grant the following permissions: // // - ecs:RunTask // - iam:PassRole. GrantRun(grantee awsiam.IGrantable) awsiam.Grant // Creates the task execution IAM role if it doesn't already exist. ObtainExecutionRole() awsiam.IRole // Returns a string representation of this construct. ToString() *string }
The base class for all task definitions.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewFargateService(this, jsii.String("Service"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elbv2.NewApplicationLoadBalancer(this, jsii.String("LB"), &ApplicationLoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), }) listener := lb.AddListener(jsii.String("Listener"), &BaseApplicationListenerProps{ Port: jsii.Number(80), }) service.RegisterLoadBalancerTargets(&EcsTarget{ ContainerName: jsii.String("web"), ContainerPort: jsii.Number(80), NewTargetGroupId: jsii.String("ECS"), Listener: ecs.ListenerConfig_ApplicationListener(listener, &AddApplicationTargetsProps{ Protocol: elbv2.ApplicationProtocol_HTTPS, }), })
func NewTaskDefinition ¶
func NewTaskDefinition(scope constructs.Construct, id *string, props *TaskDefinitionProps) TaskDefinition
Constructs a new instance of the TaskDefinition class.
type TaskDefinitionAttributes ¶
type TaskDefinitionAttributes struct { // The arn of the task definition. TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"` // The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. // // Some tasks do not have an execution role. // Default: - undefined. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The networking mode to use for the containers in the task. // Default: Network mode cannot be provided to the imported task. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: Permissions cannot be granted to the imported task. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // What launch types this task definition should be compatible with. // Default: Compatibility.EC2_AND_FARGATE // Compatibility Compatibility `field:"optional" json:"compatibility" yaml:"compatibility"` }
A reference to an existing task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var role role taskDefinitionAttributes := &TaskDefinitionAttributes{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional Compatibility: awscdk.Aws_ecs.Compatibility_EC2, ExecutionRole: role, NetworkMode: awscdk.*Aws_ecs.NetworkMode_NONE, TaskRole: role, }
type TaskDefinitionProps ¶
type TaskDefinitionProps struct { // The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. // // The role will be used to retrieve container images from ECR and create CloudWatch log groups. // Default: - An execution role will be automatically created if you use ECR images in your task definition. // ExecutionRole awsiam.IRole `field:"optional" json:"executionRole" yaml:"executionRole"` // The name of a family that this task definition is registered to. // // A family groups multiple versions of a task definition. // Default: - Automatically generated name. // Family *string `field:"optional" json:"family" yaml:"family"` // The configuration details for the App Mesh proxy. // Default: - No proxy configuration. // ProxyConfiguration ProxyConfiguration `field:"optional" json:"proxyConfiguration" yaml:"proxyConfiguration"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` // The list of volume definitions for the task. // // For more information, see // [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes). // Default: - No volumes are passed to the Docker daemon on a container instance. // Volumes *[]*Volume `field:"optional" json:"volumes" yaml:"volumes"` // The task launch type compatiblity requirement. Compatibility Compatibility `field:"required" json:"compatibility" yaml:"compatibility"` // The number of cpu units used by the task. // // If you are using the EC2 launch type, this field is optional and any value can be used. // If you are using the Fargate launch type, this field is required and you must use one of the following values, // which determines your range of valid values for the memory parameter: // // 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) // // 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) // // 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) // // 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) // // 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) // // 8192 (8 vCPU) - Available memory values: Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) // // 16384 (16 vCPU) - Available memory values: Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB). // Default: - CPU units are not specified. // Cpu *string `field:"optional" json:"cpu" yaml:"cpu"` // The amount (in GiB) of ephemeral storage to be allocated to the task. // // Only supported in Fargate platform version 1.4.0 or later. // Default: - Undefined, in which case, the task will receive 20GiB ephemeral storage. // EphemeralStorageGiB *float64 `field:"optional" json:"ephemeralStorageGiB" yaml:"ephemeralStorageGiB"` // The inference accelerators to use for the containers in the task. // // Not supported in Fargate. // Default: - No inference accelerators. // InferenceAccelerators *[]*InferenceAccelerator `field:"optional" json:"inferenceAccelerators" yaml:"inferenceAccelerators"` // The IPC resource namespace to use for the containers in the task. // // Not supported in Fargate and Windows containers. // Default: - IpcMode used by the task is not specified. // IpcMode IpcMode `field:"optional" json:"ipcMode" yaml:"ipcMode"` // The amount (in MiB) of memory used by the task. // // If using the EC2 launch type, this field is optional and any value can be used. // If using the Fargate launch type, this field is required and you must use one of the following values, // which determines your range of valid values for the cpu parameter: // // 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) // // 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) // // 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) // // Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU) // // Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU) // // Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU) // // Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU). // Default: - Memory used by task is not specified. // MemoryMiB *string `field:"optional" json:"memoryMiB" yaml:"memoryMiB"` // The networking mode to use for the containers in the task. // // On Fargate, the only supported networking mode is AwsVpc. // Default: - NetworkMode.Bridge for EC2 & External tasks, AwsVpc for Fargate tasks. // NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // The process namespace to use for the containers in the task. // // Not supported in Fargate and Windows containers. // Default: - PidMode used by the task is not specified. // PidMode PidMode `field:"optional" json:"pidMode" yaml:"pidMode"` // The placement constraints to use for tasks in the service. // // You can specify a maximum of 10 constraints per task (this limit includes // constraints in the task definition and those specified at run time). // // Not supported in Fargate. // Default: - No placement constraints. // PlacementConstraints *[]PlacementConstraint `field:"optional" json:"placementConstraints" yaml:"placementConstraints"` // The operating system that your task definitions are running on. // // A runtimePlatform is supported only for tasks using the Fargate launch type. // Default: - Undefined. // RuntimePlatform *RuntimePlatform `field:"optional" json:"runtimePlatform" yaml:"runtimePlatform"` }
The properties for task definitions.
Example:
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{ IsDefault: jsii.Boolean(true), }) cluster := ecs.NewCluster(this, jsii.String("Ec2Cluster"), &ClusterProps{ Vpc: Vpc, }) cluster.AddCapacity(jsii.String("DefaultAutoScalingGroup"), &AddCapacityOptions{ InstanceType: ec2.NewInstanceType(jsii.String("t2.micro")), VpcSubnets: &SubnetSelection{ SubnetType: ec2.SubnetType_PUBLIC, }, }) taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{ Compatibility: ecs.Compatibility_EC2, }) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")), MemoryLimitMiB: jsii.Number(256), }) runTask := tasks.NewEcsRunTask(this, jsii.String("Run"), &EcsRunTaskProps{ IntegrationPattern: sfn.IntegrationPattern_RUN_JOB, Cluster: Cluster, TaskDefinition: TaskDefinition, LaunchTarget: tasks.NewEcsEc2LaunchTarget(&EcsEc2LaunchTargetOptions{ PlacementStrategies: []placementStrategy{ ecs.*placementStrategy_SpreadAcrossInstances(), ecs.*placementStrategy_PackedByCpu(), ecs.*placementStrategy_Randomly(), }, PlacementConstraints: []placementConstraint{ ecs.*placementConstraint_MemberOf(jsii.String("blieptuut")), }, }), PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION, })
type TaskDefinitionRevision ¶ added in v2.116.0
type TaskDefinitionRevision interface { // The string representation of this revision. Revision() *string }
Represents revision of a task definition, either a specific numbered revision or the `latest` revision.
Example:
var cluster cluster var taskDefinition taskDefinition ecs.NewExternalService(this, jsii.String("Service"), &ExternalServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DesiredCount: jsii.Number(5), TaskDefinitionRevision: ecs.TaskDefinitionRevision_Of(jsii.Number(1)), }) ecs.NewExternalService(this, jsii.String("Service"), &ExternalServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, DesiredCount: jsii.Number(5), TaskDefinitionRevision: ecs.TaskDefinitionRevision_LATEST(), })
func TaskDefinitionRevision_LATEST ¶ added in v2.116.0
func TaskDefinitionRevision_LATEST() TaskDefinitionRevision
func TaskDefinitionRevision_Of ¶ added in v2.116.0
func TaskDefinitionRevision_Of(revision *float64) TaskDefinitionRevision
Specific revision of a task.
type Tmpfs ¶
type Tmpfs struct { // The absolute file path where the tmpfs volume is to be mounted. ContainerPath *string `field:"required" json:"containerPath" yaml:"containerPath"` // The size (in MiB) of the tmpfs volume. Size *float64 `field:"required" json:"size" yaml:"size"` // The list of tmpfs volume mount options. // // For more information, see // [TmpfsMountOptions](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Tmpfs.html). MountOptions *[]TmpfsMountOption `field:"optional" json:"mountOptions" yaml:"mountOptions"` }
The details of a tmpfs mount for a container.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" tmpfs := &Tmpfs{ ContainerPath: jsii.String("containerPath"), Size: jsii.Number(123), // the properties below are optional MountOptions: []tmpfsMountOption{ awscdk.Aws_ecs.*tmpfsMountOption_DEFAULTS, }, }
type TmpfsMountOption ¶
type TmpfsMountOption string
The supported options for a tmpfs mount for a container.
const ( TmpfsMountOption_DEFAULTS TmpfsMountOption = "DEFAULTS" TmpfsMountOption_RO TmpfsMountOption = "RO" TmpfsMountOption_RW TmpfsMountOption = "RW" TmpfsMountOption_SUID TmpfsMountOption = "SUID" TmpfsMountOption_NOSUID TmpfsMountOption = "NOSUID" TmpfsMountOption_DEV TmpfsMountOption = "DEV" TmpfsMountOption_NODEV TmpfsMountOption = "NODEV" TmpfsMountOption_EXEC TmpfsMountOption = "EXEC" TmpfsMountOption_NOEXEC TmpfsMountOption = "NOEXEC" TmpfsMountOption_SYNC TmpfsMountOption = "SYNC" TmpfsMountOption_ASYNC TmpfsMountOption = "ASYNC" TmpfsMountOption_DIRSYNC TmpfsMountOption = "DIRSYNC" TmpfsMountOption_REMOUNT TmpfsMountOption = "REMOUNT" TmpfsMountOption_MAND TmpfsMountOption = "MAND" TmpfsMountOption_NOMAND TmpfsMountOption = "NOMAND" TmpfsMountOption_ATIME TmpfsMountOption = "ATIME" TmpfsMountOption_NOATIME TmpfsMountOption = "NOATIME" TmpfsMountOption_DIRATIME TmpfsMountOption = "DIRATIME" TmpfsMountOption_NODIRATIME TmpfsMountOption = "NODIRATIME" TmpfsMountOption_BIND TmpfsMountOption = "BIND" TmpfsMountOption_RBIND TmpfsMountOption = "RBIND" TmpfsMountOption_UNBINDABLE TmpfsMountOption = "UNBINDABLE" TmpfsMountOption_RUNBINDABLE TmpfsMountOption = "RUNBINDABLE" TmpfsMountOption_PRIVATE TmpfsMountOption = "PRIVATE" TmpfsMountOption_RPRIVATE TmpfsMountOption = "RPRIVATE" TmpfsMountOption_SHARED TmpfsMountOption = "SHARED" TmpfsMountOption_RSHARED TmpfsMountOption = "RSHARED" TmpfsMountOption_SLAVE TmpfsMountOption = "SLAVE" TmpfsMountOption_RSLAVE TmpfsMountOption = "RSLAVE" TmpfsMountOption_RELATIME TmpfsMountOption = "RELATIME" TmpfsMountOption_NORELATIME TmpfsMountOption = "NORELATIME" TmpfsMountOption_STRICTATIME TmpfsMountOption = "STRICTATIME" TmpfsMountOption_NOSTRICTATIME TmpfsMountOption = "NOSTRICTATIME" TmpfsMountOption_MODE TmpfsMountOption = "MODE" TmpfsMountOption_UID TmpfsMountOption = "UID" TmpfsMountOption_GID TmpfsMountOption = "GID" TmpfsMountOption_NR_INODES TmpfsMountOption = "NR_INODES" TmpfsMountOption_NR_BLOCKS TmpfsMountOption = "NR_BLOCKS" TmpfsMountOption_MPOL TmpfsMountOption = "MPOL" )
type TrackCustomMetricProps ¶
type TrackCustomMetricProps struct { // Indicates whether scale in by the target tracking policy is disabled. // // If the value is true, scale in is disabled and the target tracking policy // won't remove capacity from the scalable resource. Otherwise, scale in is // enabled and the target tracking policy can remove capacity from the // scalable resource. // Default: false. // DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"` // A name for the scaling policy. // Default: - Automatically generated name. // PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` // Period after a scale in activity completes before another scale in activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // Period after a scale out activity completes before another scale out activity can start. // Default: Duration.seconds(300) for the following scalable targets: ECS services, // Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, // Amazon SageMaker endpoint variants, Custom resources. For all other scalable // targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB // global secondary indexes, Amazon Comprehend document classification endpoints, // Lambda provisioned concurrency. // ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // The custom CloudWatch metric to track. // // The metric must represent utilization; that is, you will always get the following behavior: // // - metric > targetValue => scale out // - metric < targetValue => scale in. Metric awscloudwatch.IMetric `field:"required" json:"metric" yaml:"metric"` // The target value for the custom CloudWatch metric. TargetValue *float64 `field:"required" json:"targetValue" yaml:"targetValue"` }
The properties for enabling target tracking scaling based on a custom CloudWatch metric.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var metric metric trackCustomMetricProps := &TrackCustomMetricProps{ Metric: metric, TargetValue: jsii.Number(123), // the properties below are optional DisableScaleIn: jsii.Boolean(false), PolicyName: jsii.String("policyName"), ScaleInCooldown: cdk.Duration_Minutes(jsii.Number(30)), ScaleOutCooldown: cdk.Duration_*Minutes(jsii.Number(30)), }
type Ulimit ¶
type Ulimit struct { // The hard limit for the ulimit type. HardLimit *float64 `field:"required" json:"hardLimit" yaml:"hardLimit"` // The type of the ulimit. // // For more information, see [UlimitName](https://docs.aws.amazon.com/cdk/api/latest/typescript/api/aws-ecs/ulimitname.html#aws_ecs_UlimitName). Name UlimitName `field:"required" json:"name" yaml:"name"` // The soft limit for the ulimit type. SoftLimit *float64 `field:"required" json:"softLimit" yaml:"softLimit"` }
The ulimit settings to pass to the container.
NOTE: Does not work for Windows containers.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" ulimit := &Ulimit{ HardLimit: jsii.Number(123), Name: awscdk.Aws_ecs.UlimitName_CORE, SoftLimit: jsii.Number(123), }
type UlimitName ¶
type UlimitName string
Type of resource to set a limit on.
Example:
taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef")) taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{ Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")), Ulimits: []ulimit{ &ulimit{ HardLimit: jsii.Number(128), Name: ecs.UlimitName_RSS, SoftLimit: jsii.Number(128), }, }, })
const ( UlimitName_CORE UlimitName = "CORE" UlimitName_CPU UlimitName = "CPU" UlimitName_DATA UlimitName = "DATA" UlimitName_FSIZE UlimitName = "FSIZE" UlimitName_LOCKS UlimitName = "LOCKS" UlimitName_MEMLOCK UlimitName = "MEMLOCK" UlimitName_MSGQUEUE UlimitName = "MSGQUEUE" UlimitName_NICE UlimitName = "NICE" UlimitName_NOFILE UlimitName = "NOFILE" UlimitName_NPROC UlimitName = "NPROC" UlimitName_RSS UlimitName = "RSS" UlimitName_RTPRIO UlimitName = "RTPRIO" UlimitName_RTTIME UlimitName = "RTTIME" UlimitName_SIGPENDING UlimitName = "SIGPENDING" UlimitName_STACK UlimitName = "STACK" )
type Volume ¶
type Volume struct { // The name of the volume. // // Up to 255 letters (uppercase and lowercase), numbers, and hyphens are allowed. // This name is referenced in the sourceVolume parameter of container definition mountPoints. Name *string `field:"required" json:"name" yaml:"name"` // Indicates if the volume should be configured at launch. // Default: false. // ConfiguredAtLaunch *bool `field:"optional" json:"configuredAtLaunch" yaml:"configuredAtLaunch"` // This property is specified when you are using Docker volumes. // // Docker volumes are only supported when you are using the EC2 launch type. // Windows containers only support the use of the local driver. // To use bind mounts, specify a host instead. DockerVolumeConfiguration *DockerVolumeConfiguration `field:"optional" json:"dockerVolumeConfiguration" yaml:"dockerVolumeConfiguration"` // This property is specified when you are using Amazon EFS. // // When specifying Amazon EFS volumes in tasks using the Fargate launch type, // Fargate creates a supervisor container that is responsible for managing the Amazon EFS volume. // The supervisor container uses a small amount of the task's memory. // The supervisor container is visible when querying the task metadata version 4 endpoint, // but is not visible in CloudWatch Container Insights. // Default: No Elastic FileSystem is setup. // EfsVolumeConfiguration *EfsVolumeConfiguration `field:"optional" json:"efsVolumeConfiguration" yaml:"efsVolumeConfiguration"` // This property is specified when you are using bind mount host volumes. // // Bind mount host volumes are supported when you are using either the EC2 or Fargate launch types. // The contents of the host parameter determine whether your bind mount host volume persists on the // host container instance and where it is stored. If the host parameter is empty, then the Docker // daemon assigns a host path for your data volume. However, the data is not guaranteed to persist // after the containers associated with it stop running. Host *Host `field:"optional" json:"host" yaml:"host"` }
A data volume used in a task definition.
For tasks that use a Docker volume, specify a DockerVolumeConfiguration. For tasks that use a bind mount host volume, specify a host and optional sourcePath.
For more information, see [Using Data Volumes in Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html).
Example:
var container containerDefinition var cluster cluster var taskDefinition taskDefinition volumeFromSnapshot := ecs.NewServiceManagedVolume(this, jsii.String("EBSVolume"), &ServiceManagedVolumeProps{ Name: jsii.String("nginx-vol"), ManagedEBSVolume: &ServiceManagedEBSVolumeConfiguration{ SnapShotId: jsii.String("snap-066877671789bd71b"), VolumeType: ec2.EbsDeviceVolumeType_GP3, FileSystemType: ecs.FileSystemType_XFS, }, }) volumeFromSnapshot.MountIn(container, &ContainerMountPoint{ ContainerPath: jsii.String("/var/lib"), ReadOnly: jsii.Boolean(false), }) taskDefinition.AddVolume(volumeFromSnapshot) service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) service.AddVolume(volumeFromSnapshot)
type VolumeFrom ¶
type VolumeFrom struct { // Specifies whether the container has read-only access to the volume. // // If this value is true, the container has read-only access to the volume. // If this value is false, then the container can write to the volume. ReadOnly *bool `field:"required" json:"readOnly" yaml:"readOnly"` // The name of another container within the same task definition from which to mount volumes. SourceContainer *string `field:"required" json:"sourceContainer" yaml:"sourceContainer"` }
The details on a data volume from another container in the same task definition.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" volumeFrom := &VolumeFrom{ ReadOnly: jsii.Boolean(false), SourceContainer: jsii.String("sourceContainer"), }
type WindowsOptimizedVersion ¶
type WindowsOptimizedVersion string
ECS-optimized Windows version list.
const ( WindowsOptimizedVersion_SERVER_2022 WindowsOptimizedVersion = "SERVER_2022" WindowsOptimizedVersion_SERVER_2019 WindowsOptimizedVersion = "SERVER_2019" WindowsOptimizedVersion_SERVER_2016 WindowsOptimizedVersion = "SERVER_2016" )
Source Files ¶
- AddAutoScalingGroupCapacityOptions.go
- AddCapacityOptions.go
- AlarmBehavior.go
- AmiHardwareType.go
- AppMeshProxyConfiguration.go
- AppMeshProxyConfigurationConfigProps.go
- AppMeshProxyConfigurationProps.go
- AppMeshProxyConfiguration__checks.go
- AppProtocol.go
- AppProtocol__checks.go
- AsgCapacityProvider.go
- AsgCapacityProviderProps.go
- AsgCapacityProvider__checks.go
- AssetEnvironmentFile.go
- AssetEnvironmentFile__checks.go
- AssetImage.go
- AssetImageProps.go
- AssetImage__checks.go
- AssociateCloudMapServiceOptions.go
- AuthorizationConfig.go
- AwsLogDriver.go
- AwsLogDriverMode.go
- AwsLogDriverProps.go
- AwsLogDriver__checks.go
- BaseLogDriverProps.go
- BaseMountPoint.go
- BaseService.go
- BaseServiceOptions.go
- BaseServiceProps.go
- BaseService__checks.go
- BinPackResource.go
- BottleRocketImage.go
- BottleRocketImageProps.go
- BottleRocketImage__checks.go
- BottlerocketEcsVariant.go
- BuiltInAttributes.go
- Capability.go
- CapacityProviderStrategy.go
- CfnCapacityProvider.go
- CfnCapacityProviderProps.go
- CfnCapacityProvider_AutoScalingGroupProviderProperty.go
- CfnCapacityProvider_ManagedScalingProperty.go
- CfnCapacityProvider__checks.go
- CfnCluster.go
- CfnClusterCapacityProviderAssociations.go
- CfnClusterCapacityProviderAssociationsProps.go
- CfnClusterCapacityProviderAssociations_CapacityProviderStrategyProperty.go
- CfnClusterCapacityProviderAssociations__checks.go
- CfnClusterProps.go
- CfnCluster_CapacityProviderStrategyItemProperty.go
- CfnCluster_ClusterConfigurationProperty.go
- CfnCluster_ClusterSettingsProperty.go
- CfnCluster_ExecuteCommandConfigurationProperty.go
- CfnCluster_ExecuteCommandLogConfigurationProperty.go
- CfnCluster_ServiceConnectDefaultsProperty.go
- CfnCluster__checks.go
- CfnPrimaryTaskSet.go
- CfnPrimaryTaskSetProps.go
- CfnPrimaryTaskSet__checks.go
- CfnService.go
- CfnServiceProps.go
- CfnService_AwsVpcConfigurationProperty.go
- CfnService_CapacityProviderStrategyItemProperty.go
- CfnService_DeploymentAlarmsProperty.go
- CfnService_DeploymentCircuitBreakerProperty.go
- CfnService_DeploymentConfigurationProperty.go
- CfnService_DeploymentControllerProperty.go
- CfnService_EBSTagSpecificationProperty.go
- CfnService_LoadBalancerProperty.go
- CfnService_LogConfigurationProperty.go
- CfnService_NetworkConfigurationProperty.go
- CfnService_PlacementConstraintProperty.go
- CfnService_PlacementStrategyProperty.go
- CfnService_SecretProperty.go
- CfnService_ServiceConnectClientAliasProperty.go
- CfnService_ServiceConnectConfigurationProperty.go
- CfnService_ServiceConnectServiceProperty.go
- CfnService_ServiceConnectTlsCertificateAuthorityProperty.go
- CfnService_ServiceConnectTlsConfigurationProperty.go
- CfnService_ServiceManagedEBSVolumeConfigurationProperty.go
- CfnService_ServiceRegistryProperty.go
- CfnService_ServiceVolumeConfigurationProperty.go
- CfnService_TimeoutConfigurationProperty.go
- CfnService__checks.go
- CfnTaskDefinition.go
- CfnTaskDefinitionProps.go
- CfnTaskDefinition_AuthorizationConfigProperty.go
- CfnTaskDefinition_ContainerDefinitionProperty.go
- CfnTaskDefinition_ContainerDependencyProperty.go
- CfnTaskDefinition_DeviceProperty.go
- CfnTaskDefinition_DockerVolumeConfigurationProperty.go
- CfnTaskDefinition_EFSVolumeConfigurationProperty.go
- CfnTaskDefinition_EnvironmentFileProperty.go
- CfnTaskDefinition_EphemeralStorageProperty.go
- CfnTaskDefinition_FirelensConfigurationProperty.go
- CfnTaskDefinition_HealthCheckProperty.go
- CfnTaskDefinition_HostEntryProperty.go
- CfnTaskDefinition_HostVolumePropertiesProperty.go
- CfnTaskDefinition_InferenceAcceleratorProperty.go
- CfnTaskDefinition_KernelCapabilitiesProperty.go
- CfnTaskDefinition_KeyValuePairProperty.go
- CfnTaskDefinition_LinuxParametersProperty.go
- CfnTaskDefinition_LogConfigurationProperty.go
- CfnTaskDefinition_MountPointProperty.go
- CfnTaskDefinition_PortMappingProperty.go
- CfnTaskDefinition_ProxyConfigurationProperty.go
- CfnTaskDefinition_RepositoryCredentialsProperty.go
- CfnTaskDefinition_ResourceRequirementProperty.go
- CfnTaskDefinition_RuntimePlatformProperty.go
- CfnTaskDefinition_SecretProperty.go
- CfnTaskDefinition_SystemControlProperty.go
- CfnTaskDefinition_TaskDefinitionPlacementConstraintProperty.go
- CfnTaskDefinition_TmpfsProperty.go
- CfnTaskDefinition_UlimitProperty.go
- CfnTaskDefinition_VolumeFromProperty.go
- CfnTaskDefinition_VolumeProperty.go
- CfnTaskDefinition__checks.go
- CfnTaskSet.go
- CfnTaskSetProps.go
- CfnTaskSet_AwsVpcConfigurationProperty.go
- CfnTaskSet_LoadBalancerProperty.go
- CfnTaskSet_NetworkConfigurationProperty.go
- CfnTaskSet_ScaleProperty.go
- CfnTaskSet_ServiceRegistryProperty.go
- CfnTaskSet__checks.go
- CloudMapNamespaceOptions.go
- CloudMapOptions.go
- Cluster.go
- ClusterAttributes.go
- ClusterProps.go
- Cluster__checks.go
- CommonTaskDefinitionAttributes.go
- CommonTaskDefinitionProps.go
- Compatibility.go
- ContainerDefinition.go
- ContainerDefinitionOptions.go
- ContainerDefinitionProps.go
- ContainerDefinition__checks.go
- ContainerDependency.go
- ContainerDependencyCondition.go
- ContainerImage.go
- ContainerImageConfig.go
- ContainerImage__checks.go
- ContainerMountPoint.go
- CpuArchitecture.go
- CpuArchitecture__checks.go
- CpuUtilizationScalingProps.go
- DeploymentAlarmConfig.go
- DeploymentAlarmOptions.go
- DeploymentCircuitBreaker.go
- DeploymentController.go
- DeploymentControllerType.go
- Device.go
- DevicePermission.go
- DockerVolumeConfiguration.go
- EBSTagSpecification.go
- EbsPropagatedTagSource.go
- Ec2Service.go
- Ec2ServiceAttributes.go
- Ec2ServiceProps.go
- Ec2Service__checks.go
- Ec2TaskDefinition.go
- Ec2TaskDefinitionAttributes.go
- Ec2TaskDefinitionProps.go
- Ec2TaskDefinition__checks.go
- EcrImage.go
- EcrImage__checks.go
- EcsOptimizedImage.go
- EcsOptimizedImageOptions.go
- EcsOptimizedImage__checks.go
- EcsTarget.go
- EfsVolumeConfiguration.go
- EnvironmentFile.go
- EnvironmentFileConfig.go
- EnvironmentFileType.go
- EnvironmentFile__checks.go
- ExecuteCommandConfiguration.go
- ExecuteCommandLogConfiguration.go
- ExecuteCommandLogging.go
- ExternalService.go
- ExternalServiceAttributes.go
- ExternalServiceProps.go
- ExternalService__checks.go
- ExternalTaskDefinition.go
- ExternalTaskDefinitionAttributes.go
- ExternalTaskDefinitionProps.go
- ExternalTaskDefinition__checks.go
- FargatePlatformVersion.go
- FargateService.go
- FargateServiceAttributes.go
- FargateServiceProps.go
- FargateService__checks.go
- FargateTaskDefinition.go
- FargateTaskDefinitionAttributes.go
- FargateTaskDefinitionProps.go
- FargateTaskDefinition__checks.go
- FileSystemType.go
- FireLensLogDriver.go
- FireLensLogDriverProps.go
- FireLensLogDriver__checks.go
- FirelensConfig.go
- FirelensConfigFileType.go
- FirelensLogRouter.go
- FirelensLogRouterDefinitionOptions.go
- FirelensLogRouterProps.go
- FirelensLogRouterType.go
- FirelensLogRouter__checks.go
- FirelensOptions.go
- FluentdLogDriver.go
- FluentdLogDriverProps.go
- FluentdLogDriver__checks.go
- GelfCompressionType.go
- GelfLogDriver.go
- GelfLogDriverProps.go
- GelfLogDriver__checks.go
- GenericLogDriver.go
- GenericLogDriverProps.go
- GenericLogDriver__checks.go
- HealthCheck.go
- Host.go
- IBaseService.go
- ICluster.go
- IEc2Service.go
- IEc2TaskDefinition.go
- IEcsLoadBalancerTarget.go
- IExternalService.go
- IExternalTaskDefinition.go
- IFargateService.go
- IFargateTaskDefinition.go
- IService.go
- ITaskDefinition.go
- ITaskDefinitionExtension.go
- ITaskDefinitionExtension__checks.go
- InferenceAccelerator.go
- IpcMode.go
- JournaldLogDriver.go
- JournaldLogDriverProps.go
- JournaldLogDriver__checks.go
- JsonFileLogDriver.go
- JsonFileLogDriverProps.go
- JsonFileLogDriver__checks.go
- LaunchType.go
- LinuxParameters.go
- LinuxParametersProps.go
- LinuxParameters__checks.go
- ListenerConfig.go
- ListenerConfig__checks.go
- LoadBalancerTargetOptions.go
- LogDriver.go
- LogDriverConfig.go
- LogDriver__checks.go
- LogDrivers.go
- LogDrivers__checks.go
- MachineImageType.go
- MemoryUtilizationScalingProps.go
- MountPoint.go
- NetworkMode.go
- OperatingSystemFamily.go
- OperatingSystemFamily__checks.go
- PidMode.go
- PlacementConstraint.go
- PlacementStrategy.go
- PlacementStrategy__checks.go
- PortMap.go
- PortMap__checks.go
- PortMapping.go
- PropagatedTagSource.go
- Protocol.go
- ProxyConfiguration.go
- ProxyConfiguration__checks.go
- ProxyConfigurations.go
- ProxyConfigurations__checks.go
- RepositoryImage.go
- RepositoryImageProps.go
- RepositoryImage__checks.go
- RequestCountScalingProps.go
- RuntimePlatform.go
- S3EnvironmentFile.go
- S3EnvironmentFile__checks.go
- ScalableTaskCount.go
- ScalableTaskCountProps.go
- ScalableTaskCount__checks.go
- Scope.go
- ScratchSpace.go
- Secret.go
- SecretVersionInfo.go
- Secret__checks.go
- ServiceConnect.go
- ServiceConnectProps.go
- ServiceConnectService.go
- ServiceConnect__checks.go
- ServiceManagedEBSVolumeConfiguration.go
- ServiceManagedVolume.go
- ServiceManagedVolumeProps.go
- ServiceManagedVolume__checks.go
- SplunkLogDriver.go
- SplunkLogDriverProps.go
- SplunkLogDriver__checks.go
- SplunkLogFormat.go
- SyslogLogDriver.go
- SyslogLogDriverProps.go
- SyslogLogDriver__checks.go
- SystemControl.go
- TagParameterContainerImage.go
- TagParameterContainerImage__checks.go
- TaskDefinition.go
- TaskDefinitionAttributes.go
- TaskDefinitionProps.go
- TaskDefinitionRevision.go
- TaskDefinitionRevision__checks.go
- TaskDefinition__checks.go
- Tmpfs.go
- TmpfsMountOption.go
- TrackCustomMetricProps.go
- Ulimit.go
- UlimitName.go
- Volume.go
- VolumeFrom.go
- WindowsOptimizedVersion.go
- main.go