com.amazonaws.services.managedgrafana.model.NetworkAccessConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-managedgrafana Show documentation
/*
* Copyright 2018-2023 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.managedgrafana.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The configuration settings for in-bound network access to your workspace.
*
*
* When this is configured, only listed IP addresses and VPC endpoints will be able to access your workspace. Standard
* Grafana authentication and authorization are still required.
*
*
* Access is granted to a caller that is in either the IP address list or the VPC endpoint list - they do not need to be
* in both.
*
*
* If this is not configured, or is removed, then all IP addresses and VPC endpoints are allowed. Standard Grafana
* authentication and authorization are still required.
*
*
*
* While both prefixListIds
and vpceIds
are required, you can pass in an empty array of
* strings for either parameter if you do not want to allow any of that type.
*
*
* If both are passed as empty arrays, no traffic is allowed to the workspace, because only explicitly allowed
* connections are accepted.
*
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NetworkAccessConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified
* are allowed to access your workspace. If the list is not included in the configuration (passed an empty array)
* then no IP addresses are allowed to access the workspace. You create a prefix list using the Amazon VPC console.
*
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using managed
* prefix listsin the Amazon Virtual Private Cloud User Guide.
*
*/
private java.util.List prefixListIds;
/**
*
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified then
* only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array of strings,
* then no VPCs are allowed to access the workspace.
*
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in the
* Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the
* com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints are ignored.
*
*
*/
private java.util.List vpceIds;
/**
*
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified
* are allowed to access your workspace. If the list is not included in the configuration (passed an empty array)
* then no IP addresses are allowed to access the workspace. You create a prefix list using the Amazon VPC console.
*
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using managed
* prefix listsin the Amazon Virtual Private Cloud User Guide.
*
*
* @return An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses
* specified are allowed to access your workspace. If the list is not included in the configuration (passed
* an empty array) then no IP addresses are allowed to access the workspace. You create a prefix list using
* the Amazon VPC console.
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using
* managed prefix listsin the Amazon Virtual Private Cloud User Guide.
*/
public java.util.List getPrefixListIds() {
return prefixListIds;
}
/**
*
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified
* are allowed to access your workspace. If the list is not included in the configuration (passed an empty array)
* then no IP addresses are allowed to access the workspace. You create a prefix list using the Amazon VPC console.
*
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using managed
* prefix listsin the Amazon Virtual Private Cloud User Guide.
*
*
* @param prefixListIds
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses
* specified are allowed to access your workspace. If the list is not included in the configuration (passed
* an empty array) then no IP addresses are allowed to access the workspace. You create a prefix list using
* the Amazon VPC console.
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using
* managed prefix listsin the Amazon Virtual Private Cloud User Guide.
*/
public void setPrefixListIds(java.util.Collection prefixListIds) {
if (prefixListIds == null) {
this.prefixListIds = null;
return;
}
this.prefixListIds = new java.util.ArrayList(prefixListIds);
}
/**
*
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified
* are allowed to access your workspace. If the list is not included in the configuration (passed an empty array)
* then no IP addresses are allowed to access the workspace. You create a prefix list using the Amazon VPC console.
*
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using managed
* prefix listsin the Amazon Virtual Private Cloud User Guide.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPrefixListIds(java.util.Collection)} or {@link #withPrefixListIds(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param prefixListIds
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses
* specified are allowed to access your workspace. If the list is not included in the configuration (passed
* an empty array) then no IP addresses are allowed to access the workspace. You create a prefix list using
* the Amazon VPC console.
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using
* managed prefix listsin the Amazon Virtual Private Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkAccessConfiguration withPrefixListIds(String... prefixListIds) {
if (this.prefixListIds == null) {
setPrefixListIds(new java.util.ArrayList(prefixListIds.length));
}
for (String ele : prefixListIds) {
this.prefixListIds.add(ele);
}
return this;
}
/**
*
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified
* are allowed to access your workspace. If the list is not included in the configuration (passed an empty array)
* then no IP addresses are allowed to access the workspace. You create a prefix list using the Amazon VPC console.
*
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using managed
* prefix listsin the Amazon Virtual Private Cloud User Guide.
*
*
* @param prefixListIds
* An array of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses
* specified are allowed to access your workspace. If the list is not included in the configuration (passed
* an empty array) then no IP addresses are allowed to access the workspace. You create a prefix list using
* the Amazon VPC console.
*
* Prefix list IDs have the format pl-1a2b3c4d
.
*
*
* For more information about prefix lists, see Group CIDR blocks using
* managed prefix listsin the Amazon Virtual Private Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkAccessConfiguration withPrefixListIds(java.util.Collection prefixListIds) {
setPrefixListIds(prefixListIds);
return this;
}
/**
*
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified then
* only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array of strings,
* then no VPCs are allowed to access the workspace.
*
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in the
* Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the
* com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints are ignored.
*
*
*
* @return An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon
* Managed Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is
* specified then only VPC endpoints specified here are allowed to access the workspace. If you pass in an
* empty array of strings, then no VPCs are allowed to access the workspace.
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in
* the Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces
* (using the com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints
* are ignored.
*
*/
public java.util.List getVpceIds() {
return vpceIds;
}
/**
*
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified then
* only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array of strings,
* then no VPCs are allowed to access the workspace.
*
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in the
* Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the
* com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints are ignored.
*
*
*
* @param vpceIds
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified
* then only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array
* of strings, then no VPCs are allowed to access the workspace.
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in
* the Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces
* (using the com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints
* are ignored.
*
*/
public void setVpceIds(java.util.Collection vpceIds) {
if (vpceIds == null) {
this.vpceIds = null;
return;
}
this.vpceIds = new java.util.ArrayList(vpceIds);
}
/**
*
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified then
* only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array of strings,
* then no VPCs are allowed to access the workspace.
*
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in the
* Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the
* com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints are ignored.
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVpceIds(java.util.Collection)} or {@link #withVpceIds(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param vpceIds
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified
* then only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array
* of strings, then no VPCs are allowed to access the workspace.
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in
* the Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces
* (using the com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints
* are ignored.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkAccessConfiguration withVpceIds(String... vpceIds) {
if (this.vpceIds == null) {
setVpceIds(new java.util.ArrayList(vpceIds.length));
}
for (String ele : vpceIds) {
this.vpceIds.add(ele);
}
return this;
}
/**
*
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified then
* only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array of strings,
* then no VPCs are allowed to access the workspace.
*
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in the
* Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the
* com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints are ignored.
*
*
*
* @param vpceIds
* An array of Amazon VPC endpoint IDs for the workspace. You can create VPC endpoints to your Amazon Managed
* Grafana workspace for access from within a VPC. If a NetworkAccessConfiguration
is specified
* then only VPC endpoints specified here are allowed to access the workspace. If you pass in an empty array
* of strings, then no VPCs are allowed to access the workspace.
*
* VPC endpoint IDs have the format vpce-1a2b3c4d
.
*
*
* For more information about creating an interface VPC endpoint, see Interface VPC endpoints in
* the Amazon Managed Grafana User Guide.
*
*
*
* The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces
* (using the com.amazonaws.[region].grafana-workspace
service endpoint). Other VPC endpoints
* are ignored.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkAccessConfiguration withVpceIds(java.util.Collection vpceIds) {
setVpceIds(vpceIds);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getPrefixListIds() != null)
sb.append("PrefixListIds: ").append(getPrefixListIds()).append(",");
if (getVpceIds() != null)
sb.append("VpceIds: ").append(getVpceIds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NetworkAccessConfiguration == false)
return false;
NetworkAccessConfiguration other = (NetworkAccessConfiguration) obj;
if (other.getPrefixListIds() == null ^ this.getPrefixListIds() == null)
return false;
if (other.getPrefixListIds() != null && other.getPrefixListIds().equals(this.getPrefixListIds()) == false)
return false;
if (other.getVpceIds() == null ^ this.getVpceIds() == null)
return false;
if (other.getVpceIds() != null && other.getVpceIds().equals(this.getVpceIds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPrefixListIds() == null) ? 0 : getPrefixListIds().hashCode());
hashCode = prime * hashCode + ((getVpceIds() == null) ? 0 : getVpceIds().hashCode());
return hashCode;
}
@Override
public NetworkAccessConfiguration clone() {
try {
return (NetworkAccessConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.managedgrafana.model.transform.NetworkAccessConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}