@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
100 lines • 3.92 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityGroupVpcAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing Security Group VPC Associations.
*
* ## Example Usage
*
* ```typescript
* 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
*
* ### Identity Schema
*
* #### Required
*
* * `vpc_id` (String) VPC ID.
*
* * `security_group_id` (String) Security Group ID.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* * `region` (String) Region where this resource is managed.
*
* Using `pulumi import`, import a Security Group VPC Association using the `security_group_id` and `vpc_id` arguments, separated by a comma (`,`). For example:
*
* console
*
* % pulumi import aws_vpc_security_group_vpc_association.example sg-12345,vpc-67890
*/
class SecurityGroupVpcAssociation extends pulumi.CustomResource {
/**
* Get an existing SecurityGroupVpcAssociation resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new SecurityGroupVpcAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecurityGroupVpcAssociation. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SecurityGroupVpcAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["region"] = state?.region;
resourceInputs["securityGroupId"] = state?.securityGroupId;
resourceInputs["state"] = state?.state;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["vpcId"] = state?.vpcId;
}
else {
const args = argsOrState;
if (args?.securityGroupId === undefined && !opts.urn) {
throw new Error("Missing required property 'securityGroupId'");
}
if (args?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["region"] = args?.region;
resourceInputs["securityGroupId"] = args?.securityGroupId;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecurityGroupVpcAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecurityGroupVpcAssociation = SecurityGroupVpcAssociation;
/** @internal */
SecurityGroupVpcAssociation.__pulumiType = 'aws:vpc/securityGroupVpcAssociation:SecurityGroupVpcAssociation';
//# sourceMappingURL=securityGroupVpcAssociation.js.map