com.aliyun.ros.cdk.ecs.Instance Maven / Gradle / Ivy
package com.aliyun.ros.cdk.ecs;
/**
* This class encapsulates and extends the ROS resource type ALIYUN::ECS::Instance
, which is used to create an Elastic Compute Service (ECS) instance.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.85.0 (build 08ee592)", date = "2024-08-22T08:56:19.906Z")
@software.amazon.jsii.Jsii(module = com.aliyun.ros.cdk.ecs.$Module.class, fqn = "@alicloud/ros-cdk-ecs.Instance")
public class Instance extends com.aliyun.ros.cdk.core.Resource {
protected Instance(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Instance(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* Param scope - scope in which this resource is defined Param id - scoped id of the resource Param props - resource properties.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
* @param enableResourcePropertyConstraint
*/
public Instance(final @org.jetbrains.annotations.NotNull com.aliyun.ros.cdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.aliyun.ros.cdk.ecs.InstanceProps props, final @org.jetbrains.annotations.Nullable java.lang.Boolean enableResourcePropertyConstraint) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required"), enableResourcePropertyConstraint });
}
/**
* Param scope - scope in which this resource is defined Param id - scoped id of the resource Param props - resource properties.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
public Instance(final @org.jetbrains.annotations.NotNull com.aliyun.ros.cdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.aliyun.ros.cdk.ecs.InstanceProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Add one or more security groups to an ECS instance.
*
* @param securityGroups Security groups or security group IDs. This parameter is required.
*/
public void addSecurityGroups(final @org.jetbrains.annotations.NotNull java.lang.Object... securityGroups) {
if (software.amazon.jsii.Configuration.getRuntimeTypeChecking()) {
final java.util.List __securityGroups__asList = java.util.Arrays.asList(securityGroups);
for (int __idx_504f7b = 0; __idx_504f7b < __securityGroups__asList.size(); __idx_504f7b++) {
final java.lang.Object __val_504f7b = __securityGroups__asList.get(__idx_504f7b);
if (
!(__val_504f7b instanceof java.lang.String)
&& !(__val_504f7b instanceof com.aliyun.ros.cdk.ecs.SecurityGroup)
) {
throw new IllegalArgumentException(
new java.lang.StringBuilder("Expected ")
.append("securityGroups").append("[").append(__idx_504f7b).append("]")
.append(" to be one of: java.lang.String, com.aliyun.ros.cdk.ecs.SecurityGroup; received ")
.append(__val_504f7b.getClass()).toString());
}
}
}
software.amazon.jsii.Kernel.call(this, "addSecurityGroups", software.amazon.jsii.NativeType.VOID, java.util.Arrays.