aws.msk.VpcConnection
Explore with Pulumi AI
Resource for managing an AWS Managed Streaming for Kafka VPC Connection.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.msk.VpcConnection("test", {
authentication: "SASL_IAM",
targetClusterArn: "aws_msk_cluster.arn",
vpcId: testAwsVpc.id,
clientSubnets: testAwsSubnet.map(__item => __item.id),
securityGroups: [testAwsSecurityGroup.id],
});
import pulumi
import pulumi_aws as aws
test = aws.msk.VpcConnection("test",
authentication="SASL_IAM",
target_cluster_arn="aws_msk_cluster.arn",
vpc_id=test_aws_vpc["id"],
client_subnets=[__item["id"] for __item in test_aws_subnet],
security_groups=[test_aws_security_group["id"]])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/msk"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var splat0 []interface{}
for _, val0 := range testAwsSubnet {
splat0 = append(splat0, val0.Id)
}
_, err := msk.NewVpcConnection(ctx, "test", &msk.VpcConnectionArgs{
Authentication: pulumi.String("SASL_IAM"),
TargetClusterArn: pulumi.String("aws_msk_cluster.arn"),
VpcId: pulumi.Any(testAwsVpc.Id),
ClientSubnets: toPulumiArray(splat0),
SecurityGroups: pulumi.StringArray{
testAwsSecurityGroup.Id,
},
})
if err != nil {
return err
}
return nil
})
}
func toPulumiArray(arr []) pulumi.Array {
var pulumiArr pulumi.Array
for _, v := range arr {
pulumiArr = append(pulumiArr, pulumi.(v))
}
return pulumiArr
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Msk.VpcConnection("test", new()
{
Authentication = "SASL_IAM",
TargetClusterArn = "aws_msk_cluster.arn",
VpcId = testAwsVpc.Id,
ClientSubnets = testAwsSubnet.Select(__item => __item.Id).ToList(),
SecurityGroups = new[]
{
testAwsSecurityGroup.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.msk.VpcConnection;
import com.pulumi.aws.msk.VpcConnectionArgs;
import java.util.List;
import java.util.ArrayList;
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 test = new VpcConnection("test", VpcConnectionArgs.builder()
.authentication("SASL_IAM")
.targetClusterArn("aws_msk_cluster.arn")
.vpcId(testAwsVpc.id())
.clientSubnets(testAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.securityGroups(testAwsSecurityGroup.id())
.build());
}
}
Coming soon!
Create VpcConnection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcConnection(name: string, args: VpcConnectionArgs, opts?: CustomResourceOptions);
@overload
def VpcConnection(resource_name: str,
args: VpcConnectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpcConnection(resource_name: str,
opts: Optional[ResourceOptions] = None,
authentication: Optional[str] = None,
client_subnets: Optional[Sequence[str]] = None,
security_groups: Optional[Sequence[str]] = None,
target_cluster_arn: Optional[str] = None,
vpc_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewVpcConnection(ctx *Context, name string, args VpcConnectionArgs, opts ...ResourceOption) (*VpcConnection, error)
public VpcConnection(string name, VpcConnectionArgs args, CustomResourceOptions? opts = null)
public VpcConnection(String name, VpcConnectionArgs args)
public VpcConnection(String name, VpcConnectionArgs args, CustomResourceOptions options)
type: aws:msk:VpcConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VpcConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcConnectionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcConnectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcConnectionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var vpcConnectionResource = new Aws.Msk.VpcConnection("vpcConnectionResource", new()
{
Authentication = "string",
ClientSubnets = new[]
{
"string",
},
SecurityGroups = new[]
{
"string",
},
TargetClusterArn = "string",
VpcId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := msk.NewVpcConnection(ctx, "vpcConnectionResource", &msk.VpcConnectionArgs{
Authentication: pulumi.String("string"),
ClientSubnets: pulumi.StringArray{
pulumi.String("string"),
},
SecurityGroups: pulumi.StringArray{
pulumi.String("string"),
},
TargetClusterArn: pulumi.String("string"),
VpcId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var vpcConnectionResource = new VpcConnection("vpcConnectionResource", VpcConnectionArgs.builder()
.authentication("string")
.clientSubnets("string")
.securityGroups("string")
.targetClusterArn("string")
.vpcId("string")
.tags(Map.of("string", "string"))
.build());
vpc_connection_resource = aws.msk.VpcConnection("vpcConnectionResource",
authentication="string",
client_subnets=["string"],
security_groups=["string"],
target_cluster_arn="string",
vpc_id="string",
tags={
"string": "string",
})
const vpcConnectionResource = new aws.msk.VpcConnection("vpcConnectionResource", {
authentication: "string",
clientSubnets: ["string"],
securityGroups: ["string"],
targetClusterArn: "string",
vpcId: "string",
tags: {
string: "string",
},
});
type: aws:msk:VpcConnection
properties:
authentication: string
clientSubnets:
- string
securityGroups:
- string
tags:
string: string
targetClusterArn: string
vpcId: string
VpcConnection Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VpcConnection resource accepts the following input properties:
- Authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- Client
Subnets List<string> - The list of subnets in the client VPC to connect to.
- Security
Groups List<string> - The security groups to attach to the ENIs for the broker nodes.
- Target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- Vpc
Id string - The VPC ID of the remote client.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- Client
Subnets []string - The list of subnets in the client VPC to connect to.
- Security
Groups []string - The security groups to attach to the ENIs for the broker nodes.
- Target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- Vpc
Id string - The VPC ID of the remote client.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication String
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets List<String> - The list of subnets in the client VPC to connect to.
- security
Groups List<String> - The security groups to attach to the ENIs for the broker nodes.
- target
Cluster StringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id String - The VPC ID of the remote client.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets string[] - The list of subnets in the client VPC to connect to.
- security
Groups string[] - The security groups to attach to the ENIs for the broker nodes.
- target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id string - The VPC ID of the remote client.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication str
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client_
subnets Sequence[str] - The list of subnets in the client VPC to connect to.
- security_
groups Sequence[str] - The security groups to attach to the ENIs for the broker nodes.
- target_
cluster_ strarn - The Amazon Resource Name (ARN) of the cluster.
- vpc_
id str - The VPC ID of the remote client.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication String
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets List<String> - The list of subnets in the client VPC to connect to.
- security
Groups List<String> - The security groups to attach to the ENIs for the broker nodes.
- target
Cluster StringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id String - The VPC ID of the remote client.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcConnection resource produces the following output properties:
Look up Existing VpcConnection Resource
Get an existing VpcConnection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VpcConnectionState, opts?: CustomResourceOptions): VpcConnection
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
authentication: Optional[str] = None,
client_subnets: Optional[Sequence[str]] = None,
security_groups: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
target_cluster_arn: Optional[str] = None,
vpc_id: Optional[str] = None) -> VpcConnection
func GetVpcConnection(ctx *Context, name string, id IDInput, state *VpcConnectionState, opts ...ResourceOption) (*VpcConnection, error)
public static VpcConnection Get(string name, Input<string> id, VpcConnectionState? state, CustomResourceOptions? opts = null)
public static VpcConnection get(String name, Output<String> id, VpcConnectionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- Amazon Resource Name (ARN) of the VPC connection.
- Authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- Client
Subnets List<string> - The list of subnets in the client VPC to connect to.
- Security
Groups List<string> - The security groups to attach to the ENIs for the broker nodes.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- Vpc
Id string - The VPC ID of the remote client.
- Arn string
- Amazon Resource Name (ARN) of the VPC connection.
- Authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- Client
Subnets []string - The list of subnets in the client VPC to connect to.
- Security
Groups []string - The security groups to attach to the ENIs for the broker nodes.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- Vpc
Id string - The VPC ID of the remote client.
- arn String
- Amazon Resource Name (ARN) of the VPC connection.
- authentication String
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets List<String> - The list of subnets in the client VPC to connect to.
- security
Groups List<String> - The security groups to attach to the ENIs for the broker nodes.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Cluster StringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id String - The VPC ID of the remote client.
- arn string
- Amazon Resource Name (ARN) of the VPC connection.
- authentication string
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets string[] - The list of subnets in the client VPC to connect to.
- security
Groups string[] - The security groups to attach to the ENIs for the broker nodes.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Cluster stringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id string - The VPC ID of the remote client.
- arn str
- Amazon Resource Name (ARN) of the VPC connection.
- authentication str
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client_
subnets Sequence[str] - The list of subnets in the client VPC to connect to.
- security_
groups Sequence[str] - The security groups to attach to the ENIs for the broker nodes.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target_
cluster_ strarn - The Amazon Resource Name (ARN) of the cluster.
- vpc_
id str - The VPC ID of the remote client.
- arn String
- Amazon Resource Name (ARN) of the VPC connection.
- authentication String
- The authentication type for the client VPC connection. Specify one of these auth type strings: SASL_IAM, SASL_SCRAM, or TLS.
- client
Subnets List<String> - The list of subnets in the client VPC to connect to.
- security
Groups List<String> - The security groups to attach to the ENIs for the broker nodes.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Cluster StringArn - The Amazon Resource Name (ARN) of the cluster.
- vpc
Id String - The VPC ID of the remote client.
Import
Using pulumi import
, import MSK configurations using the configuration ARN. For example:
$ pulumi import aws:msk/vpcConnection:VpcConnection example arn:aws:kafka:eu-west-2:123456789012:vpc-connection/123456789012/example/38173259-79cd-4ee8-87f3-682ea6023f48-2
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.