Provides a resource to manage iam tag
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const foo = new volcengine.iam.Tag("foo", {
resourceNames: ["jonny"],
resourceType: "User",
tags: [
{
key: "key4",
value: "value4",
},
{
key: "key3",
value: "value3",
},
],
});
import pulumi
import pulumi_volcengine as volcengine
foo = volcengine.iam.Tag("foo",
resource_names=["jonny"],
resource_type="User",
tags=[
volcengine.iam.TagTagArgs(
key="key4",
value="value4",
),
volcengine.iam.TagTagArgs(
key="key3",
value="value3",
),
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/iam"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.NewTag(ctx, "foo", &iam.TagArgs{
ResourceNames: pulumi.StringArray{
pulumi.String("jonny"),
},
ResourceType: pulumi.String("User"),
Tags: iam.TagTagArray{
&iam.TagTagArgs{
Key: pulumi.String("key4"),
Value: pulumi.String("value4"),
},
&iam.TagTagArgs{
Key: pulumi.String("key3"),
Value: pulumi.String("value3"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var foo = new Volcengine.Iam.Tag("foo", new()
{
ResourceNames = new[]
{
"jonny",
},
ResourceType = "User",
Tags = new[]
{
new Volcengine.Iam.Inputs.TagTagArgs
{
Key = "key4",
Value = "value4",
},
new Volcengine.Iam.Inputs.TagTagArgs
{
Key = "key3",
Value = "value3",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.iam.Tag;
import com.pulumi.volcengine.iam.TagArgs;
import com.pulumi.volcengine.iam.inputs.TagTagArgs;
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) {
var foo = new Tag("foo", TagArgs.builder()
.resourceNames("jonny")
.resourceType("User")
.tags(
TagTagArgs.builder()
.key("key4")
.value("value4")
.build(),
TagTagArgs.builder()
.key("key3")
.value("value3")
.build())
.build());
}
}
resources:
foo:
type: volcengine:iam:Tag
properties:
resourceNames:
- jonny
resourceType: User
tags:
- key: key4
value: value4
- key: key3
value: value3
Create Tag Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Tag(name: string, args: TagArgs, opts?: CustomResourceOptions);@overload
def Tag(resource_name: str,
args: TagArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Tag(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_names: Optional[Sequence[str]] = None,
resource_type: Optional[str] = None,
tags: Optional[Sequence[TagTagArgs]] = None)func NewTag(ctx *Context, name string, args TagArgs, opts ...ResourceOption) (*Tag, error)public Tag(string name, TagArgs args, CustomResourceOptions? opts = null)type: volcengine:iam:Tag
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 TagArgs
- 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 TagArgs
- 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 TagArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TagArgs
- 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 volcengineTagResource = new Volcengine.Iam.Tag("volcengineTagResource", new()
{
ResourceNames = new[]
{
"string",
},
ResourceType = "string",
Tags = new[]
{
new Volcengine.Iam.Inputs.TagTagArgs
{
Key = "string",
Value = "string",
},
},
});
example, err := iam.NewTag(ctx, "volcengineTagResource", &iam.TagArgs{
ResourceNames: pulumi.StringArray{
pulumi.String("string"),
},
ResourceType: pulumi.String("string"),
Tags: iam.TagTagArray{
&iam.TagTagArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
})
var volcengineTagResource = new com.pulumi.volcengine.iam.Tag("volcengineTagResource", com.pulumi.volcengine.iam.TagArgs.builder()
.resourceNames("string")
.resourceType("string")
.tags(TagTagArgs.builder()
.key("string")
.value("string")
.build())
.build());
volcengine_tag_resource = volcengine.iam.Tag("volcengineTagResource",
resource_names=["string"],
resource_type="string",
tags=[{
"key": "string",
"value": "string",
}])
const volcengineTagResource = new volcengine.iam.Tag("volcengineTagResource", {
resourceNames: ["string"],
resourceType: "string",
tags: [{
key: "string",
value: "string",
}],
});
type: volcengine:iam:Tag
properties:
resourceNames:
- string
resourceType: string
tags:
- key: string
value: string
Tag 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 Tag resource accepts the following input properties:
- Resource
Names List<string> - The names of the resource.
- Resource
Type string - The type of the resource. Valid values: User, Role.
-
List<Tag
Tag> - Tags.
- Resource
Names []string - The names of the resource.
- Resource
Type string - The type of the resource. Valid values: User, Role.
-
[]Tag
Tag Args - Tags.
- resource
Names List<String> - The names of the resource.
- resource
Type String - The type of the resource. Valid values: User, Role.
-
List<Tag
Tag> - Tags.
- resource
Names string[] - The names of the resource.
- resource
Type string - The type of the resource. Valid values: User, Role.
-
Tag
Tag[] - Tags.
- resource_
names Sequence[str] - The names of the resource.
- resource_
type str - The type of the resource. Valid values: User, Role.
-
Sequence[Tag
Tag Args] - Tags.
- resource
Names List<String> - The names of the resource.
- resource
Type String - The type of the resource. Valid values: User, Role.
- List<Property Map>
- Tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the Tag resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Tag Resource
Get an existing Tag 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?: TagState, opts?: CustomResourceOptions): Tag@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
resource_names: Optional[Sequence[str]] = None,
resource_type: Optional[str] = None,
tags: Optional[Sequence[TagTagArgs]] = None) -> Tagfunc GetTag(ctx *Context, name string, id IDInput, state *TagState, opts ...ResourceOption) (*Tag, error)public static Tag Get(string name, Input<string> id, TagState? state, CustomResourceOptions? opts = null)public static Tag get(String name, Output<String> id, TagState state, CustomResourceOptions options)resources: _: type: volcengine:iam:Tag get: id: ${id}- 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.
- Resource
Names List<string> - The names of the resource.
- Resource
Type string - The type of the resource. Valid values: User, Role.
-
List<Tag
Tag> - Tags.
- Resource
Names []string - The names of the resource.
- Resource
Type string - The type of the resource. Valid values: User, Role.
-
[]Tag
Tag Args - Tags.
- resource
Names List<String> - The names of the resource.
- resource
Type String - The type of the resource. Valid values: User, Role.
-
List<Tag
Tag> - Tags.
- resource
Names string[] - The names of the resource.
- resource
Type string - The type of the resource. Valid values: User, Role.
-
Tag
Tag[] - Tags.
- resource_
names Sequence[str] - The names of the resource.
- resource_
type str - The type of the resource. Valid values: User, Role.
-
Sequence[Tag
Tag Args] - Tags.
- resource
Names List<String> - The names of the resource.
- resource
Type String - The type of the resource. Valid values: User, Role.
- List<Property Map>
- Tags.
Supporting Types
TagTag, TagTagArgs
Import
Iam tag can be imported using the ResourceType, ResourceName and TagKey, e.g.
$ pulumi import volcengine:iam/tag:Tag default User:jonny:key1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengineTerraform Provider.
