1. Packages
  2. AWS
  3. API Docs
  4. vpc
  5. SecurityGroupVpcAssociation
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.vpc.SecurityGroupVpcAssociation

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Resource for managing Security Group VPC Associations.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.vpc.SecurityGroupVpcAssociation("example", {
        securityGroupId: "sg-05f1f54ab49bb39a3",
        vpcId: "vpc-01df9d105095412ba",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.vpc.SecurityGroupVpcAssociation("example",
        security_group_id="sg-05f1f54ab49bb39a3",
        vpc_id="vpc-01df9d105095412ba")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpc.NewSecurityGroupVpcAssociation(ctx, "example", &vpc.SecurityGroupVpcAssociationArgs{
    			SecurityGroupId: pulumi.String("sg-05f1f54ab49bb39a3"),
    			VpcId:           pulumi.String("vpc-01df9d105095412ba"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Vpc.SecurityGroupVpcAssociation("example", new()
        {
            SecurityGroupId = "sg-05f1f54ab49bb39a3",
            VpcId = "vpc-01df9d105095412ba",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.vpc.SecurityGroupVpcAssociation;
    import com.pulumi.aws.vpc.SecurityGroupVpcAssociationArgs;
    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 example = new SecurityGroupVpcAssociation("example", SecurityGroupVpcAssociationArgs.builder()
                .securityGroupId("sg-05f1f54ab49bb39a3")
                .vpcId("vpc-01df9d105095412ba")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:vpc:SecurityGroupVpcAssociation
        properties:
          securityGroupId: sg-05f1f54ab49bb39a3
          vpcId: vpc-01df9d105095412ba
    

    Create SecurityGroupVpcAssociation Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SecurityGroupVpcAssociation(name: string, args: SecurityGroupVpcAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityGroupVpcAssociation(resource_name: str,
                                    args: SecurityGroupVpcAssociationArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityGroupVpcAssociation(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    security_group_id: Optional[str] = None,
                                    vpc_id: Optional[str] = None,
                                    timeouts: Optional[SecurityGroupVpcAssociationTimeoutsArgs] = None)
    func NewSecurityGroupVpcAssociation(ctx *Context, name string, args SecurityGroupVpcAssociationArgs, opts ...ResourceOption) (*SecurityGroupVpcAssociation, error)
    public SecurityGroupVpcAssociation(string name, SecurityGroupVpcAssociationArgs args, CustomResourceOptions? opts = null)
    public SecurityGroupVpcAssociation(String name, SecurityGroupVpcAssociationArgs args)
    public SecurityGroupVpcAssociation(String name, SecurityGroupVpcAssociationArgs args, CustomResourceOptions options)
    
    type: aws:vpc:SecurityGroupVpcAssociation
    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 SecurityGroupVpcAssociationArgs
    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 SecurityGroupVpcAssociationArgs
    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 SecurityGroupVpcAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityGroupVpcAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityGroupVpcAssociationArgs
    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 securityGroupVpcAssociationResource = new Aws.Vpc.SecurityGroupVpcAssociation("securityGroupVpcAssociationResource", new()
    {
        SecurityGroupId = "string",
        VpcId = "string",
        Timeouts = new Aws.Vpc.Inputs.SecurityGroupVpcAssociationTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := vpc.NewSecurityGroupVpcAssociation(ctx, "securityGroupVpcAssociationResource", &vpc.SecurityGroupVpcAssociationArgs{
    	SecurityGroupId: pulumi.String("string"),
    	VpcId:           pulumi.String("string"),
    	Timeouts: &vpc.SecurityGroupVpcAssociationTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    })
    
    var securityGroupVpcAssociationResource = new SecurityGroupVpcAssociation("securityGroupVpcAssociationResource", SecurityGroupVpcAssociationArgs.builder()
        .securityGroupId("string")
        .vpcId("string")
        .timeouts(SecurityGroupVpcAssociationTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    security_group_vpc_association_resource = aws.vpc.SecurityGroupVpcAssociation("securityGroupVpcAssociationResource",
        security_group_id="string",
        vpc_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const securityGroupVpcAssociationResource = new aws.vpc.SecurityGroupVpcAssociation("securityGroupVpcAssociationResource", {
        securityGroupId: "string",
        vpcId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: aws:vpc:SecurityGroupVpcAssociation
    properties:
        securityGroupId: string
        timeouts:
            create: string
            delete: string
        vpcId: string
    

    SecurityGroupVpcAssociation 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 SecurityGroupVpcAssociation resource accepts the following input properties:

    SecurityGroupId string
    The ID of the security group.
    VpcId string
    The ID of the VPC to make the association with.
    Timeouts SecurityGroupVpcAssociationTimeouts
    SecurityGroupId string
    The ID of the security group.
    VpcId string
    The ID of the VPC to make the association with.
    Timeouts SecurityGroupVpcAssociationTimeoutsArgs
    securityGroupId String
    The ID of the security group.
    vpcId String
    The ID of the VPC to make the association with.
    timeouts SecurityGroupVpcAssociationTimeouts
    securityGroupId string
    The ID of the security group.
    vpcId string
    The ID of the VPC to make the association with.
    timeouts SecurityGroupVpcAssociationTimeouts
    security_group_id str
    The ID of the security group.
    vpc_id str
    The ID of the VPC to make the association with.
    timeouts SecurityGroupVpcAssociationTimeoutsArgs
    securityGroupId String
    The ID of the security group.
    vpcId String
    The ID of the VPC to make the association with.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecurityGroupVpcAssociation resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    State of the VPC association. See the AWS documentation for possible values.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    State of the VPC association. See the AWS documentation for possible values.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    State of the VPC association. See the AWS documentation for possible values.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    State of the VPC association. See the AWS documentation for possible values.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    State of the VPC association. See the AWS documentation for possible values.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    State of the VPC association. See the AWS documentation for possible values.

    Look up Existing SecurityGroupVpcAssociation Resource

    Get an existing SecurityGroupVpcAssociation 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?: SecurityGroupVpcAssociationState, opts?: CustomResourceOptions): SecurityGroupVpcAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            security_group_id: Optional[str] = None,
            state: Optional[str] = None,
            timeouts: Optional[SecurityGroupVpcAssociationTimeoutsArgs] = None,
            vpc_id: Optional[str] = None) -> SecurityGroupVpcAssociation
    func GetSecurityGroupVpcAssociation(ctx *Context, name string, id IDInput, state *SecurityGroupVpcAssociationState, opts ...ResourceOption) (*SecurityGroupVpcAssociation, error)
    public static SecurityGroupVpcAssociation Get(string name, Input<string> id, SecurityGroupVpcAssociationState? state, CustomResourceOptions? opts = null)
    public static SecurityGroupVpcAssociation get(String name, Output<String> id, SecurityGroupVpcAssociationState 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.
    The following state arguments are supported:
    SecurityGroupId string
    The ID of the security group.
    State string
    State of the VPC association. See the AWS documentation for possible values.
    Timeouts SecurityGroupVpcAssociationTimeouts
    VpcId string
    The ID of the VPC to make the association with.
    SecurityGroupId string
    The ID of the security group.
    State string
    State of the VPC association. See the AWS documentation for possible values.
    Timeouts SecurityGroupVpcAssociationTimeoutsArgs
    VpcId string
    The ID of the VPC to make the association with.
    securityGroupId String
    The ID of the security group.
    state String
    State of the VPC association. See the AWS documentation for possible values.
    timeouts SecurityGroupVpcAssociationTimeouts
    vpcId String
    The ID of the VPC to make the association with.
    securityGroupId string
    The ID of the security group.
    state string
    State of the VPC association. See the AWS documentation for possible values.
    timeouts SecurityGroupVpcAssociationTimeouts
    vpcId string
    The ID of the VPC to make the association with.
    security_group_id str
    The ID of the security group.
    state str
    State of the VPC association. See the AWS documentation for possible values.
    timeouts SecurityGroupVpcAssociationTimeoutsArgs
    vpc_id str
    The ID of the VPC to make the association with.
    securityGroupId String
    The ID of the security group.
    state String
    State of the VPC association. See the AWS documentation for possible values.
    timeouts Property Map
    vpcId String
    The ID of the VPC to make the association with.

    Supporting Types

    SecurityGroupVpcAssociationTimeouts, SecurityGroupVpcAssociationTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.

    Import

    Using pulumi import, import a Security Group VPC Association using the security_group_id and vpc_id arguments, separated by a comma (,). For example:

    $ pulumi import aws:vpc/securityGroupVpcAssociation:SecurityGroupVpcAssociation example sg-12345,vpc-67890
    

    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.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi