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

aws.rds.getSubnetGroup

Explore with Pulumi AI

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

    Use this data source to get information about an RDS subnet group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const database = aws.rds.getSubnetGroup({
        name: "my-test-database-subnet-group",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    database = aws.rds.get_subnet_group(name="my-test-database-subnet-group")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rds.LookupSubnetGroup(ctx, &rds.LookupSubnetGroupArgs{
    			Name: "my-test-database-subnet-group",
    		}, nil)
    		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 database = Aws.Rds.GetSubnetGroup.Invoke(new()
        {
            Name = "my-test-database-subnet-group",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.rds.RdsFunctions;
    import com.pulumi.aws.rds.inputs.GetSubnetGroupArgs;
    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) {
            final var database = RdsFunctions.getSubnetGroup(GetSubnetGroupArgs.builder()
                .name("my-test-database-subnet-group")
                .build());
    
        }
    }
    
    variables:
      database:
        fn::invoke:
          Function: aws:rds:getSubnetGroup
          Arguments:
            name: my-test-database-subnet-group
    

    Using getSubnetGroup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSubnetGroup(args: GetSubnetGroupArgs, opts?: InvokeOptions): Promise<GetSubnetGroupResult>
    function getSubnetGroupOutput(args: GetSubnetGroupOutputArgs, opts?: InvokeOptions): Output<GetSubnetGroupResult>
    def get_subnet_group(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetSubnetGroupResult
    def get_subnet_group_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetSubnetGroupResult]
    func LookupSubnetGroup(ctx *Context, args *LookupSubnetGroupArgs, opts ...InvokeOption) (*LookupSubnetGroupResult, error)
    func LookupSubnetGroupOutput(ctx *Context, args *LookupSubnetGroupOutputArgs, opts ...InvokeOption) LookupSubnetGroupResultOutput

    > Note: This function is named LookupSubnetGroup in the Go SDK.

    public static class GetSubnetGroup 
    {
        public static Task<GetSubnetGroupResult> InvokeAsync(GetSubnetGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetSubnetGroupResult> Invoke(GetSubnetGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSubnetGroupResult> getSubnetGroup(GetSubnetGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:rds/getSubnetGroup:getSubnetGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name of the RDS database subnet group.
    Name string
    Name of the RDS database subnet group.
    name String
    Name of the RDS database subnet group.
    name string
    Name of the RDS database subnet group.
    name str
    Name of the RDS database subnet group.
    name String
    Name of the RDS database subnet group.

    getSubnetGroup Result

    The following output properties are available:

    Arn string
    ARN for the DB subnet group.
    Description string
    Provides the description of the DB subnet group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Status string
    Provides the status of the DB subnet group.
    SubnetIds List<string>
    Contains a list of subnet identifiers.
    SupportedNetworkTypes List<string>
    The network type of the DB subnet group.
    VpcId string
    Provides the VPC ID of the DB subnet group.
    Arn string
    ARN for the DB subnet group.
    Description string
    Provides the description of the DB subnet group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Status string
    Provides the status of the DB subnet group.
    SubnetIds []string
    Contains a list of subnet identifiers.
    SupportedNetworkTypes []string
    The network type of the DB subnet group.
    VpcId string
    Provides the VPC ID of the DB subnet group.
    arn String
    ARN for the DB subnet group.
    description String
    Provides the description of the DB subnet group.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    status String
    Provides the status of the DB subnet group.
    subnetIds List<String>
    Contains a list of subnet identifiers.
    supportedNetworkTypes List<String>
    The network type of the DB subnet group.
    vpcId String
    Provides the VPC ID of the DB subnet group.
    arn string
    ARN for the DB subnet group.
    description string
    Provides the description of the DB subnet group.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    status string
    Provides the status of the DB subnet group.
    subnetIds string[]
    Contains a list of subnet identifiers.
    supportedNetworkTypes string[]
    The network type of the DB subnet group.
    vpcId string
    Provides the VPC ID of the DB subnet group.
    arn str
    ARN for the DB subnet group.
    description str
    Provides the description of the DB subnet group.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    status str
    Provides the status of the DB subnet group.
    subnet_ids Sequence[str]
    Contains a list of subnet identifiers.
    supported_network_types Sequence[str]
    The network type of the DB subnet group.
    vpc_id str
    Provides the VPC ID of the DB subnet group.
    arn String
    ARN for the DB subnet group.
    description String
    Provides the description of the DB subnet group.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    status String
    Provides the status of the DB subnet group.
    subnetIds List<String>
    Contains a list of subnet identifiers.
    supportedNetworkTypes List<String>
    The network type of the DB subnet group.
    vpcId String
    Provides the VPC ID of the DB subnet group.

    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