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

aws.costexplorer.CostAllocationTag

Explore with Pulumi AI

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

    Provides a CE Cost Allocation Tag.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.costexplorer.CostAllocationTag("example", {
        tagKey: "example",
        status: "Active",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.costexplorer.CostAllocationTag("example",
        tag_key="example",
        status="Active")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := costexplorer.NewCostAllocationTag(ctx, "example", &costexplorer.CostAllocationTagArgs{
    			TagKey: pulumi.String("example"),
    			Status: pulumi.String("Active"),
    		})
    		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 example = new Aws.CostExplorer.CostAllocationTag("example", new()
        {
            TagKey = "example",
            Status = "Active",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.costexplorer.CostAllocationTag;
    import com.pulumi.aws.costexplorer.CostAllocationTagArgs;
    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 example = new CostAllocationTag("example", CostAllocationTagArgs.builder()
                .tagKey("example")
                .status("Active")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:costexplorer:CostAllocationTag
        properties:
          tagKey: example
          status: Active
    

    Create CostAllocationTag Resource

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

    Constructor syntax

    new CostAllocationTag(name: string, args: CostAllocationTagArgs, opts?: CustomResourceOptions);
    @overload
    def CostAllocationTag(resource_name: str,
                          args: CostAllocationTagArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def CostAllocationTag(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          status: Optional[str] = None,
                          tag_key: Optional[str] = None)
    func NewCostAllocationTag(ctx *Context, name string, args CostAllocationTagArgs, opts ...ResourceOption) (*CostAllocationTag, error)
    public CostAllocationTag(string name, CostAllocationTagArgs args, CustomResourceOptions? opts = null)
    public CostAllocationTag(String name, CostAllocationTagArgs args)
    public CostAllocationTag(String name, CostAllocationTagArgs args, CustomResourceOptions options)
    
    type: aws:costexplorer:CostAllocationTag
    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 CostAllocationTagArgs
    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 CostAllocationTagArgs
    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 CostAllocationTagArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CostAllocationTagArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CostAllocationTagArgs
    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 costAllocationTagResource = new Aws.CostExplorer.CostAllocationTag("costAllocationTagResource", new()
    {
        Status = "string",
        TagKey = "string",
    });
    
    example, err := costexplorer.NewCostAllocationTag(ctx, "costAllocationTagResource", &costexplorer.CostAllocationTagArgs{
    	Status: pulumi.String("string"),
    	TagKey: pulumi.String("string"),
    })
    
    var costAllocationTagResource = new CostAllocationTag("costAllocationTagResource", CostAllocationTagArgs.builder()
        .status("string")
        .tagKey("string")
        .build());
    
    cost_allocation_tag_resource = aws.costexplorer.CostAllocationTag("costAllocationTagResource",
        status="string",
        tag_key="string")
    
    const costAllocationTagResource = new aws.costexplorer.CostAllocationTag("costAllocationTagResource", {
        status: "string",
        tagKey: "string",
    });
    
    type: aws:costexplorer:CostAllocationTag
    properties:
        status: string
        tagKey: string
    

    CostAllocationTag 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 CostAllocationTag resource accepts the following input properties:

    Status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    TagKey string
    The key for the cost allocation tag.
    Status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    TagKey string
    The key for the cost allocation tag.
    status String
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey String
    The key for the cost allocation tag.
    status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey string
    The key for the cost allocation tag.
    status str
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tag_key str
    The key for the cost allocation tag.
    status String
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey String
    The key for the cost allocation tag.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    The type of cost allocation tag.
    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    The type of cost allocation tag.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    The type of cost allocation tag.
    id string
    The provider-assigned unique ID for this managed resource.
    type string
    The type of cost allocation tag.
    id str
    The provider-assigned unique ID for this managed resource.
    type str
    The type of cost allocation tag.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    The type of cost allocation tag.

    Look up Existing CostAllocationTag Resource

    Get an existing CostAllocationTag 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?: CostAllocationTagState, opts?: CustomResourceOptions): CostAllocationTag
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            status: Optional[str] = None,
            tag_key: Optional[str] = None,
            type: Optional[str] = None) -> CostAllocationTag
    func GetCostAllocationTag(ctx *Context, name string, id IDInput, state *CostAllocationTagState, opts ...ResourceOption) (*CostAllocationTag, error)
    public static CostAllocationTag Get(string name, Input<string> id, CostAllocationTagState? state, CustomResourceOptions? opts = null)
    public static CostAllocationTag get(String name, Output<String> id, CostAllocationTagState 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:
    Status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    TagKey string
    The key for the cost allocation tag.
    Type string
    The type of cost allocation tag.
    Status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    TagKey string
    The key for the cost allocation tag.
    Type string
    The type of cost allocation tag.
    status String
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey String
    The key for the cost allocation tag.
    type String
    The type of cost allocation tag.
    status string
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey string
    The key for the cost allocation tag.
    type string
    The type of cost allocation tag.
    status str
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tag_key str
    The key for the cost allocation tag.
    type str
    The type of cost allocation tag.
    status String
    The status of a cost allocation tag. Valid values are Active and Inactive.
    tagKey String
    The key for the cost allocation tag.
    type String
    The type of cost allocation tag.

    Import

    Using pulumi import, import aws_ce_cost_allocation_tag using the id. For example:

    $ pulumi import aws:costexplorer/costAllocationTag:CostAllocationTag example key
    

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

    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