1. Packages
  2. Yandex
  3. API Docs
  4. LbTargetGroup
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.LbTargetGroup

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

    Creates a target group in the specified folder and adds the specified targets to it. For more information, see the official documentation.

    Example Usage

    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var foo = new Yandex.LbTargetGroup("foo", new Yandex.LbTargetGroupArgs
            {
                RegionId = "ru-central1",
                Targets = 
                {
                    new Yandex.Inputs.LbTargetGroupTargetArgs
                    {
                        Address = yandex_compute_instance.My_instance_1.Network_interface[0].Ip_address,
                        SubnetId = yandex_vpc_subnet.My_subnet.Id,
                    },
                    new Yandex.Inputs.LbTargetGroupTargetArgs
                    {
                        Address = yandex_compute_instance.My_instance_2.Network_interface[0].Ip_address,
                        SubnetId = yandex_vpc_subnet.My_subnet.Id,
                    },
                },
            });
        }
    
    }
    

    Coming soon!

    Coming soon!

    import pulumi
    import pulumi_yandex as yandex
    
    foo = yandex.LbTargetGroup("foo",
        region_id="ru-central1",
        targets=[
            yandex.LbTargetGroupTargetArgs(
                address=yandex_compute_instance["my-instance-1"]["network_interface"][0]["ip_address"],
                subnet_id=yandex_vpc_subnet["my-subnet"]["id"],
            ),
            yandex.LbTargetGroupTargetArgs(
                address=yandex_compute_instance["my-instance-2"]["network_interface"][0]["ip_address"],
                subnet_id=yandex_vpc_subnet["my-subnet"]["id"],
            ),
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const foo = new yandex.LbTargetGroup("foo", {
        regionId: "ru-central1",
        targets: [
            {
                address: yandex_compute_instance_my_instance_1.networkInterface.0.ipAddress,
                subnetId: yandex_vpc_subnet_my_subnet.id,
            },
            {
                address: yandex_compute_instance_my_instance_2.networkInterface.0.ipAddress,
                subnetId: yandex_vpc_subnet_my_subnet.id,
            },
        ],
    });
    

    Coming soon!

    Create LbTargetGroup Resource

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

    Constructor syntax

    new LbTargetGroup(name: string, args?: LbTargetGroupArgs, opts?: CustomResourceOptions);
    @overload
    def LbTargetGroup(resource_name: str,
                      args: Optional[LbTargetGroupArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def LbTargetGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      description: Optional[str] = None,
                      folder_id: Optional[str] = None,
                      labels: Optional[Mapping[str, str]] = None,
                      name: Optional[str] = None,
                      region_id: Optional[str] = None,
                      targets: Optional[Sequence[LbTargetGroupTargetArgs]] = None)
    func NewLbTargetGroup(ctx *Context, name string, args *LbTargetGroupArgs, opts ...ResourceOption) (*LbTargetGroup, error)
    public LbTargetGroup(string name, LbTargetGroupArgs? args = null, CustomResourceOptions? opts = null)
    public LbTargetGroup(String name, LbTargetGroupArgs args)
    public LbTargetGroup(String name, LbTargetGroupArgs args, CustomResourceOptions options)
    
    type: yandex:LbTargetGroup
    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 LbTargetGroupArgs
    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 LbTargetGroupArgs
    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 LbTargetGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LbTargetGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LbTargetGroupArgs
    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 lbTargetGroupResource = new Yandex.LbTargetGroup("lbTargetGroupResource", new()
    {
        Description = "string",
        FolderId = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Name = "string",
        RegionId = "string",
        Targets = new[]
        {
            new Yandex.Inputs.LbTargetGroupTargetArgs
            {
                Address = "string",
                SubnetId = "string",
            },
        },
    });
    
    example, err := yandex.NewLbTargetGroup(ctx, "lbTargetGroupResource", &yandex.LbTargetGroupArgs{
    	Description: pulumi.String("string"),
    	FolderId:    pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:     pulumi.String("string"),
    	RegionId: pulumi.String("string"),
    	Targets: yandex.LbTargetGroupTargetArray{
    		&yandex.LbTargetGroupTargetArgs{
    			Address:  pulumi.String("string"),
    			SubnetId: pulumi.String("string"),
    		},
    	},
    })
    
    var lbTargetGroupResource = new LbTargetGroup("lbTargetGroupResource", LbTargetGroupArgs.builder()
        .description("string")
        .folderId("string")
        .labels(Map.of("string", "string"))
        .name("string")
        .regionId("string")
        .targets(LbTargetGroupTargetArgs.builder()
            .address("string")
            .subnetId("string")
            .build())
        .build());
    
    lb_target_group_resource = yandex.LbTargetGroup("lbTargetGroupResource",
        description="string",
        folder_id="string",
        labels={
            "string": "string",
        },
        name="string",
        region_id="string",
        targets=[yandex.LbTargetGroupTargetArgs(
            address="string",
            subnet_id="string",
        )])
    
    const lbTargetGroupResource = new yandex.LbTargetGroup("lbTargetGroupResource", {
        description: "string",
        folderId: "string",
        labels: {
            string: "string",
        },
        name: "string",
        regionId: "string",
        targets: [{
            address: "string",
            subnetId: "string",
        }],
    });
    
    type: yandex:LbTargetGroup
    properties:
        description: string
        folderId: string
        labels:
            string: string
        name: string
        regionId: string
        targets:
            - address: string
              subnetId: string
    

    LbTargetGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The LbTargetGroup resource accepts the following input properties:

    Description string
    An optional description of the target group. Provide this property when you create the resource.
    FolderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    Labels Dictionary<string, string>
    Labels to assign to this target group. A list of key/value pairs.
    Name string
    Name of the target group. Provided by the client when the target group is created.
    RegionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    Targets List<LbTargetGroupTarget>
    A Target resource. The structure is documented below.
    Description string
    An optional description of the target group. Provide this property when you create the resource.
    FolderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    Labels map[string]string
    Labels to assign to this target group. A list of key/value pairs.
    Name string
    Name of the target group. Provided by the client when the target group is created.
    RegionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    Targets []LbTargetGroupTargetArgs
    A Target resource. The structure is documented below.
    description String
    An optional description of the target group. Provide this property when you create the resource.
    folderId String
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Map<String,String>
    Labels to assign to this target group. A list of key/value pairs.
    name String
    Name of the target group. Provided by the client when the target group is created.
    regionId String
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets List<LbTargetGroupTarget>
    A Target resource. The structure is documented below.
    description string
    An optional description of the target group. Provide this property when you create the resource.
    folderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels {[key: string]: string}
    Labels to assign to this target group. A list of key/value pairs.
    name string
    Name of the target group. Provided by the client when the target group is created.
    regionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets LbTargetGroupTarget[]
    A Target resource. The structure is documented below.
    description str
    An optional description of the target group. Provide this property when you create the resource.
    folder_id str
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Mapping[str, str]
    Labels to assign to this target group. A list of key/value pairs.
    name str
    Name of the target group. Provided by the client when the target group is created.
    region_id str
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets Sequence[LbTargetGroupTargetArgs]
    A Target resource. The structure is documented below.
    description String
    An optional description of the target group. Provide this property when you create the resource.
    folderId String
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Map<String>
    Labels to assign to this target group. A list of key/value pairs.
    name String
    Name of the target group. Provided by the client when the target group is created.
    regionId String
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets List<Property Map>
    A Target resource. The structure is documented below.

    Outputs

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

    CreatedAt string
    The target group creation timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreatedAt string
    The target group creation timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    createdAt String
    The target group creation timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    createdAt string
    The target group creation timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    created_at str
    The target group creation timestamp.
    id str
    The provider-assigned unique ID for this managed resource.
    createdAt String
    The target group creation timestamp.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing LbTargetGroup Resource

    Get an existing LbTargetGroup 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?: LbTargetGroupState, opts?: CustomResourceOptions): LbTargetGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            folder_id: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            region_id: Optional[str] = None,
            targets: Optional[Sequence[LbTargetGroupTargetArgs]] = None) -> LbTargetGroup
    func GetLbTargetGroup(ctx *Context, name string, id IDInput, state *LbTargetGroupState, opts ...ResourceOption) (*LbTargetGroup, error)
    public static LbTargetGroup Get(string name, Input<string> id, LbTargetGroupState? state, CustomResourceOptions? opts = null)
    public static LbTargetGroup get(String name, Output<String> id, LbTargetGroupState 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:
    CreatedAt string
    The target group creation timestamp.
    Description string
    An optional description of the target group. Provide this property when you create the resource.
    FolderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    Labels Dictionary<string, string>
    Labels to assign to this target group. A list of key/value pairs.
    Name string
    Name of the target group. Provided by the client when the target group is created.
    RegionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    Targets List<LbTargetGroupTarget>
    A Target resource. The structure is documented below.
    CreatedAt string
    The target group creation timestamp.
    Description string
    An optional description of the target group. Provide this property when you create the resource.
    FolderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    Labels map[string]string
    Labels to assign to this target group. A list of key/value pairs.
    Name string
    Name of the target group. Provided by the client when the target group is created.
    RegionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    Targets []LbTargetGroupTargetArgs
    A Target resource. The structure is documented below.
    createdAt String
    The target group creation timestamp.
    description String
    An optional description of the target group. Provide this property when you create the resource.
    folderId String
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Map<String,String>
    Labels to assign to this target group. A list of key/value pairs.
    name String
    Name of the target group. Provided by the client when the target group is created.
    regionId String
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets List<LbTargetGroupTarget>
    A Target resource. The structure is documented below.
    createdAt string
    The target group creation timestamp.
    description string
    An optional description of the target group. Provide this property when you create the resource.
    folderId string
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels {[key: string]: string}
    Labels to assign to this target group. A list of key/value pairs.
    name string
    Name of the target group. Provided by the client when the target group is created.
    regionId string
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets LbTargetGroupTarget[]
    A Target resource. The structure is documented below.
    created_at str
    The target group creation timestamp.
    description str
    An optional description of the target group. Provide this property when you create the resource.
    folder_id str
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Mapping[str, str]
    Labels to assign to this target group. A list of key/value pairs.
    name str
    Name of the target group. Provided by the client when the target group is created.
    region_id str
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets Sequence[LbTargetGroupTargetArgs]
    A Target resource. The structure is documented below.
    createdAt String
    The target group creation timestamp.
    description String
    An optional description of the target group. Provide this property when you create the resource.
    folderId String
    The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
    labels Map<String>
    Labels to assign to this target group. A list of key/value pairs.
    name String
    Name of the target group. Provided by the client when the target group is created.
    regionId String
    ID of the availability zone where the target group resides. The default is 'ru-central1'.
    targets List<Property Map>
    A Target resource. The structure is documented below.

    Supporting Types

    LbTargetGroupTarget, LbTargetGroupTargetArgs

    Address string
    IP address of the target.
    SubnetId string
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.
    Address string
    IP address of the target.
    SubnetId string
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.
    address String
    IP address of the target.
    subnetId String
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.
    address string
    IP address of the target.
    subnetId string
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.
    address str
    IP address of the target.
    subnet_id str
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.
    address String
    IP address of the target.
    subnetId String
    ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.

    Import

    A target group can be imported using the id of the resource, e.g.

     $ pulumi import yandex:index/lbTargetGroup:LbTargetGroup default target_group_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi