/* * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.ec2.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.AttachClassicLinkVpcRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#attachClassicLinkVpc(AttachClassicLinkVpcRequest) AttachClassicLinkVpc operation}. *
* Links an EC2-Classic instance to a ClassicLink-enabled VPC through one
* or more of the VPC's security groups. You cannot link an EC2-Classic
* instance to more than one VPC at a time. You can only link an instance
* that's in the running
state. An instance is automatically
* unlinked from a VPC when it's stopped - you can link it to the VPC
* again when you restart it.
*
* After you've linked an instance, you cannot change the VPC security * groups that are associated with it. To change the security groups, you * must first unlink the instance, and then link it again. *
** Linking your instance to a VPC is sometimes referred to as * attaching your instance. *
* * @see com.amazonaws.services.ec2.AmazonEC2#attachClassicLinkVpc(AttachClassicLinkVpcRequest) */ public class AttachClassicLinkVpcRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest* Returns a reference to this object so that method calls can be chained together. * * @param instanceId The ID of an EC2-Classic instance to link to the ClassicLink-enabled * VPC. * * @return A reference to this updated object so that method calls can be chained * together. */ public AttachClassicLinkVpcRequest withInstanceId(String instanceId) { this.instanceId = instanceId; return this; } /** * The ID of a ClassicLink-enabled VPC. * * @return The ID of a ClassicLink-enabled VPC. */ public String getVpcId() { return vpcId; } /** * The ID of a ClassicLink-enabled VPC. * * @param vpcId The ID of a ClassicLink-enabled VPC. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** * The ID of a ClassicLink-enabled VPC. *
* Returns a reference to this object so that method calls can be chained together.
*
* @param vpcId The ID of a ClassicLink-enabled VPC.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AttachClassicLinkVpcRequest withVpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
/**
* The ID of one or more of the VPC's security groups. You cannot specify
* security groups from a different VPC.
*
* @return The ID of one or more of the VPC's security groups. You cannot specify
* security groups from a different VPC.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param groups The ID of one or more of the VPC's security groups. You cannot specify
* security groups from a different VPC.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AttachClassicLinkVpcRequest withGroups(String... groups) {
if (getGroups() == null) setGroups(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param groups The ID of one or more of the VPC's security groups. You cannot specify
* security groups from a different VPC.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AttachClassicLinkVpcRequest withGroups(java.util.Collection