UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

88 lines 3.21 kB
"use strict"; // *** 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.getSecurityGroupOutput = exports.getSecurityGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * `aws.ec2.SecurityGroup` provides details about a specific Security Group. * * This resource can prove useful when a module accepts a Security Group id as * an input variable and needs to, for example, determine the id of the * VPC that the security group belongs to. * * ## Example Usage * * The following example shows how one might accept a Security Group id as a variable * and use this data source to obtain the data necessary to create a subnet. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const config = new pulumi.Config(); * const securityGroupId = config.requireObject<any>("securityGroupId"); * const selected = aws.ec2.getSecurityGroup({ * id: securityGroupId, * }); * const subnet = new aws.ec2.Subnet("subnet", { * vpcId: selected.then(selected => selected.vpcId), * cidrBlock: "10.0.1.0/24", * }); * ``` */ function getSecurityGroup(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:ec2/getSecurityGroup:getSecurityGroup", { "filters": args.filters, "id": args.id, "name": args.name, "region": args.region, "tags": args.tags, "vpcId": args.vpcId, }, opts); } exports.getSecurityGroup = getSecurityGroup; /** * `aws.ec2.SecurityGroup` provides details about a specific Security Group. * * This resource can prove useful when a module accepts a Security Group id as * an input variable and needs to, for example, determine the id of the * VPC that the security group belongs to. * * ## Example Usage * * The following example shows how one might accept a Security Group id as a variable * and use this data source to obtain the data necessary to create a subnet. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const config = new pulumi.Config(); * const securityGroupId = config.requireObject<any>("securityGroupId"); * const selected = aws.ec2.getSecurityGroup({ * id: securityGroupId, * }); * const subnet = new aws.ec2.Subnet("subnet", { * vpcId: selected.then(selected => selected.vpcId), * cidrBlock: "10.0.1.0/24", * }); * ``` */ function getSecurityGroupOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:ec2/getSecurityGroup:getSecurityGroup", { "filters": args.filters, "id": args.id, "name": args.name, "region": args.region, "tags": args.tags, "vpcId": args.vpcId, }, opts); } exports.getSecurityGroupOutput = getSecurityGroupOutput; //# sourceMappingURL=getSecurityGroup.js.map