/* * 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.CreateVpcEndpointRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#createVpcEndpoint(CreateVpcEndpointRequest) CreateVpcEndpoint operation}. *
* Creates a VPC endpoint for a specified AWS service. An endpoint * enables you to create a private connection between your VPC and * another AWS service in your account. You can specify an endpoint * policy to attach to the endpoint that will control access to the * service from your VPC. You can also specify the VPC route tables that * use the endpoint. *
** Currently, only endpoints to Amazon S3 are supported. *
* * @see com.amazonaws.services.ec2.AmazonEC2#createVpcEndpoint(CreateVpcEndpointRequest) */ public class CreateVpcEndpointRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequestcom.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*/
private String serviceName;
/**
* A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*/
private String policyDocument;
/**
* One or more route table IDs.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag
* Returns a reference to this object so that method calls can be chained together.
*
* @param vpcId The ID of the VPC in which the endpoint will be used.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withVpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
/**
* The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*
* @return The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*/
public String getServiceName() {
return serviceName;
}
/**
* The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*
* @param serviceName The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
/**
* The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param serviceName The AWS service name, in the form
* com.amazonaws.region.service
. To get a list
* of available services, use the DescribeVpcEndpointServices
* request.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withServiceName(String serviceName) {
this.serviceName = serviceName;
return this;
}
/**
* A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*
* @return A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*/
public String getPolicyDocument() {
return policyDocument;
}
/**
* A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*
* @param policyDocument A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*/
public void setPolicyDocument(String policyDocument) {
this.policyDocument = policyDocument;
}
/**
* A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param policyDocument A policy to attach to the endpoint that controls access to the
* service. The policy must be in valid JSON format. If this parameter is
* not specified, we attach a default policy that allows full access to
* the service.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withPolicyDocument(String policyDocument) {
this.policyDocument = policyDocument;
return this;
}
/**
* One or more route table IDs.
*
* @return One or more route table IDs.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param routeTableIds One or more route table IDs.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withRouteTableIds(String... routeTableIds) {
if (getRouteTableIds() == null) setRouteTableIds(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param routeTableIds One or more route table IDs.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withRouteTableIds(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param clientToken Unique, case-sensitive identifier you provide to ensure the
* idempotency of the request. For more information, see How
* to Ensure Idempotency.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateVpcEndpointRequest withClientToken(String clientToken) {
this.clientToken = clientToken;
return this;
}
/**
* This method is intended for internal use only.
* Returns the marshaled request configured with additional parameters to
* enable operation dry-run.
*/
@Override
public Request