Documentation
¶
Index ¶
- type GetMetaTagsArgs
- type GetMetaTagsOutputArgs
- type GetMetaTagsResult
- type GetMetaTagsResultOutput
- func (GetMetaTagsResultOutput) ElementType() reflect.Type
- func (o GetMetaTagsResultOutput) Id() pulumi.StringOutput
- func (o GetMetaTagsResultOutput) KeyName() pulumi.StringPtrOutput
- func (o GetMetaTagsResultOutput) OutputFile() pulumi.StringPtrOutput
- func (o GetMetaTagsResultOutput) Tags() GetMetaTagsTagArrayOutput
- func (o GetMetaTagsResultOutput) ToGetMetaTagsResultOutput() GetMetaTagsResultOutput
- func (o GetMetaTagsResultOutput) ToGetMetaTagsResultOutputWithContext(ctx context.Context) GetMetaTagsResultOutput
- type GetMetaTagsTag
- type GetMetaTagsTagArgs
- type GetMetaTagsTagArray
- type GetMetaTagsTagArrayInput
- type GetMetaTagsTagArrayOutput
- func (GetMetaTagsTagArrayOutput) ElementType() reflect.Type
- func (o GetMetaTagsTagArrayOutput) Index(i pulumi.IntInput) GetMetaTagsTagOutput
- func (o GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutput() GetMetaTagsTagArrayOutput
- func (o GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutputWithContext(ctx context.Context) GetMetaTagsTagArrayOutput
- type GetMetaTagsTagInput
- type GetMetaTagsTagOutput
- func (o GetMetaTagsTagOutput) Category() pulumi.StringOutput
- func (GetMetaTagsTagOutput) ElementType() reflect.Type
- func (o GetMetaTagsTagOutput) KeyName() pulumi.StringOutput
- func (o GetMetaTagsTagOutput) ToGetMetaTagsTagOutput() GetMetaTagsTagOutput
- func (o GetMetaTagsTagOutput) ToGetMetaTagsTagOutputWithContext(ctx context.Context) GetMetaTagsTagOutput
- func (o GetMetaTagsTagOutput) ValueName() pulumi.StringOutput
- type MetaTag
- type MetaTagArgs
- type MetaTagArray
- type MetaTagArrayInput
- type MetaTagArrayOutput
- type MetaTagInput
- type MetaTagMap
- type MetaTagMapInput
- type MetaTagMapOutput
- type MetaTagOutput
- type MetaTagState
- type Policy
- type PolicyArgs
- type PolicyArray
- type PolicyArrayInput
- type PolicyArrayOutput
- type PolicyAttachment
- type PolicyAttachmentArgs
- type PolicyAttachmentArray
- type PolicyAttachmentArrayInput
- type PolicyAttachmentArrayOutput
- func (PolicyAttachmentArrayOutput) ElementType() reflect.Type
- func (o PolicyAttachmentArrayOutput) Index(i pulumi.IntInput) PolicyAttachmentOutput
- func (o PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutput() PolicyAttachmentArrayOutput
- func (o PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutputWithContext(ctx context.Context) PolicyAttachmentArrayOutput
- type PolicyAttachmentInput
- type PolicyAttachmentMap
- type PolicyAttachmentMapInput
- type PolicyAttachmentMapOutput
- func (PolicyAttachmentMapOutput) ElementType() reflect.Type
- func (o PolicyAttachmentMapOutput) MapIndex(k pulumi.StringInput) PolicyAttachmentOutput
- func (o PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutput() PolicyAttachmentMapOutput
- func (o PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutputWithContext(ctx context.Context) PolicyAttachmentMapOutput
- type PolicyAttachmentOutput
- func (PolicyAttachmentOutput) ElementType() reflect.Type
- func (o PolicyAttachmentOutput) PolicyId() pulumi.StringOutput
- func (o PolicyAttachmentOutput) TargetId() pulumi.StringOutput
- func (o PolicyAttachmentOutput) TargetType() pulumi.StringOutput
- func (o PolicyAttachmentOutput) ToPolicyAttachmentOutput() PolicyAttachmentOutput
- func (o PolicyAttachmentOutput) ToPolicyAttachmentOutputWithContext(ctx context.Context) PolicyAttachmentOutput
- type PolicyAttachmentState
- type PolicyInput
- type PolicyMap
- type PolicyMapInput
- type PolicyMapOutput
- type PolicyOutput
- func (PolicyOutput) ElementType() reflect.Type
- func (o PolicyOutput) PolicyContent() pulumi.StringOutput
- func (o PolicyOutput) PolicyDesc() pulumi.StringPtrOutput
- func (o PolicyOutput) PolicyName() pulumi.StringOutput
- func (o PolicyOutput) ToPolicyOutput() PolicyOutput
- func (o PolicyOutput) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput
- func (o PolicyOutput) UserType() pulumi.StringOutput
- type PolicyState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetMetaTagsArgs ¶
type GetMetaTagsArgs struct { // The name of the key. KeyName *string `pulumi:"keyName"` // File name where to save data source results (after running `pulumi preview`). OutputFile *string `pulumi:"outputFile"` }
A collection of arguments for invoking getMetaTags.
type GetMetaTagsOutputArgs ¶
type GetMetaTagsOutputArgs struct { // The name of the key. KeyName pulumi.StringPtrInput `pulumi:"keyName"` // File name where to save data source results (after running `pulumi preview`). OutputFile pulumi.StringPtrInput `pulumi:"outputFile"` }
A collection of arguments for invoking getMetaTags.
func (GetMetaTagsOutputArgs) ElementType ¶
func (GetMetaTagsOutputArgs) ElementType() reflect.Type
type GetMetaTagsResult ¶
type GetMetaTagsResult struct { // The provider-assigned unique ID for this managed resource. Id string `pulumi:"id"` KeyName *string `pulumi:"keyName"` OutputFile *string `pulumi:"outputFile"` Tags []GetMetaTagsTag `pulumi:"tags"` }
A collection of values returned by getMetaTags.
func GetMetaTags ¶
func GetMetaTags(ctx *pulumi.Context, args *GetMetaTagsArgs, opts ...pulumi.InvokeOption) (*GetMetaTagsResult, error)
This data source provides the Tag Meta Tags of the current Alibaba Cloud user.
> **NOTE:** Available in v1.169.0+.
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/tag" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _default, err := tag.GetMetaTags(ctx, &tag.GetMetaTagsArgs{ KeyName: pulumi.StringRef("example_value"), }, nil) if err != nil { return err } ctx.Export("tagMetaTagDefault1", _default.Tags.ValueName) return nil }) }
```
type GetMetaTagsResultOutput ¶
type GetMetaTagsResultOutput struct{ *pulumi.OutputState }
A collection of values returned by getMetaTags.
func GetMetaTagsOutput ¶
func GetMetaTagsOutput(ctx *pulumi.Context, args GetMetaTagsOutputArgs, opts ...pulumi.InvokeOption) GetMetaTagsResultOutput
func (GetMetaTagsResultOutput) ElementType ¶
func (GetMetaTagsResultOutput) ElementType() reflect.Type
func (GetMetaTagsResultOutput) Id ¶
func (o GetMetaTagsResultOutput) Id() pulumi.StringOutput
The provider-assigned unique ID for this managed resource.
func (GetMetaTagsResultOutput) KeyName ¶
func (o GetMetaTagsResultOutput) KeyName() pulumi.StringPtrOutput
func (GetMetaTagsResultOutput) OutputFile ¶
func (o GetMetaTagsResultOutput) OutputFile() pulumi.StringPtrOutput
func (GetMetaTagsResultOutput) Tags ¶
func (o GetMetaTagsResultOutput) Tags() GetMetaTagsTagArrayOutput
func (GetMetaTagsResultOutput) ToGetMetaTagsResultOutput ¶
func (o GetMetaTagsResultOutput) ToGetMetaTagsResultOutput() GetMetaTagsResultOutput
func (GetMetaTagsResultOutput) ToGetMetaTagsResultOutputWithContext ¶
func (o GetMetaTagsResultOutput) ToGetMetaTagsResultOutputWithContext(ctx context.Context) GetMetaTagsResultOutput
type GetMetaTagsTag ¶
type GetMetaTagsTagArgs ¶
type GetMetaTagsTagArgs struct { // The type of the resource tags. Category pulumi.StringInput `pulumi:"category"` // The name of the key. KeyName pulumi.StringInput `pulumi:"keyName"` // The name of the value. ValueName pulumi.StringInput `pulumi:"valueName"` }
func (GetMetaTagsTagArgs) ElementType ¶
func (GetMetaTagsTagArgs) ElementType() reflect.Type
func (GetMetaTagsTagArgs) ToGetMetaTagsTagOutput ¶
func (i GetMetaTagsTagArgs) ToGetMetaTagsTagOutput() GetMetaTagsTagOutput
func (GetMetaTagsTagArgs) ToGetMetaTagsTagOutputWithContext ¶
func (i GetMetaTagsTagArgs) ToGetMetaTagsTagOutputWithContext(ctx context.Context) GetMetaTagsTagOutput
type GetMetaTagsTagArray ¶
type GetMetaTagsTagArray []GetMetaTagsTagInput
func (GetMetaTagsTagArray) ElementType ¶
func (GetMetaTagsTagArray) ElementType() reflect.Type
func (GetMetaTagsTagArray) ToGetMetaTagsTagArrayOutput ¶
func (i GetMetaTagsTagArray) ToGetMetaTagsTagArrayOutput() GetMetaTagsTagArrayOutput
func (GetMetaTagsTagArray) ToGetMetaTagsTagArrayOutputWithContext ¶
func (i GetMetaTagsTagArray) ToGetMetaTagsTagArrayOutputWithContext(ctx context.Context) GetMetaTagsTagArrayOutput
type GetMetaTagsTagArrayInput ¶
type GetMetaTagsTagArrayInput interface { pulumi.Input ToGetMetaTagsTagArrayOutput() GetMetaTagsTagArrayOutput ToGetMetaTagsTagArrayOutputWithContext(context.Context) GetMetaTagsTagArrayOutput }
GetMetaTagsTagArrayInput is an input type that accepts GetMetaTagsTagArray and GetMetaTagsTagArrayOutput values. You can construct a concrete instance of `GetMetaTagsTagArrayInput` via:
GetMetaTagsTagArray{ GetMetaTagsTagArgs{...} }
type GetMetaTagsTagArrayOutput ¶
type GetMetaTagsTagArrayOutput struct{ *pulumi.OutputState }
func (GetMetaTagsTagArrayOutput) ElementType ¶
func (GetMetaTagsTagArrayOutput) ElementType() reflect.Type
func (GetMetaTagsTagArrayOutput) Index ¶
func (o GetMetaTagsTagArrayOutput) Index(i pulumi.IntInput) GetMetaTagsTagOutput
func (GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutput ¶
func (o GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutput() GetMetaTagsTagArrayOutput
func (GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutputWithContext ¶
func (o GetMetaTagsTagArrayOutput) ToGetMetaTagsTagArrayOutputWithContext(ctx context.Context) GetMetaTagsTagArrayOutput
type GetMetaTagsTagInput ¶
type GetMetaTagsTagInput interface { pulumi.Input ToGetMetaTagsTagOutput() GetMetaTagsTagOutput ToGetMetaTagsTagOutputWithContext(context.Context) GetMetaTagsTagOutput }
GetMetaTagsTagInput is an input type that accepts GetMetaTagsTagArgs and GetMetaTagsTagOutput values. You can construct a concrete instance of `GetMetaTagsTagInput` via:
GetMetaTagsTagArgs{...}
type GetMetaTagsTagOutput ¶
type GetMetaTagsTagOutput struct{ *pulumi.OutputState }
func (GetMetaTagsTagOutput) Category ¶
func (o GetMetaTagsTagOutput) Category() pulumi.StringOutput
The type of the resource tags.
func (GetMetaTagsTagOutput) ElementType ¶
func (GetMetaTagsTagOutput) ElementType() reflect.Type
func (GetMetaTagsTagOutput) KeyName ¶
func (o GetMetaTagsTagOutput) KeyName() pulumi.StringOutput
The name of the key.
func (GetMetaTagsTagOutput) ToGetMetaTagsTagOutput ¶
func (o GetMetaTagsTagOutput) ToGetMetaTagsTagOutput() GetMetaTagsTagOutput
func (GetMetaTagsTagOutput) ToGetMetaTagsTagOutputWithContext ¶
func (o GetMetaTagsTagOutput) ToGetMetaTagsTagOutputWithContext(ctx context.Context) GetMetaTagsTagOutput
func (GetMetaTagsTagOutput) ValueName ¶
func (o GetMetaTagsTagOutput) ValueName() pulumi.StringOutput
The name of the value.
type MetaTag ¶ added in v3.43.0
type MetaTag struct { pulumi.CustomResourceState // The key of the tag meta tag. key must be 1 to 128 characters in length. Key pulumi.StringOutput `pulumi:"key"` // The values of the tag meta tag. Values pulumi.StringArrayOutput `pulumi:"values"` }
Provides a Tag Meta Tag resource.
For information about Tag Meta Tag and how to use it, see [What is Meta Tag](https://www.alibabacloud.com/help/en/resource-management/latest/createtags).
> **NOTE:** Available since v1.209.0.
> **NOTE:** Meta Tag Only Support `cn-hangzhou` Region
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/tag" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := tag.NewMetaTag(ctx, "example", &tag.MetaTagArgs{ Key: pulumi.String("Name1"), Values: pulumi.StringArray{ pulumi.String("Desc2"), }, }) if err != nil { return err } return nil }) }
```
## Import
Tag Meta Tag can be imported using the id, e.g.
```sh $ pulumi import alicloud:tag/metaTag:MetaTag example <regionId>:<key> ```
func GetMetaTag ¶ added in v3.43.0
func GetMetaTag(ctx *pulumi.Context, name string, id pulumi.IDInput, state *MetaTagState, opts ...pulumi.ResourceOption) (*MetaTag, error)
GetMetaTag gets an existing MetaTag resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewMetaTag ¶ added in v3.43.0
func NewMetaTag(ctx *pulumi.Context, name string, args *MetaTagArgs, opts ...pulumi.ResourceOption) (*MetaTag, error)
NewMetaTag registers a new resource with the given unique name, arguments, and options.
func (*MetaTag) ElementType ¶ added in v3.43.0
func (*MetaTag) ToMetaTagOutput ¶ added in v3.43.0
func (i *MetaTag) ToMetaTagOutput() MetaTagOutput
func (*MetaTag) ToMetaTagOutputWithContext ¶ added in v3.43.0
func (i *MetaTag) ToMetaTagOutputWithContext(ctx context.Context) MetaTagOutput
type MetaTagArgs ¶ added in v3.43.0
type MetaTagArgs struct { // The key of the tag meta tag. key must be 1 to 128 characters in length. Key pulumi.StringInput // The values of the tag meta tag. Values pulumi.StringArrayInput }
The set of arguments for constructing a MetaTag resource.
func (MetaTagArgs) ElementType ¶ added in v3.43.0
func (MetaTagArgs) ElementType() reflect.Type
type MetaTagArray ¶ added in v3.43.0
type MetaTagArray []MetaTagInput
func (MetaTagArray) ElementType ¶ added in v3.43.0
func (MetaTagArray) ElementType() reflect.Type
func (MetaTagArray) ToMetaTagArrayOutput ¶ added in v3.43.0
func (i MetaTagArray) ToMetaTagArrayOutput() MetaTagArrayOutput
func (MetaTagArray) ToMetaTagArrayOutputWithContext ¶ added in v3.43.0
func (i MetaTagArray) ToMetaTagArrayOutputWithContext(ctx context.Context) MetaTagArrayOutput
type MetaTagArrayInput ¶ added in v3.43.0
type MetaTagArrayInput interface { pulumi.Input ToMetaTagArrayOutput() MetaTagArrayOutput ToMetaTagArrayOutputWithContext(context.Context) MetaTagArrayOutput }
MetaTagArrayInput is an input type that accepts MetaTagArray and MetaTagArrayOutput values. You can construct a concrete instance of `MetaTagArrayInput` via:
MetaTagArray{ MetaTagArgs{...} }
type MetaTagArrayOutput ¶ added in v3.43.0
type MetaTagArrayOutput struct{ *pulumi.OutputState }
func (MetaTagArrayOutput) ElementType ¶ added in v3.43.0
func (MetaTagArrayOutput) ElementType() reflect.Type
func (MetaTagArrayOutput) Index ¶ added in v3.43.0
func (o MetaTagArrayOutput) Index(i pulumi.IntInput) MetaTagOutput
func (MetaTagArrayOutput) ToMetaTagArrayOutput ¶ added in v3.43.0
func (o MetaTagArrayOutput) ToMetaTagArrayOutput() MetaTagArrayOutput
func (MetaTagArrayOutput) ToMetaTagArrayOutputWithContext ¶ added in v3.43.0
func (o MetaTagArrayOutput) ToMetaTagArrayOutputWithContext(ctx context.Context) MetaTagArrayOutput
type MetaTagInput ¶ added in v3.43.0
type MetaTagInput interface { pulumi.Input ToMetaTagOutput() MetaTagOutput ToMetaTagOutputWithContext(ctx context.Context) MetaTagOutput }
type MetaTagMap ¶ added in v3.43.0
type MetaTagMap map[string]MetaTagInput
func (MetaTagMap) ElementType ¶ added in v3.43.0
func (MetaTagMap) ElementType() reflect.Type
func (MetaTagMap) ToMetaTagMapOutput ¶ added in v3.43.0
func (i MetaTagMap) ToMetaTagMapOutput() MetaTagMapOutput
func (MetaTagMap) ToMetaTagMapOutputWithContext ¶ added in v3.43.0
func (i MetaTagMap) ToMetaTagMapOutputWithContext(ctx context.Context) MetaTagMapOutput
type MetaTagMapInput ¶ added in v3.43.0
type MetaTagMapInput interface { pulumi.Input ToMetaTagMapOutput() MetaTagMapOutput ToMetaTagMapOutputWithContext(context.Context) MetaTagMapOutput }
MetaTagMapInput is an input type that accepts MetaTagMap and MetaTagMapOutput values. You can construct a concrete instance of `MetaTagMapInput` via:
MetaTagMap{ "key": MetaTagArgs{...} }
type MetaTagMapOutput ¶ added in v3.43.0
type MetaTagMapOutput struct{ *pulumi.OutputState }
func (MetaTagMapOutput) ElementType ¶ added in v3.43.0
func (MetaTagMapOutput) ElementType() reflect.Type
func (MetaTagMapOutput) MapIndex ¶ added in v3.43.0
func (o MetaTagMapOutput) MapIndex(k pulumi.StringInput) MetaTagOutput
func (MetaTagMapOutput) ToMetaTagMapOutput ¶ added in v3.43.0
func (o MetaTagMapOutput) ToMetaTagMapOutput() MetaTagMapOutput
func (MetaTagMapOutput) ToMetaTagMapOutputWithContext ¶ added in v3.43.0
func (o MetaTagMapOutput) ToMetaTagMapOutputWithContext(ctx context.Context) MetaTagMapOutput
type MetaTagOutput ¶ added in v3.43.0
type MetaTagOutput struct{ *pulumi.OutputState }
func (MetaTagOutput) ElementType ¶ added in v3.43.0
func (MetaTagOutput) ElementType() reflect.Type
func (MetaTagOutput) Key ¶ added in v3.43.0
func (o MetaTagOutput) Key() pulumi.StringOutput
The key of the tag meta tag. key must be 1 to 128 characters in length.
func (MetaTagOutput) ToMetaTagOutput ¶ added in v3.43.0
func (o MetaTagOutput) ToMetaTagOutput() MetaTagOutput
func (MetaTagOutput) ToMetaTagOutputWithContext ¶ added in v3.43.0
func (o MetaTagOutput) ToMetaTagOutputWithContext(ctx context.Context) MetaTagOutput
func (MetaTagOutput) Values ¶ added in v3.43.0
func (o MetaTagOutput) Values() pulumi.StringArrayOutput
The values of the tag meta tag.
type MetaTagState ¶ added in v3.43.0
type MetaTagState struct { // The key of the tag meta tag. key must be 1 to 128 characters in length. Key pulumi.StringPtrInput // The values of the tag meta tag. Values pulumi.StringArrayInput }
func (MetaTagState) ElementType ¶ added in v3.43.0
func (MetaTagState) ElementType() reflect.Type
type Policy ¶ added in v3.36.0
type Policy struct { pulumi.CustomResourceState // The content of the policy. PolicyContent pulumi.StringOutput `pulumi:"policyContent"` // The description of the policy. The description must be 1 to 512 characters in length. PolicyDesc pulumi.StringPtrOutput `pulumi:"policyDesc"` // The name of the policy. name must be 1 to 128 characters in length and can contain letters, // digits, and hyphens (-). PolicyName pulumi.StringOutput `pulumi:"policyName"` // The type of the tag policy. Valid values: `USER`, `RD`. UserType pulumi.StringOutput `pulumi:"userType"` }
Provides a Tag Policy resource.
For information about Tag Policy and how to use it, see [What is Policy](https://www.alibabacloud.com/help/en/resource-management/latest/create-policy).
> **NOTE:** Available since v1.203.0.
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/tag" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { cfg := config.New(ctx, "") name := "terraform-example" if param := cfg.Get("name"); param != "" { name = param } _, err := tag.NewPolicy(ctx, "example", &tag.PolicyArgs{ PolicyName: pulumi.String(name), PolicyDesc: pulumi.String(name), UserType: pulumi.String("USER"), PolicyContent: pulumi.String(" {\"tags\":{\"CostCenter\":{\"tag_value\":{\"@@assign\":[\"Beijing\",\"Shanghai\"]},\"tag_key\":{\"@@assign\":\"CostCenter\"}}}}\n"), }) if err != nil { return err } return nil }) }
```
## Import
Tag Policy can be imported using the id, e.g.
```sh $ pulumi import alicloud:tag/policy:Policy example <id> ```
func GetPolicy ¶ added in v3.36.0
func GetPolicy(ctx *pulumi.Context, name string, id pulumi.IDInput, state *PolicyState, opts ...pulumi.ResourceOption) (*Policy, error)
GetPolicy gets an existing Policy resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewPolicy ¶ added in v3.36.0
func NewPolicy(ctx *pulumi.Context, name string, args *PolicyArgs, opts ...pulumi.ResourceOption) (*Policy, error)
NewPolicy registers a new resource with the given unique name, arguments, and options.
func (*Policy) ElementType ¶ added in v3.36.0
func (*Policy) ToPolicyOutput ¶ added in v3.36.0
func (i *Policy) ToPolicyOutput() PolicyOutput
func (*Policy) ToPolicyOutputWithContext ¶ added in v3.36.0
func (i *Policy) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput
type PolicyArgs ¶ added in v3.36.0
type PolicyArgs struct { // The content of the policy. PolicyContent pulumi.StringInput // The description of the policy. The description must be 1 to 512 characters in length. PolicyDesc pulumi.StringPtrInput // The name of the policy. name must be 1 to 128 characters in length and can contain letters, // digits, and hyphens (-). PolicyName pulumi.StringInput // The type of the tag policy. Valid values: `USER`, `RD`. UserType pulumi.StringPtrInput }
The set of arguments for constructing a Policy resource.
func (PolicyArgs) ElementType ¶ added in v3.36.0
func (PolicyArgs) ElementType() reflect.Type
type PolicyArray ¶ added in v3.36.0
type PolicyArray []PolicyInput
func (PolicyArray) ElementType ¶ added in v3.36.0
func (PolicyArray) ElementType() reflect.Type
func (PolicyArray) ToPolicyArrayOutput ¶ added in v3.36.0
func (i PolicyArray) ToPolicyArrayOutput() PolicyArrayOutput
func (PolicyArray) ToPolicyArrayOutputWithContext ¶ added in v3.36.0
func (i PolicyArray) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput
type PolicyArrayInput ¶ added in v3.36.0
type PolicyArrayInput interface { pulumi.Input ToPolicyArrayOutput() PolicyArrayOutput ToPolicyArrayOutputWithContext(context.Context) PolicyArrayOutput }
PolicyArrayInput is an input type that accepts PolicyArray and PolicyArrayOutput values. You can construct a concrete instance of `PolicyArrayInput` via:
PolicyArray{ PolicyArgs{...} }
type PolicyArrayOutput ¶ added in v3.36.0
type PolicyArrayOutput struct{ *pulumi.OutputState }
func (PolicyArrayOutput) ElementType ¶ added in v3.36.0
func (PolicyArrayOutput) ElementType() reflect.Type
func (PolicyArrayOutput) Index ¶ added in v3.36.0
func (o PolicyArrayOutput) Index(i pulumi.IntInput) PolicyOutput
func (PolicyArrayOutput) ToPolicyArrayOutput ¶ added in v3.36.0
func (o PolicyArrayOutput) ToPolicyArrayOutput() PolicyArrayOutput
func (PolicyArrayOutput) ToPolicyArrayOutputWithContext ¶ added in v3.36.0
func (o PolicyArrayOutput) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput
type PolicyAttachment ¶ added in v3.37.0
type PolicyAttachment struct { pulumi.CustomResourceState // The ID of the tag policy. PolicyId pulumi.StringOutput `pulumi:"policyId"` // The ID of the object. TargetId pulumi.StringOutput `pulumi:"targetId"` // The type of the object. Valid values: `USER`, `ROOT`, `FOLDER`, `ACCOUNT`. TargetType pulumi.StringOutput `pulumi:"targetType"` }
Provides a Tag Policy Attachment resource to attaches a policy to an object. After you attach a tag policy to an object. For information about Tag Policy Attachment and how to use it, see [What is Policy Attachment](https://www.alibabacloud.com/help/en/resource-management/latest/attach-policy).
> **NOTE:** Available since v1.204.0.
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud" "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/tag" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { cfg := config.New(ctx, "") name := "tf-example" if param := cfg.Get("name"); param != "" { name = param } _default, err := alicloud.GetAccount(ctx, map[string]interface{}{}, nil) if err != nil { return err } example, err := tag.NewPolicy(ctx, "example", &tag.PolicyArgs{ PolicyName: pulumi.String(name), PolicyDesc: pulumi.String(name), UserType: pulumi.String("USER"), PolicyContent: pulumi.String(" {\"tags\":{\"CostCenter\":{\"tag_value\":{\"@@assign\":[\"Beijing\",\"Shanghai\"]},\"tag_key\":{\"@@assign\":\"CostCenter\"}}}}\n"), }) if err != nil { return err } _, err = tag.NewPolicyAttachment(ctx, "example", &tag.PolicyAttachmentArgs{ PolicyId: example.ID(), TargetId: pulumi.String(_default.Id), TargetType: pulumi.String("USER"), }) if err != nil { return err } return nil }) }
```
## Import
Tag Policy Attachment can be imported using the id, e.g.
```sh $ pulumi import alicloud:tag/policyAttachment:PolicyAttachment example <policy_id>:<target_id>:<target_type> ```
func GetPolicyAttachment ¶ added in v3.37.0
func GetPolicyAttachment(ctx *pulumi.Context, name string, id pulumi.IDInput, state *PolicyAttachmentState, opts ...pulumi.ResourceOption) (*PolicyAttachment, error)
GetPolicyAttachment gets an existing PolicyAttachment resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewPolicyAttachment ¶ added in v3.37.0
func NewPolicyAttachment(ctx *pulumi.Context, name string, args *PolicyAttachmentArgs, opts ...pulumi.ResourceOption) (*PolicyAttachment, error)
NewPolicyAttachment registers a new resource with the given unique name, arguments, and options.
func (*PolicyAttachment) ElementType ¶ added in v3.37.0
func (*PolicyAttachment) ElementType() reflect.Type
func (*PolicyAttachment) ToPolicyAttachmentOutput ¶ added in v3.37.0
func (i *PolicyAttachment) ToPolicyAttachmentOutput() PolicyAttachmentOutput
func (*PolicyAttachment) ToPolicyAttachmentOutputWithContext ¶ added in v3.37.0
func (i *PolicyAttachment) ToPolicyAttachmentOutputWithContext(ctx context.Context) PolicyAttachmentOutput
type PolicyAttachmentArgs ¶ added in v3.37.0
type PolicyAttachmentArgs struct { // The ID of the tag policy. PolicyId pulumi.StringInput // The ID of the object. TargetId pulumi.StringInput // The type of the object. Valid values: `USER`, `ROOT`, `FOLDER`, `ACCOUNT`. TargetType pulumi.StringInput }
The set of arguments for constructing a PolicyAttachment resource.
func (PolicyAttachmentArgs) ElementType ¶ added in v3.37.0
func (PolicyAttachmentArgs) ElementType() reflect.Type
type PolicyAttachmentArray ¶ added in v3.37.0
type PolicyAttachmentArray []PolicyAttachmentInput
func (PolicyAttachmentArray) ElementType ¶ added in v3.37.0
func (PolicyAttachmentArray) ElementType() reflect.Type
func (PolicyAttachmentArray) ToPolicyAttachmentArrayOutput ¶ added in v3.37.0
func (i PolicyAttachmentArray) ToPolicyAttachmentArrayOutput() PolicyAttachmentArrayOutput
func (PolicyAttachmentArray) ToPolicyAttachmentArrayOutputWithContext ¶ added in v3.37.0
func (i PolicyAttachmentArray) ToPolicyAttachmentArrayOutputWithContext(ctx context.Context) PolicyAttachmentArrayOutput
type PolicyAttachmentArrayInput ¶ added in v3.37.0
type PolicyAttachmentArrayInput interface { pulumi.Input ToPolicyAttachmentArrayOutput() PolicyAttachmentArrayOutput ToPolicyAttachmentArrayOutputWithContext(context.Context) PolicyAttachmentArrayOutput }
PolicyAttachmentArrayInput is an input type that accepts PolicyAttachmentArray and PolicyAttachmentArrayOutput values. You can construct a concrete instance of `PolicyAttachmentArrayInput` via:
PolicyAttachmentArray{ PolicyAttachmentArgs{...} }
type PolicyAttachmentArrayOutput ¶ added in v3.37.0
type PolicyAttachmentArrayOutput struct{ *pulumi.OutputState }
func (PolicyAttachmentArrayOutput) ElementType ¶ added in v3.37.0
func (PolicyAttachmentArrayOutput) ElementType() reflect.Type
func (PolicyAttachmentArrayOutput) Index ¶ added in v3.37.0
func (o PolicyAttachmentArrayOutput) Index(i pulumi.IntInput) PolicyAttachmentOutput
func (PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutput ¶ added in v3.37.0
func (o PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutput() PolicyAttachmentArrayOutput
func (PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutputWithContext ¶ added in v3.37.0
func (o PolicyAttachmentArrayOutput) ToPolicyAttachmentArrayOutputWithContext(ctx context.Context) PolicyAttachmentArrayOutput
type PolicyAttachmentInput ¶ added in v3.37.0
type PolicyAttachmentInput interface { pulumi.Input ToPolicyAttachmentOutput() PolicyAttachmentOutput ToPolicyAttachmentOutputWithContext(ctx context.Context) PolicyAttachmentOutput }
type PolicyAttachmentMap ¶ added in v3.37.0
type PolicyAttachmentMap map[string]PolicyAttachmentInput
func (PolicyAttachmentMap) ElementType ¶ added in v3.37.0
func (PolicyAttachmentMap) ElementType() reflect.Type
func (PolicyAttachmentMap) ToPolicyAttachmentMapOutput ¶ added in v3.37.0
func (i PolicyAttachmentMap) ToPolicyAttachmentMapOutput() PolicyAttachmentMapOutput
func (PolicyAttachmentMap) ToPolicyAttachmentMapOutputWithContext ¶ added in v3.37.0
func (i PolicyAttachmentMap) ToPolicyAttachmentMapOutputWithContext(ctx context.Context) PolicyAttachmentMapOutput
type PolicyAttachmentMapInput ¶ added in v3.37.0
type PolicyAttachmentMapInput interface { pulumi.Input ToPolicyAttachmentMapOutput() PolicyAttachmentMapOutput ToPolicyAttachmentMapOutputWithContext(context.Context) PolicyAttachmentMapOutput }
PolicyAttachmentMapInput is an input type that accepts PolicyAttachmentMap and PolicyAttachmentMapOutput values. You can construct a concrete instance of `PolicyAttachmentMapInput` via:
PolicyAttachmentMap{ "key": PolicyAttachmentArgs{...} }
type PolicyAttachmentMapOutput ¶ added in v3.37.0
type PolicyAttachmentMapOutput struct{ *pulumi.OutputState }
func (PolicyAttachmentMapOutput) ElementType ¶ added in v3.37.0
func (PolicyAttachmentMapOutput) ElementType() reflect.Type
func (PolicyAttachmentMapOutput) MapIndex ¶ added in v3.37.0
func (o PolicyAttachmentMapOutput) MapIndex(k pulumi.StringInput) PolicyAttachmentOutput
func (PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutput ¶ added in v3.37.0
func (o PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutput() PolicyAttachmentMapOutput
func (PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutputWithContext ¶ added in v3.37.0
func (o PolicyAttachmentMapOutput) ToPolicyAttachmentMapOutputWithContext(ctx context.Context) PolicyAttachmentMapOutput
type PolicyAttachmentOutput ¶ added in v3.37.0
type PolicyAttachmentOutput struct{ *pulumi.OutputState }
func (PolicyAttachmentOutput) ElementType ¶ added in v3.37.0
func (PolicyAttachmentOutput) ElementType() reflect.Type
func (PolicyAttachmentOutput) PolicyId ¶ added in v3.37.0
func (o PolicyAttachmentOutput) PolicyId() pulumi.StringOutput
The ID of the tag policy.
func (PolicyAttachmentOutput) TargetId ¶ added in v3.37.0
func (o PolicyAttachmentOutput) TargetId() pulumi.StringOutput
The ID of the object.
func (PolicyAttachmentOutput) TargetType ¶ added in v3.37.0
func (o PolicyAttachmentOutput) TargetType() pulumi.StringOutput
The type of the object. Valid values: `USER`, `ROOT`, `FOLDER`, `ACCOUNT`.
func (PolicyAttachmentOutput) ToPolicyAttachmentOutput ¶ added in v3.37.0
func (o PolicyAttachmentOutput) ToPolicyAttachmentOutput() PolicyAttachmentOutput
func (PolicyAttachmentOutput) ToPolicyAttachmentOutputWithContext ¶ added in v3.37.0
func (o PolicyAttachmentOutput) ToPolicyAttachmentOutputWithContext(ctx context.Context) PolicyAttachmentOutput
type PolicyAttachmentState ¶ added in v3.37.0
type PolicyAttachmentState struct { // The ID of the tag policy. PolicyId pulumi.StringPtrInput // The ID of the object. TargetId pulumi.StringPtrInput // The type of the object. Valid values: `USER`, `ROOT`, `FOLDER`, `ACCOUNT`. TargetType pulumi.StringPtrInput }
func (PolicyAttachmentState) ElementType ¶ added in v3.37.0
func (PolicyAttachmentState) ElementType() reflect.Type
type PolicyInput ¶ added in v3.36.0
type PolicyInput interface { pulumi.Input ToPolicyOutput() PolicyOutput ToPolicyOutputWithContext(ctx context.Context) PolicyOutput }
type PolicyMap ¶ added in v3.36.0
type PolicyMap map[string]PolicyInput
func (PolicyMap) ElementType ¶ added in v3.36.0
func (PolicyMap) ToPolicyMapOutput ¶ added in v3.36.0
func (i PolicyMap) ToPolicyMapOutput() PolicyMapOutput
func (PolicyMap) ToPolicyMapOutputWithContext ¶ added in v3.36.0
func (i PolicyMap) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput
type PolicyMapInput ¶ added in v3.36.0
type PolicyMapInput interface { pulumi.Input ToPolicyMapOutput() PolicyMapOutput ToPolicyMapOutputWithContext(context.Context) PolicyMapOutput }
PolicyMapInput is an input type that accepts PolicyMap and PolicyMapOutput values. You can construct a concrete instance of `PolicyMapInput` via:
PolicyMap{ "key": PolicyArgs{...} }
type PolicyMapOutput ¶ added in v3.36.0
type PolicyMapOutput struct{ *pulumi.OutputState }
func (PolicyMapOutput) ElementType ¶ added in v3.36.0
func (PolicyMapOutput) ElementType() reflect.Type
func (PolicyMapOutput) MapIndex ¶ added in v3.36.0
func (o PolicyMapOutput) MapIndex(k pulumi.StringInput) PolicyOutput
func (PolicyMapOutput) ToPolicyMapOutput ¶ added in v3.36.0
func (o PolicyMapOutput) ToPolicyMapOutput() PolicyMapOutput
func (PolicyMapOutput) ToPolicyMapOutputWithContext ¶ added in v3.36.0
func (o PolicyMapOutput) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput
type PolicyOutput ¶ added in v3.36.0
type PolicyOutput struct{ *pulumi.OutputState }
func (PolicyOutput) ElementType ¶ added in v3.36.0
func (PolicyOutput) ElementType() reflect.Type
func (PolicyOutput) PolicyContent ¶ added in v3.36.0
func (o PolicyOutput) PolicyContent() pulumi.StringOutput
The content of the policy.
func (PolicyOutput) PolicyDesc ¶ added in v3.36.0
func (o PolicyOutput) PolicyDesc() pulumi.StringPtrOutput
The description of the policy. The description must be 1 to 512 characters in length.
func (PolicyOutput) PolicyName ¶ added in v3.36.0
func (o PolicyOutput) PolicyName() pulumi.StringOutput
The name of the policy. name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
func (PolicyOutput) ToPolicyOutput ¶ added in v3.36.0
func (o PolicyOutput) ToPolicyOutput() PolicyOutput
func (PolicyOutput) ToPolicyOutputWithContext ¶ added in v3.36.0
func (o PolicyOutput) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput
func (PolicyOutput) UserType ¶ added in v3.36.0
func (o PolicyOutput) UserType() pulumi.StringOutput
The type of the tag policy. Valid values: `USER`, `RD`.
type PolicyState ¶ added in v3.36.0
type PolicyState struct { // The content of the policy. PolicyContent pulumi.StringPtrInput // The description of the policy. The description must be 1 to 512 characters in length. PolicyDesc pulumi.StringPtrInput // The name of the policy. name must be 1 to 128 characters in length and can contain letters, // digits, and hyphens (-). PolicyName pulumi.StringPtrInput // The type of the tag policy. Valid values: `USER`, `RD`. UserType pulumi.StringPtrInput }
func (PolicyState) ElementType ¶ added in v3.36.0
func (PolicyState) ElementType() reflect.Type