CfnFleet L1 construct
The AWS::AppStream::Fleet resource creates a fleet for Amazon AppStream 2.0. A fleet consists of streaming instances that run a specified image when using Always-On or On-Demand.
Example
const fleet = new appstream.CfnFleet(this, 'Fleet', {
instanceType: 'stream.standard.small',
name: 'Fleet',
computeCapacity: {
desiredInstances: 1,
},
imageName: 'AppStream-AmazonLinux2-09-21-2022',
});
fleet.cfnOptions.creationPolicy = {
startFleet: true,
};
from aws_cdk import CfnCreationPolicy
fleet = appstream.CfnFleet(self, "Fleet",
instance_type="stream.standard.small",
name="Fleet",
compute_capacity=appstream.CfnFleet.ComputeCapacityProperty(
desired_instances=1
),
image_name="AppStream-AmazonLinux2-09-21-2022"
)
fleet.cfn_options.creation_policy = CfnCreationPolicy(
start_fleet=True
)
CfnFleet fleet = CfnFleet.Builder.create(this, "Fleet")
.instanceType("stream.standard.small")
.name("Fleet")
.computeCapacity(ComputeCapacityProperty.builder()
.desiredInstances(1)
.build())
.imageName("AppStream-AmazonLinux2-09-21-2022")
.build();
fleet.getCfnOptions().getCreationPolicy() = CfnCreationPolicy.builder()
.startFleet(true)
.build();
// Install: dotnet add package Amazon.CDK.Lib
var fleet = new CfnFleet(this, "Fleet", new CfnFleetProps {
InstanceType = "stream.standard.small",
Name = "Fleet",
ComputeCapacity = new ComputeCapacityProperty {
DesiredInstances = 1
},
ImageName = "AppStream-AmazonLinux2-09-21-2022"
});
fleet.CfnOptions.CreationPolicy = new CfnCreationPolicy {
StartFleet = true
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
fleet := appstream.NewCfnFleet(this, jsii.String("Fleet"), &CfnFleetProps{
InstanceType: jsii.String("stream.standard.small"),
Name: jsii.String("Fleet"),
ComputeCapacity: &ComputeCapacityProperty{
DesiredInstances: jsii.Number(1),
},
ImageName: jsii.String("AppStream-AmazonLinux2-09-21-2022"),
})
fleet.CfnOptions.CreationPolicy = &CfnCreationPolicy{
StartFleet: jsii.Boolean(true),
}
Initializer
new CfnFleet(scope: Construct, id: string, props: CfnFleetProps)
CfnFleet(scope: Construct, id: str, props: CfnFleetProps)
new CfnFleet(Construct scope, String id, CfnFleetProps props)
new CfnFleet(Construct scope, string id, CfnFleetProps props)
NewCfnFleet(Scope Construct, Id *string, Props CfnFleetProps)
Construct Props
attributesToDeleteoptionalstring[]attributes_to_deleteoptionaltyping.List[str]attributesToDeleteoptionalList<String>AttributesToDeleteoptionalstring[]AttributesToDeleteoptional*[]*string#computeCapacityoptionalIResolvable | CfnFleet.ComputeCapacityPropertycompute_capacityoptionaltyping.Union[IResolvable, ComputeCapacityProperty]computeCapacityoptionalIResolvableComputeCapacityoptionalIResolvableComputeCapacityoptionalinterface{}#This is not allowed for Elastic fleets.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#disableImdsv1optionalboolean | IResolvabledisable_imdsv1optionaltyping.Union[bool, IResolvable]disableImdsv1optionalBooleanDisableImdsv1optionalboolDisableImdsv1optionalinterface{}#disconnectTimeoutInSecondsoptionalnumberdisconnect_timeout_in_secondsoptionalint | floatdisconnectTimeoutInSecondsoptionalNumberDisconnectTimeoutInSecondsoptionaldoubleDisconnectTimeoutInSecondsoptional*float64#notes
If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance.
Specify a value between 60 and 36000.
displayNameoptionalstringdisplay_nameoptionalstrdisplayNameoptionalStringDisplayNameoptionalstringDisplayNameoptional*string#domainJoinInfooptionalIResolvable | CfnFleet.DomainJoinInfoPropertydomain_join_infooptionaltyping.Union[IResolvable, DomainJoinInfoProperty]domainJoinInfooptionalIResolvableDomainJoinInfooptionalIResolvableDomainJoinInfooptionalinterface{}#This is not allowed for Elastic fleets.
enableDefaultInternetAccessoptionalboolean | IResolvableenable_default_internet_accessoptionaltyping.Union[bool, IResolvable]enableDefaultInternetAccessoptionalBooleanEnableDefaultInternetAccessoptionalboolEnableDefaultInternetAccessoptionalinterface{}#fleetTypeoptionalstringfleet_typeoptionalstrfleetTypeoptionalStringFleetTypeoptionalstringFleetTypeoptional*string#notes
- ALWAYS_ON - Provides users with instant-on access to their apps. You are charged for all running instances in your fleet, even if no users are streaming apps.
- ON_DEMAND - Provide users with access to applications after they connect, which takes one to two minutes. You are charged for instance streaming when users are connected and a small hourly fee for instances that are not streaming apps.
- ELASTIC - The pool of streaming instances is managed by Amazon AppStream 2.0. When a user selects their application or desktop to launch, they will start streaming after the app block has been downloaded and mounted to a streaming instance.
Allowed Values : ALWAYS_ON | ELASTIC | ON_DEMAND
iamRoleArnoptionalstringiam_role_arnoptionalstriamRoleArnoptionalStringIamRoleArnoptionalstringIamRoleArnoptional*string#notes
To assume a role, the fleet instance calls the Security Token Service AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.
For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide .
idleDisconnectTimeoutInSecondsoptionalnumberidle_disconnect_timeout_in_secondsoptionalint | floatidleDisconnectTimeoutInSecondsoptionalNumberIdleDisconnectTimeoutInSecondsoptionaldoubleIdleDisconnectTimeoutInSecondsoptional*float64#notes
Users are notified before they are disconnected due to inactivity. If they try to reconnect to the streaming session before the time interval specified in DisconnectTimeoutInSeconds elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in IdleDisconnectTimeoutInSeconds elapses, they are disconnected.
To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 36000.
If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don't do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity.
imageArnoptionalstringimage_arnoptionalstrimageArnoptionalStringImageArnoptionalstringImageArnoptional*string#imageNameoptionalstringimage_nameoptionalstrimageNameoptionalStringImageNameoptionalstringImageNameoptional*string#notes
- stream.standard.small
- stream.standard.medium
- stream.standard.large
- stream.compute.large
- stream.compute.xlarge
- stream.compute.2xlarge
- stream.compute.4xlarge
- stream.compute.8xlarge
- stream.memory.large
- stream.memory.xlarge
- stream.memory.2xlarge
- stream.memory.4xlarge
- stream.memory.8xlarge
- stream.memory.z1d.large
- stream.memory.z1d.xlarge
- stream.memory.z1d.2xlarge
- stream.memory.z1d.3xlarge
- stream.memory.z1d.6xlarge
- stream.memory.z1d.12xlarge
- stream.graphics-design.large
- stream.graphics-design.xlarge
- stream.graphics-design.2xlarge
- stream.graphics-design.4xlarge
- stream.graphics.g4dn.xlarge
- stream.graphics.g4dn.2xlarge
- stream.graphics.g4dn.4xlarge
- stream.graphics.g4dn.8xlarge
- stream.graphics.g4dn.12xlarge
- stream.graphics.g4dn.16xlarge
- stream.graphics.g5.xlarge
- stream.graphics.g5.2xlarge
- stream.graphics.g5.4xlarge
- stream.graphics.g5.8xlarge
- stream.graphics.g5.16xlarge
- stream.graphics.g5.12xlarge
- stream.graphics.g5.24xlarge
- stream.graphics.g6.xlarge
- stream.graphics.g6.2xlarge
- stream.graphics.g6.4xlarge
- stream.graphics.g6.8xlarge
- stream.graphics.g6.16xlarge
- stream.graphics.g6.12xlarge
- stream.graphics.g6.24xlarge
- stream.graphics.gr6.4xlarge
- stream.graphics.gr6.8xlarge
- stream.graphics.g6f.large
- stream.graphics.g6f.xlarge
- stream.graphics.g6f.2xlarge
- stream.graphics.g6f.4xlarge
- stream.graphics.gr6f.4xlarge
The following instance types are available for Elastic fleets:
- stream.standard.small
- stream.standard.medium
maxConcurrentSessionsoptionalnumbermax_concurrent_sessionsoptionalint | floatmaxConcurrentSessionsoptionalNumberMaxConcurrentSessionsoptionaldoubleMaxConcurrentSessionsoptional*float64#This setting is required for Elastic fleets, but is not used for other fleet types.
maxSessionsPerInstanceoptionalnumbermax_sessions_per_instanceoptionalint | floatmaxSessionsPerInstanceoptionalNumberMaxSessionsPerInstanceoptionaldoubleMaxSessionsPerInstanceoptional*float64#This is applicable only for multi-session fleets.
maxUserDurationInSecondsoptionalnumbermax_user_duration_in_secondsoptionalint | floatmaxUserDurationInSecondsoptionalNumberMaxUserDurationInSecondsoptionaldoubleMaxUserDurationInSecondsoptional*float64#notes
If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance.
Specify a value between 600 and 432000.
platformoptionalstringplatformoptionalstrplatformoptionalStringPlatformoptionalstringPlatformoptional*string#Platform is a required setting for Elastic fleets, and is not used for other fleet types.
rootVolumeConfigoptionalIResolvable | CfnFleet.VolumeConfigPropertyroot_volume_configoptionaltyping.Union[IResolvable, VolumeConfigProperty]rootVolumeConfigoptionalIResolvableRootVolumeConfigoptionalIResolvableRootVolumeConfigoptionalinterface{}#sessionScriptS3LocationoptionalIResolvable | CfnFleet.S3LocationPropertysession_script_s3_locationoptionaltyping.Union[IResolvable, S3LocationProperty]sessionScriptS3LocationoptionalIResolvableSessionScriptS3LocationoptionalIResolvableSessionScriptS3Locationoptionalinterface{}#This only applies to Elastic fleets.
streamViewoptionalstringstream_viewoptionalstrstreamViewoptionalStringStreamViewoptionalstringStreamViewoptional*string#When APP is specified, only the windows of applications opened by users display. When DESKTOP is specified, the standard desktop that is provided by the operating system displays.
The default value is APP .
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#usbDeviceFilterStringsoptionalstring[]usb_device_filter_stringsoptionaltyping.List[str]usbDeviceFilterStringsoptionalList<String>UsbDeviceFilterStringsoptionalstring[]UsbDeviceFilterStringsoptional*[]*string#This is allowed but not required for Elastic fleets.
vpcConfigoptionalIResolvable | CfnFleet.VpcConfigPropertyvpc_configoptionaltyping.Union[IResolvable, VpcConfigProperty]vpcConfigoptionalIResolvableVpcConfigoptionalIResolvableVpcConfigoptionalinterface{}#This is required for Elastic fleets, but not required for other fleet types.
Properties
attributesToDeletemay be undefinedstring[]attributes_to_deletemay be undefinedtyping.List[str]attributesToDeletemay be undefinedList<String>AttributesToDeletemay be undefinedstring[]AttributesToDeletemay be undefined*[]*string#CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringstatic#cfnOptionsICfnResourceOptionscfn_optionsICfnResourceOptionscfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptions#cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string#computeCapacitymay be undefinedIResolvable | CfnFleet.ComputeCapacityPropertycompute_capacitymay be undefinedtyping.Union[IResolvable, ComputeCapacityProperty]computeCapacitymay be undefinedIResolvableComputeCapacitymay be undefinedIResolvableComputeCapacitymay be undefinedinterface{}#creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string#descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#disableImdsv1may be undefinedboolean | IResolvabledisable_imdsv1may be undefinedtyping.Union[bool, IResolvable]disableImdsv1may be undefinedBooleanDisableImdsv1may be undefinedboolDisableImdsv1may be undefinedinterface{}#disconnectTimeoutInSecondsmay be undefinednumberdisconnect_timeout_in_secondsmay be undefinedint | floatdisconnectTimeoutInSecondsmay be undefinedNumberDisconnectTimeoutInSecondsmay be undefineddoubleDisconnectTimeoutInSecondsmay be undefined*float64#displayNamemay be undefinedstringdisplay_namemay be undefinedstrdisplayNamemay be undefinedStringDisplayNamemay be undefinedstringDisplayNamemay be undefined*string#domainJoinInfomay be undefinedIResolvable | CfnFleet.DomainJoinInfoPropertydomain_join_infomay be undefinedtyping.Union[IResolvable, DomainJoinInfoProperty]domainJoinInfomay be undefinedIResolvableDomainJoinInfomay be undefinedIResolvableDomainJoinInfomay be undefinedinterface{}#enableDefaultInternetAccessmay be undefinedboolean | IResolvableenable_default_internet_accessmay be undefinedtyping.Union[bool, IResolvable]enableDefaultInternetAccessmay be undefinedBooleanEnableDefaultInternetAccessmay be undefinedboolEnableDefaultInternetAccessmay be undefinedinterface{}#fleetRefFleetReferencefleet_refFleetReferencefleetRefFleetReferenceFleetRefFleetReferenceFleetRefFleetReference#fleetTypemay be undefinedstringfleet_typemay be undefinedstrfleetTypemay be undefinedStringFleetTypemay be undefinedstringFleetTypemay be undefined*string#iamRoleArnmay be undefinedstringiam_role_arnmay be undefinedstriamRoleArnmay be undefinedStringIamRoleArnmay be undefinedstringIamRoleArnmay be undefined*string#idleDisconnectTimeoutInSecondsmay be undefinednumberidle_disconnect_timeout_in_secondsmay be undefinedint | floatidleDisconnectTimeoutInSecondsmay be undefinedNumberIdleDisconnectTimeoutInSecondsmay be undefineddoubleIdleDisconnectTimeoutInSecondsmay be undefined*float64#imageArnmay be undefinedstringimage_arnmay be undefinedstrimageArnmay be undefinedStringImageArnmay be undefinedstringImageArnmay be undefined*string#imageNamemay be undefinedstringimage_namemay be undefinedstrimageNamemay be undefinedStringImageNamemay be undefinedstringImageNamemay be undefined*string#The following instance types are available for non-Elastic fleets:.
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).
maxConcurrentSessionsmay be undefinednumbermax_concurrent_sessionsmay be undefinedint | floatmaxConcurrentSessionsmay be undefinedNumberMaxConcurrentSessionsmay be undefineddoubleMaxConcurrentSessionsmay be undefined*float64#maxSessionsPerInstancemay be undefinednumbermax_sessions_per_instancemay be undefinedint | floatmaxSessionsPerInstancemay be undefinedNumberMaxSessionsPerInstancemay be undefineddoubleMaxSessionsPerInstancemay be undefined*float64#maxUserDurationInSecondsmay be undefinednumbermax_user_duration_in_secondsmay be undefinedint | floatmaxUserDurationInSecondsmay be undefinedNumberMaxUserDurationInSecondsmay be undefineddoubleMaxUserDurationInSecondsmay be undefined*float64#platformmay be undefinedstringplatformmay be undefinedstrplatformmay be undefinedStringPlatformmay be undefinedstringPlatformmay be undefined*string#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 }).
rootVolumeConfigmay be undefinedIResolvable | CfnFleet.VolumeConfigPropertyroot_volume_configmay be undefinedtyping.Union[IResolvable, VolumeConfigProperty]rootVolumeConfigmay be undefinedIResolvableRootVolumeConfigmay be undefinedIResolvableRootVolumeConfigmay be undefinedinterface{}#sessionScriptS3Locationmay be undefinedIResolvable | CfnFleet.S3LocationPropertysession_script_s3_locationmay be undefinedtyping.Union[IResolvable, S3LocationProperty]sessionScriptS3Locationmay be undefinedIResolvableSessionScriptS3Locationmay be undefinedIResolvableSessionScriptS3Locationmay be undefinedinterface{}#CfnElements must be defined within a stack scope (directly or indirectly).
streamViewmay be undefinedstringstream_viewmay be undefinedstrstreamViewmay be undefinedStringStreamViewmay be undefinedstringStreamViewmay be undefined*string#tagsRawmay be undefinedCfnTag[]tags_rawmay be undefinedtyping.List[CfnTag]tagsRawmay be undefinedList<CfnTag>TagsRawmay be undefinedCfnTag[]TagsRawmay be undefined*[]CfnTag#usbDeviceFilterStringsmay be undefinedstring[]usb_device_filter_stringsmay be undefinedtyping.List[str]usbDeviceFilterStringsmay be undefinedList<String>UsbDeviceFilterStringsmay be undefinedstring[]UsbDeviceFilterStringsmay be undefined*[]*string#vpcConfigmay be undefinedIResolvable | CfnFleet.VpcConfigPropertyvpc_configmay be undefinedtyping.Union[IResolvable, VpcConfigProperty]vpcConfigmay be undefinedIResolvableVpcConfigmay be undefinedIResolvableVpcConfigmay be undefinedinterface{}#Methods
addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#1 parameter
Parameters
pathpathpathpathPath— The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.
addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.
addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#notes · 2 parameters
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,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"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.
Parameters
pathpathpathpathPath— - The path of the property, you can use dot notation to override values in complex types.valuevaluevaluevalueValue— - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#1 parameter
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#Syntactic sugar for addOverride("Properties.<...>", value).
2 parameters
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path of the property.valuevaluevaluevalueValue— The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.
1 parameter
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#notes
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:
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#fromFleetArn(scope: Construct, id: string, arn: string): IFleetRef@staticmethod def from_fleet_arn(scope: Construct, id: str, arn: str) -> IFleetRefpublic static IFleetRef fromFleetArn(Construct scope, String id, String arn)public static IFleetRef FromFleetArn(Construct scope, string id, string arn)func FromFleetArn(Scope Construct, Id *string, Arn *string) IFleetRefstatic#fromFleetName(scope: Construct, id: string, fleetName: string): IFleetRef@staticmethod def from_fleet_name(scope: Construct, id: str, fleet_name: str) -> IFleetRefpublic static IFleetRef fromFleetName(Construct scope, String id, String fleetName)public static IFleetRef FromFleetName(Construct scope, string id, string fleetName)func FromFleetName(Scope Construct, Id *string, FleetName *string) IFleetRefstatic#getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#1 parameter
Parameters
inspectorinspectorinspectorinspectorInspector— tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.
returns
Returns: The construct as a stack element or undefined if it is not a stack element.
isCfnFleet(x: any): boolean@staticmethod def is_cfn_fleet(x: Any) -> boolpublic static Boolean isCfnFleet(Object x)public static bool IsCfnFleet(object x)func IsCfnFleet(X interface{}) *boolstatic#isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
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.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.
overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#1 parameter
Parameters
newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId— The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#2 parameters
Parameters
targettargettargettargetTarget— The dependency to replace.newTargetnew_targetnewTargetnewTargetNewTarget— The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#returns
Returns: a string representation of this resource
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.