Package com.pulumi.aws.lambda
Class CoreNetworkConnector
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.lambda.CoreNetworkConnector
-
public class CoreNetworkConnector extends com.pulumi.resources.CustomResourceManages an AWS Lambda Network Connector. A network connector provisions elastic network interfaces (ENIs) in the subnets you specify, routing outbound traffic from [Lambda MicroVMs](https://docs.aws.amazon.com/lambda/latest/dg/microvms-networking.html) through your VPC — for example to reach private resources, or to give MicroVM traffic a stable source IP by exiting through your NAT gateway. ## Example Usage ### Basic Usage
## Import ### Identity Schema #### Required - `arn` (String) ARN of the network connector. Using `pulumi import`, import Lambda Network Connectors using the `arn`. For example: ```sh $ pulumi import aws:lambda/coreNetworkConnector:CoreNetworkConnector example arn:aws:lambda:us-east-1:123456789012:network-connector:example ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.iam.Role; import com.pulumi.aws.iam.RoleArgs; import com.pulumi.aws.lambda.CoreNetworkConnector; import com.pulumi.aws.lambda.CoreNetworkConnectorArgs; import com.pulumi.aws.lambda.inputs.CoreNetworkConnectorConfigurationArgs; import com.pulumi.aws.lambda.inputs.CoreNetworkConnectorConfigurationVpcEgressConfigurationArgs; import com.pulumi.aws.iam.RolePolicy; import com.pulumi.aws.iam.RolePolicyArgs; import static com.pulumi.codegen.internal.Serialization.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var exampleRole = new Role("exampleRole", RoleArgs.builder() .name("example-network-connector-operator") .assumeRolePolicy(serializeJson( jsonObject( jsonProperty("Version", "2012-10-17"), jsonProperty("Statement", jsonArray(jsonObject( jsonProperty("Action", "sts:AssumeRole"), jsonProperty("Effect", "Allow"), jsonProperty("Principal", jsonObject( jsonProperty("Service", "network-connectors.lambda.amazonaws.com") )) ))) ))) .build()); var example = new CoreNetworkConnector("example", CoreNetworkConnectorArgs.builder() .configuration(CoreNetworkConnectorConfigurationArgs.builder() .vpcEgressConfiguration(CoreNetworkConnectorConfigurationVpcEgressConfigurationArgs.builder() .associatedComputeResourceTypes("MicroVm") .networkProtocol("IPv4") .subnetIds(exampleAwsSubnet.stream().map(element -> element.id()).collect(toList())) .securityGroupIds(exampleAwsSecurityGroup.id()) .build()) .build()) .name("example") .operatorRole(exampleRole.arn()) .build()); var exampleRolePolicy = new RolePolicy("exampleRolePolicy", RolePolicyArgs.builder() .name("example-network-connector-operator") .role(exampleRole.id()) .policy(serializeJson( jsonObject( jsonProperty("Version", "2012-10-17"), jsonProperty("Statement", jsonArray( jsonObject( jsonProperty("Sid", "CreateENI"), jsonProperty("Effect", "Allow"), jsonProperty("Action", "ec2:CreateNetworkInterface"), jsonProperty("Resource", jsonArray( "arn:aws:ec2:*:*:network-interface/*", "arn:aws:ec2:*:*:subnet/*", "arn:aws:ec2:*:*:security-group/*" )) ), jsonObject( jsonProperty("Sid", "TagENI"), jsonProperty("Effect", "Allow"), jsonProperty("Action", "ec2:CreateTags"), jsonProperty("Resource", "arn:aws:ec2:*:*:network-interface/*"), jsonProperty("Condition", jsonObject( jsonProperty("StringEquals", jsonObject( jsonProperty("ec2:ManagedResourceOperator", "network-connectors.lambda.amazonaws.com") )) )) ) )) ))) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description CoreNetworkConnector(java.lang.String name)CoreNetworkConnector(java.lang.String name, CoreNetworkConnectorArgs args)CoreNetworkConnector(java.lang.String name, CoreNetworkConnectorArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<CoreNetworkConnectorConfiguration>configuration()static CoreNetworkConnectorget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, CoreNetworkConnectorState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>operatorRole()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<CoreNetworkConnectorTimeouts>>timeouts()
-
-
-
Constructor Detail
-
CoreNetworkConnector
public CoreNetworkConnector(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
CoreNetworkConnector
public CoreNetworkConnector(java.lang.String name, CoreNetworkConnectorArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
CoreNetworkConnector
public CoreNetworkConnector(java.lang.String name, CoreNetworkConnectorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the network connector.
-
configuration
public com.pulumi.core.Output<CoreNetworkConnectorConfiguration> configuration()
- Returns:
- Network configuration of the connector. See `configuration` Block below.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the network connector, unique within the account and Region. Changing this forces a new resource.
-
operatorRole
public com.pulumi.core.Output<java.lang.String> operatorRole()
- Returns:
- ARN of the IAM role that the network connector service assumes to manage elastic network interfaces in your VPC. The following arguments are optional:
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
timeouts
public com.pulumi.core.Output<java.util.Optional<CoreNetworkConnectorTimeouts>> timeouts()
-
get
public static CoreNetworkConnector get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable CoreNetworkConnectorState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-