yandex.LbTargetGroup
Explore with Pulumi AI
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=[{
"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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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.
- Folder
Id 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.
- Region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- Targets
List<Lb
Target Group Target> - 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.
- Folder
Id 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.
- Region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- Targets
[]Lb
Target Group Target Args - 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.
- folder
Id 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.
- region
Id String - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- targets
List<Lb
Target Group Target> - 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.
- folder
Id 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.
- region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- targets
Lb
Target Group Target[] - 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[Lb
Target Group Target Args] - 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.
- folder
Id 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.
- region
Id 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:
- created_
at str - The target group creation timestamp.
- id str
- 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.
- Created
At string - The target group creation timestamp.
- Description string
- An optional description of the target group. Provide this property when you create the resource.
- Folder
Id 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.
- Region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- Targets
List<Lb
Target Group Target> - A Target resource. The structure is documented below.
- Created
At string - The target group creation timestamp.
- Description string
- An optional description of the target group. Provide this property when you create the resource.
- Folder
Id 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.
- Region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- Targets
[]Lb
Target Group Target Args - A Target resource. The structure is documented below.
- created
At String - The target group creation timestamp.
- description String
- An optional description of the target group. Provide this property when you create the resource.
- folder
Id 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.
- region
Id String - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- targets
List<Lb
Target Group Target> - A Target resource. The structure is documented below.
- created
At string - The target group creation timestamp.
- description string
- An optional description of the target group. Provide this property when you create the resource.
- folder
Id 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.
- region
Id string - ID of the availability zone where the target group resides. The default is 'ru-central1'.
- targets
Lb
Target Group Target[] - 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[Lb
Target Group Target Args] - A Target resource. The structure is documented below.
- created
At String - The target group creation timestamp.
- description String
- An optional description of the target group. Provide this property when you create the resource.
- folder
Id 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.
- region
Id 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
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.