1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. DefaultCreditSpecification
AWS v6.80.0 published on Tuesday, May 6, 2025 by Pulumi

aws.ec2.DefaultCreditSpecification

Explore with Pulumi AI

aws logo
AWS v6.80.0 published on Tuesday, May 6, 2025 by Pulumi

    Resource for managing an AWS EC2 (Elastic Compute Cloud) Default Credit Specification.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.DefaultCreditSpecification("example", {
        instanceFamily: "t2",
        cpuCredits: "standard",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.DefaultCreditSpecification("example",
        instance_family="t2",
        cpu_credits="standard")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewDefaultCreditSpecification(ctx, "example", &ec2.DefaultCreditSpecificationArgs{
    			InstanceFamily: pulumi.String("t2"),
    			CpuCredits:     pulumi.String("standard"),
    		})
    		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.Ec2.DefaultCreditSpecification("example", new()
        {
            InstanceFamily = "t2",
            CpuCredits = "standard",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.DefaultCreditSpecification;
    import com.pulumi.aws.ec2.DefaultCreditSpecificationArgs;
    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 DefaultCreditSpecification("example", DefaultCreditSpecificationArgs.builder()
                .instanceFamily("t2")
                .cpuCredits("standard")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:DefaultCreditSpecification
        properties:
          instanceFamily: t2
          cpuCredits: standard
    

    Create DefaultCreditSpecification Resource

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

    Constructor syntax

    new DefaultCreditSpecification(name: string, args: DefaultCreditSpecificationArgs, opts?: CustomResourceOptions);
    @overload
    def DefaultCreditSpecification(resource_name: str,
                                   args: DefaultCreditSpecificationArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def DefaultCreditSpecification(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   cpu_credits: Optional[str] = None,
                                   instance_family: Optional[str] = None,
                                   timeouts: Optional[DefaultCreditSpecificationTimeoutsArgs] = None)
    func NewDefaultCreditSpecification(ctx *Context, name string, args DefaultCreditSpecificationArgs, opts ...ResourceOption) (*DefaultCreditSpecification, error)
    public DefaultCreditSpecification(string name, DefaultCreditSpecificationArgs args, CustomResourceOptions? opts = null)
    public DefaultCreditSpecification(String name, DefaultCreditSpecificationArgs args)
    public DefaultCreditSpecification(String name, DefaultCreditSpecificationArgs args, CustomResourceOptions options)
    
    type: aws:ec2:DefaultCreditSpecification
    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 DefaultCreditSpecificationArgs
    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 DefaultCreditSpecificationArgs
    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 DefaultCreditSpecificationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DefaultCreditSpecificationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DefaultCreditSpecificationArgs
    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 defaultCreditSpecificationResource = new Aws.Ec2.DefaultCreditSpecification("defaultCreditSpecificationResource", new()
    {
        CpuCredits = "string",
        InstanceFamily = "string",
        Timeouts = new Aws.Ec2.Inputs.DefaultCreditSpecificationTimeoutsArgs
        {
            Create = "string",
            Update = "string",
        },
    });
    
    example, err := ec2.NewDefaultCreditSpecification(ctx, "defaultCreditSpecificationResource", &ec2.DefaultCreditSpecificationArgs{
    	CpuCredits:     pulumi.String("string"),
    	InstanceFamily: pulumi.String("string"),
    	Timeouts: &ec2.DefaultCreditSpecificationTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var defaultCreditSpecificationResource = new DefaultCreditSpecification("defaultCreditSpecificationResource", DefaultCreditSpecificationArgs.builder()
        .cpuCredits("string")
        .instanceFamily("string")
        .timeouts(DefaultCreditSpecificationTimeoutsArgs.builder()
            .create("string")
            .update("string")
            .build())
        .build());
    
    default_credit_specification_resource = aws.ec2.DefaultCreditSpecification("defaultCreditSpecificationResource",
        cpu_credits="string",
        instance_family="string",
        timeouts={
            "create": "string",
            "update": "string",
        })
    
    const defaultCreditSpecificationResource = new aws.ec2.DefaultCreditSpecification("defaultCreditSpecificationResource", {
        cpuCredits: "string",
        instanceFamily: "string",
        timeouts: {
            create: "string",
            update: "string",
        },
    });
    
    type: aws:ec2:DefaultCreditSpecification
    properties:
        cpuCredits: string
        instanceFamily: string
        timeouts:
            create: string
            update: string
    

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

    CpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    InstanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    Timeouts DefaultCreditSpecificationTimeouts
    CpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    InstanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    Timeouts DefaultCreditSpecificationTimeoutsArgs
    cpuCredits String
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily String
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeouts
    cpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeouts
    cpu_credits str
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instance_family str
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeoutsArgs
    cpuCredits String
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily String
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DefaultCreditSpecification 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 DefaultCreditSpecification Resource

    Get an existing DefaultCreditSpecification 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?: DefaultCreditSpecificationState, opts?: CustomResourceOptions): DefaultCreditSpecification
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cpu_credits: Optional[str] = None,
            instance_family: Optional[str] = None,
            timeouts: Optional[DefaultCreditSpecificationTimeoutsArgs] = None) -> DefaultCreditSpecification
    func GetDefaultCreditSpecification(ctx *Context, name string, id IDInput, state *DefaultCreditSpecificationState, opts ...ResourceOption) (*DefaultCreditSpecification, error)
    public static DefaultCreditSpecification Get(string name, Input<string> id, DefaultCreditSpecificationState? state, CustomResourceOptions? opts = null)
    public static DefaultCreditSpecification get(String name, Output<String> id, DefaultCreditSpecificationState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2:DefaultCreditSpecification    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.
    The following state arguments are supported:
    CpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    InstanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    Timeouts DefaultCreditSpecificationTimeouts
    CpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    InstanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    Timeouts DefaultCreditSpecificationTimeoutsArgs
    cpuCredits String
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily String
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeouts
    cpuCredits string
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily string
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeouts
    cpu_credits str
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instance_family str
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts DefaultCreditSpecificationTimeoutsArgs
    cpuCredits String
    Credit option for CPU usage of the instance family. Valid values: standard, unlimited.
    instanceFamily String
    Instance family. Valid values are t2, t3, t3a, t4g.
    timeouts Property Map

    Supporting Types

    DefaultCreditSpecificationTimeouts, DefaultCreditSpecificationTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    update str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Using pulumi import, import EC2 (Elastic Compute Cloud) Default Credit Specification using the instance_family. For example:

    console

    % pulumi import aws_ec2_default_credit_specification.example t2

    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.80.0 published on Tuesday, May 6, 2025 by Pulumi