aws logo
AWS Classic v5.41.0, May 15 23

aws.budgets.BudgetAction

Explore with Pulumi AI

Provides a budget action resource. Budget actions are cost savings controls that run either automatically on your behalf or by using a workflow approval process.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var examplePolicyDocument = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Effect = "Allow",
                Actions = new[]
                {
                    "ec2:Describe*",
                },
                Resources = new[]
                {
                    "*",
                },
            },
        },
    });

    var examplePolicy = new Aws.Iam.Policy("examplePolicy", new()
    {
        Description = "My example policy",
        PolicyDocument = examplePolicyDocument.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var current = Aws.GetPartition.Invoke();

    var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Effect = "Allow",
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            $"budgets.{current.Apply(getPartitionResult => getPartitionResult.DnsSuffix)}",
                        },
                    },
                },
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
            },
        },
    });

    var exampleRole = new Aws.Iam.Role("exampleRole", new()
    {
        AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var exampleBudget = new Aws.Budgets.Budget("exampleBudget", new()
    {
        BudgetType = "USAGE",
        LimitAmount = "10.0",
        LimitUnit = "dollars",
        TimePeriodStart = "2006-01-02_15:04",
        TimeUnit = "MONTHLY",
    });

    var exampleBudgetAction = new Aws.Budgets.BudgetAction("exampleBudgetAction", new()
    {
        BudgetName = exampleBudget.Name,
        ActionType = "APPLY_IAM_POLICY",
        ApprovalModel = "AUTOMATIC",
        NotificationType = "ACTUAL",
        ExecutionRoleArn = exampleRole.Arn,
        ActionThreshold = new Aws.Budgets.Inputs.BudgetActionActionThresholdArgs
        {
            ActionThresholdType = "ABSOLUTE_VALUE",
            ActionThresholdValue = 100,
        },
        Definition = new Aws.Budgets.Inputs.BudgetActionDefinitionArgs
        {
            IamActionDefinition = new Aws.Budgets.Inputs.BudgetActionDefinitionIamActionDefinitionArgs
            {
                PolicyArn = examplePolicy.Arn,
                Roles = new[]
                {
                    exampleRole.Name,
                },
            },
        },
        Subscribers = new[]
        {
            new Aws.Budgets.Inputs.BudgetActionSubscriberArgs
            {
                Address = "example@example.example",
                SubscriptionType = "EMAIL",
            },
        },
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/budgets"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		examplePolicyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Effect: pulumi.StringRef("Allow"),
					Actions: []string{
						"ec2:Describe*",
					},
					Resources: []string{
						"*",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		examplePolicy, err := iam.NewPolicy(ctx, "examplePolicy", &iam.PolicyArgs{
			Description: pulumi.String("My example policy"),
			Policy:      *pulumi.String(examplePolicyDocument.Json),
		})
		if err != nil {
			return err
		}
		current, err := aws.GetPartition(ctx, nil, nil)
		if err != nil {
			return err
		}
		assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Effect: pulumi.StringRef("Allow"),
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								fmt.Sprintf("budgets.%v", current.DnsSuffix),
							},
						},
					},
					Actions: []string{
						"sts:AssumeRole",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleRole, err := iam.NewRole(ctx, "exampleRole", &iam.RoleArgs{
			AssumeRolePolicy: *pulumi.String(assumeRole.Json),
		})
		if err != nil {
			return err
		}
		exampleBudget, err := budgets.NewBudget(ctx, "exampleBudget", &budgets.BudgetArgs{
			BudgetType:      pulumi.String("USAGE"),
			LimitAmount:     pulumi.String("10.0"),
			LimitUnit:       pulumi.String("dollars"),
			TimePeriodStart: pulumi.String("2006-01-02_15:04"),
			TimeUnit:        pulumi.String("MONTHLY"),
		})
		if err != nil {
			return err
		}
		_, err = budgets.NewBudgetAction(ctx, "exampleBudgetAction", &budgets.BudgetActionArgs{
			BudgetName:       exampleBudget.Name,
			ActionType:       pulumi.String("APPLY_IAM_POLICY"),
			ApprovalModel:    pulumi.String("AUTOMATIC"),
			NotificationType: pulumi.String("ACTUAL"),
			ExecutionRoleArn: exampleRole.Arn,
			ActionThreshold: &budgets.BudgetActionActionThresholdArgs{
				ActionThresholdType:  pulumi.String("ABSOLUTE_VALUE"),
				ActionThresholdValue: pulumi.Float64(100),
			},
			Definition: &budgets.BudgetActionDefinitionArgs{
				IamActionDefinition: &budgets.BudgetActionDefinitionIamActionDefinitionArgs{
					PolicyArn: examplePolicy.Arn,
					Roles: pulumi.StringArray{
						exampleRole.Name,
					},
				},
			},
			Subscribers: budgets.BudgetActionSubscriberArray{
				&budgets.BudgetActionSubscriberArgs{
					Address:          pulumi.String("example@example.example"),
					SubscriptionType: pulumi.String("EMAIL"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Policy;
import com.pulumi.aws.iam.PolicyArgs;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.budgets.Budget;
import com.pulumi.aws.budgets.BudgetArgs;
import com.pulumi.aws.budgets.BudgetAction;
import com.pulumi.aws.budgets.BudgetActionArgs;
import com.pulumi.aws.budgets.inputs.BudgetActionActionThresholdArgs;
import com.pulumi.aws.budgets.inputs.BudgetActionDefinitionArgs;
import com.pulumi.aws.budgets.inputs.BudgetActionDefinitionIamActionDefinitionArgs;
import com.pulumi.aws.budgets.inputs.BudgetActionSubscriberArgs;
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) {
        final var examplePolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .actions("ec2:Describe*")
                .resources("*")
                .build())
            .build());

        var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()        
            .description("My example policy")
            .policy(examplePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

        final var current = AwsFunctions.getPartition();

        final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers(String.format("budgets.%s", current.applyValue(getPartitionResult -> getPartitionResult.dnsSuffix())))
                    .build())
                .actions("sts:AssumeRole")
                .build())
            .build());

        var exampleRole = new Role("exampleRole", RoleArgs.builder()        
            .assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

        var exampleBudget = new Budget("exampleBudget", BudgetArgs.builder()        
            .budgetType("USAGE")
            .limitAmount("10.0")
            .limitUnit("dollars")
            .timePeriodStart("2006-01-02_15:04")
            .timeUnit("MONTHLY")
            .build());

        var exampleBudgetAction = new BudgetAction("exampleBudgetAction", BudgetActionArgs.builder()        
            .budgetName(exampleBudget.name())
            .actionType("APPLY_IAM_POLICY")
            .approvalModel("AUTOMATIC")
            .notificationType("ACTUAL")
            .executionRoleArn(exampleRole.arn())
            .actionThreshold(BudgetActionActionThresholdArgs.builder()
                .actionThresholdType("ABSOLUTE_VALUE")
                .actionThresholdValue(100)
                .build())
            .definition(BudgetActionDefinitionArgs.builder()
                .iamActionDefinition(BudgetActionDefinitionIamActionDefinitionArgs.builder()
                    .policyArn(examplePolicy.arn())
                    .roles(exampleRole.name())
                    .build())
                .build())
            .subscribers(BudgetActionSubscriberArgs.builder()
                .address("example@example.example")
                .subscriptionType("EMAIL")
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_policy_document = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    effect="Allow",
    actions=["ec2:Describe*"],
    resources=["*"],
)])
example_policy = aws.iam.Policy("examplePolicy",
    description="My example policy",
    policy=example_policy_document.json)
current = aws.get_partition()
assume_role = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    effect="Allow",
    principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
        type="Service",
        identifiers=[f"budgets.{current.dns_suffix}"],
    )],
    actions=["sts:AssumeRole"],
)])
example_role = aws.iam.Role("exampleRole", assume_role_policy=assume_role.json)
example_budget = aws.budgets.Budget("exampleBudget",
    budget_type="USAGE",
    limit_amount="10.0",
    limit_unit="dollars",
    time_period_start="2006-01-02_15:04",
    time_unit="MONTHLY")
example_budget_action = aws.budgets.BudgetAction("exampleBudgetAction",
    budget_name=example_budget.name,
    action_type="APPLY_IAM_POLICY",
    approval_model="AUTOMATIC",
    notification_type="ACTUAL",
    execution_role_arn=example_role.arn,
    action_threshold=aws.budgets.BudgetActionActionThresholdArgs(
        action_threshold_type="ABSOLUTE_VALUE",
        action_threshold_value=100,
    ),
    definition=aws.budgets.BudgetActionDefinitionArgs(
        iam_action_definition=aws.budgets.BudgetActionDefinitionIamActionDefinitionArgs(
            policy_arn=example_policy.arn,
            roles=[example_role.name],
        ),
    ),
    subscribers=[aws.budgets.BudgetActionSubscriberArgs(
        address="example@example.example",
        subscription_type="EMAIL",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplePolicyDocument = aws.iam.getPolicyDocument({
    statements: [{
        effect: "Allow",
        actions: ["ec2:Describe*"],
        resources: ["*"],
    }],
});
const examplePolicy = new aws.iam.Policy("examplePolicy", {
    description: "My example policy",
    policy: examplePolicyDocument.then(examplePolicyDocument => examplePolicyDocument.json),
});
const current = aws.getPartition({});
const assumeRole = current.then(current => aws.iam.getPolicyDocument({
    statements: [{
        effect: "Allow",
        principals: [{
            type: "Service",
            identifiers: [`budgets.${current.dnsSuffix}`],
        }],
        actions: ["sts:AssumeRole"],
    }],
}));
const exampleRole = new aws.iam.Role("exampleRole", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
const exampleBudget = new aws.budgets.Budget("exampleBudget", {
    budgetType: "USAGE",
    limitAmount: "10.0",
    limitUnit: "dollars",
    timePeriodStart: "2006-01-02_15:04",
    timeUnit: "MONTHLY",
});
const exampleBudgetAction = new aws.budgets.BudgetAction("exampleBudgetAction", {
    budgetName: exampleBudget.name,
    actionType: "APPLY_IAM_POLICY",
    approvalModel: "AUTOMATIC",
    notificationType: "ACTUAL",
    executionRoleArn: exampleRole.arn,
    actionThreshold: {
        actionThresholdType: "ABSOLUTE_VALUE",
        actionThresholdValue: 100,
    },
    definition: {
        iamActionDefinition: {
            policyArn: examplePolicy.arn,
            roles: [exampleRole.name],
        },
    },
    subscribers: [{
        address: "example@example.example",
        subscriptionType: "EMAIL",
    }],
});
resources:
  exampleBudgetAction:
    type: aws:budgets:BudgetAction
    properties:
      budgetName: ${exampleBudget.name}
      actionType: APPLY_IAM_POLICY
      approvalModel: AUTOMATIC
      notificationType: ACTUAL
      executionRoleArn: ${exampleRole.arn}
      actionThreshold:
        actionThresholdType: ABSOLUTE_VALUE
        actionThresholdValue: 100
      definition:
        iamActionDefinition:
          policyArn: ${examplePolicy.arn}
          roles:
            - ${exampleRole.name}
      subscribers:
        - address: example@example.example
          subscriptionType: EMAIL
  examplePolicy:
    type: aws:iam:Policy
    properties:
      description: My example policy
      policy: ${examplePolicyDocument.json}
  exampleRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: ${assumeRole.json}
  exampleBudget:
    type: aws:budgets:Budget
    properties:
      budgetType: USAGE
      limitAmount: '10.0'
      limitUnit: dollars
      timePeriodStart: 2006-01-02_15:04
      timeUnit: MONTHLY
variables:
  examplePolicyDocument:
    fn::invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - effect: Allow
            actions:
              - ec2:Describe*
            resources:
              - '*'
  current:
    fn::invoke:
      Function: aws:getPartition
      Arguments: {}
  assumeRole:
    fn::invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - effect: Allow
            principals:
              - type: Service
                identifiers:
                  - budgets.${current.dnsSuffix}
            actions:
              - sts:AssumeRole

Create BudgetAction Resource

new BudgetAction(name: string, args: BudgetActionArgs, opts?: CustomResourceOptions);
@overload
def BudgetAction(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 account_id: Optional[str] = None,
                 action_threshold: Optional[BudgetActionActionThresholdArgs] = None,
                 action_type: Optional[str] = None,
                 approval_model: Optional[str] = None,
                 budget_name: Optional[str] = None,
                 definition: Optional[BudgetActionDefinitionArgs] = None,
                 execution_role_arn: Optional[str] = None,
                 notification_type: Optional[str] = None,
                 subscribers: Optional[Sequence[BudgetActionSubscriberArgs]] = None)
@overload
def BudgetAction(resource_name: str,
                 args: BudgetActionArgs,
                 opts: Optional[ResourceOptions] = None)
func NewBudgetAction(ctx *Context, name string, args BudgetActionArgs, opts ...ResourceOption) (*BudgetAction, error)
public BudgetAction(string name, BudgetActionArgs args, CustomResourceOptions? opts = null)
public BudgetAction(String name, BudgetActionArgs args)
public BudgetAction(String name, BudgetActionArgs args, CustomResourceOptions options)
type: aws:budgets:BudgetAction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BudgetActionArgs
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 BudgetActionArgs
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 BudgetActionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BudgetActionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BudgetActionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

BudgetAction Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The BudgetAction resource accepts the following input properties:

ActionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

ActionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

ApprovalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

BudgetName string

The name of a budget.

Definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

ExecutionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

NotificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

Subscribers List<BudgetActionSubscriberArgs>

A list of subscribers. See Subscriber.

AccountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

ActionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

ActionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

ApprovalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

BudgetName string

The name of a budget.

Definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

ExecutionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

NotificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

Subscribers []BudgetActionSubscriberArgs

A list of subscribers. See Subscriber.

AccountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

actionType String

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel String

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

budgetName String

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

executionRoleArn String

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType String

The type of a notification. Valid values are ACTUAL or FORECASTED.

subscribers List<BudgetActionSubscriberArgs>

A list of subscribers. See Subscriber.

accountId String

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

actionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

budgetName string

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

executionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

subscribers BudgetActionSubscriberArgs[]

A list of subscribers. See Subscriber.

accountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

action_threshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

action_type str

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approval_model str

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

budget_name str

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

execution_role_arn str

The role passed for action execution and reversion. Roles and actions must be in the same account.

notification_type str

The type of a notification. Valid values are ACTUAL or FORECASTED.

subscribers Sequence[BudgetActionSubscriberArgs]

A list of subscribers. See Subscriber.

account_id str

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionThreshold Property Map

The trigger threshold of the action. See Action Threshold.

actionType String

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel String

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

budgetName String

The name of a budget.

definition Property Map

Specifies all of the type-specific parameters. See Definition.

executionRoleArn String

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType String

The type of a notification. Valid values are ACTUAL or FORECASTED.

subscribers List<Property Map>

A list of subscribers. See Subscriber.

accountId String

The ID of the target account for budget. Will use current user's account_id by default if omitted.

Outputs

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

ActionId string

The id of the budget action.

Arn string

The ARN of the budget action.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the budget action.

ActionId string

The id of the budget action.

Arn string

The ARN of the budget action.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the budget action.

actionId String

The id of the budget action.

arn String

The ARN of the budget action.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the budget action.

actionId string

The id of the budget action.

arn string

The ARN of the budget action.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the budget action.

action_id str

The id of the budget action.

arn str

The ARN of the budget action.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the budget action.

actionId String

The id of the budget action.

arn String

The ARN of the budget action.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the budget action.

Look up Existing BudgetAction Resource

Get an existing BudgetAction 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?: BudgetActionState, opts?: CustomResourceOptions): BudgetAction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        action_id: Optional[str] = None,
        action_threshold: Optional[BudgetActionActionThresholdArgs] = None,
        action_type: Optional[str] = None,
        approval_model: Optional[str] = None,
        arn: Optional[str] = None,
        budget_name: Optional[str] = None,
        definition: Optional[BudgetActionDefinitionArgs] = None,
        execution_role_arn: Optional[str] = None,
        notification_type: Optional[str] = None,
        status: Optional[str] = None,
        subscribers: Optional[Sequence[BudgetActionSubscriberArgs]] = None) -> BudgetAction
func GetBudgetAction(ctx *Context, name string, id IDInput, state *BudgetActionState, opts ...ResourceOption) (*BudgetAction, error)
public static BudgetAction Get(string name, Input<string> id, BudgetActionState? state, CustomResourceOptions? opts = null)
public static BudgetAction get(String name, Output<String> id, BudgetActionState 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:
AccountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

ActionId string

The id of the budget action.

ActionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

ActionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

ApprovalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

Arn string

The ARN of the budget action.

BudgetName string

The name of a budget.

Definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

ExecutionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

NotificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

Status string

The status of the budget action.

Subscribers List<BudgetActionSubscriberArgs>

A list of subscribers. See Subscriber.

AccountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

ActionId string

The id of the budget action.

ActionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

ActionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

ApprovalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

Arn string

The ARN of the budget action.

BudgetName string

The name of a budget.

Definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

ExecutionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

NotificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

Status string

The status of the budget action.

Subscribers []BudgetActionSubscriberArgs

A list of subscribers. See Subscriber.

accountId String

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionId String

The id of the budget action.

actionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

actionType String

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel String

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

arn String

The ARN of the budget action.

budgetName String

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

executionRoleArn String

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType String

The type of a notification. Valid values are ACTUAL or FORECASTED.

status String

The status of the budget action.

subscribers List<BudgetActionSubscriberArgs>

A list of subscribers. See Subscriber.

accountId string

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionId string

The id of the budget action.

actionThreshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

actionType string

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel string

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

arn string

The ARN of the budget action.

budgetName string

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

executionRoleArn string

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType string

The type of a notification. Valid values are ACTUAL or FORECASTED.

status string

The status of the budget action.

subscribers BudgetActionSubscriberArgs[]

A list of subscribers. See Subscriber.

account_id str

The ID of the target account for budget. Will use current user's account_id by default if omitted.

action_id str

The id of the budget action.

action_threshold BudgetActionActionThresholdArgs

The trigger threshold of the action. See Action Threshold.

action_type str

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approval_model str

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

arn str

The ARN of the budget action.

budget_name str

The name of a budget.

definition BudgetActionDefinitionArgs

Specifies all of the type-specific parameters. See Definition.

execution_role_arn str

The role passed for action execution and reversion. Roles and actions must be in the same account.

notification_type str

The type of a notification. Valid values are ACTUAL or FORECASTED.

status str

The status of the budget action.

subscribers Sequence[BudgetActionSubscriberArgs]

A list of subscribers. See Subscriber.

accountId String

The ID of the target account for budget. Will use current user's account_id by default if omitted.

actionId String

The id of the budget action.

actionThreshold Property Map

The trigger threshold of the action. See Action Threshold.

actionType String

The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. Valid values are APPLY_IAM_POLICY, APPLY_SCP_POLICY, and RUN_SSM_DOCUMENTS.

approvalModel String

This specifies if the action needs manual or automatic approval. Valid values are AUTOMATIC and MANUAL.

arn String

The ARN of the budget action.

budgetName String

The name of a budget.

definition Property Map

Specifies all of the type-specific parameters. See Definition.

executionRoleArn String

The role passed for action execution and reversion. Roles and actions must be in the same account.

notificationType String

The type of a notification. Valid values are ACTUAL or FORECASTED.

status String

The status of the budget action.

subscribers List<Property Map>

A list of subscribers. See Subscriber.

Supporting Types

BudgetActionActionThreshold

ActionThresholdType string

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

ActionThresholdValue double

The threshold of a notification.

ActionThresholdType string

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

ActionThresholdValue float64

The threshold of a notification.

actionThresholdType String

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

actionThresholdValue Double

The threshold of a notification.

actionThresholdType string

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

actionThresholdValue number

The threshold of a notification.

action_threshold_type str

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

action_threshold_value float

The threshold of a notification.

actionThresholdType String

The type of threshold for a notification. Valid values are PERCENTAGE or ABSOLUTE_VALUE.

actionThresholdValue Number

The threshold of a notification.

BudgetActionDefinition

IamActionDefinition BudgetActionDefinitionIamActionDefinition

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

ScpActionDefinition BudgetActionDefinitionScpActionDefinition

The service control policies (SCPs) action definition details. See SCP Action Definition.

SsmActionDefinition BudgetActionDefinitionSsmActionDefinition

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

IamActionDefinition BudgetActionDefinitionIamActionDefinition

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

ScpActionDefinition BudgetActionDefinitionScpActionDefinition

The service control policies (SCPs) action definition details. See SCP Action Definition.

SsmActionDefinition BudgetActionDefinitionSsmActionDefinition

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

iamActionDefinition BudgetActionDefinitionIamActionDefinition

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

scpActionDefinition BudgetActionDefinitionScpActionDefinition

The service control policies (SCPs) action definition details. See SCP Action Definition.

ssmActionDefinition BudgetActionDefinitionSsmActionDefinition

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

iamActionDefinition BudgetActionDefinitionIamActionDefinition

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

scpActionDefinition BudgetActionDefinitionScpActionDefinition

The service control policies (SCPs) action definition details. See SCP Action Definition.

ssmActionDefinition BudgetActionDefinitionSsmActionDefinition

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

iam_action_definition BudgetActionDefinitionIamActionDefinition

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

scp_action_definition BudgetActionDefinitionScpActionDefinition

The service control policies (SCPs) action definition details. See SCP Action Definition.

ssm_action_definition BudgetActionDefinitionSsmActionDefinition

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

iamActionDefinition Property Map

The AWS Identity and Access Management (IAM) action definition details. See IAM Action Definition.

scpActionDefinition Property Map

The service control policies (SCPs) action definition details. See SCP Action Definition.

ssmActionDefinition Property Map

The AWS Systems Manager (SSM) action definition details. See SSM Action Definition.

BudgetActionDefinitionIamActionDefinition

PolicyArn string

The Amazon Resource Name (ARN) of the policy to be attached.

Groups List<string>

A list of groups to be attached. There must be at least one group.

Roles List<string>

A list of roles to be attached. There must be at least one role.

Users List<string>

A list of users to be attached. There must be at least one user.

PolicyArn string

The Amazon Resource Name (ARN) of the policy to be attached.

Groups []string

A list of groups to be attached. There must be at least one group.

Roles []string

A list of roles to be attached. There must be at least one role.

Users []string

A list of users to be attached. There must be at least one user.

policyArn String

The Amazon Resource Name (ARN) of the policy to be attached.

groups List<String>

A list of groups to be attached. There must be at least one group.

roles List<String>

A list of roles to be attached. There must be at least one role.

users List<String>

A list of users to be attached. There must be at least one user.

policyArn string

The Amazon Resource Name (ARN) of the policy to be attached.

groups string[]

A list of groups to be attached. There must be at least one group.

roles string[]

A list of roles to be attached. There must be at least one role.

users string[]

A list of users to be attached. There must be at least one user.

policy_arn str

The Amazon Resource Name (ARN) of the policy to be attached.

groups Sequence[str]

A list of groups to be attached. There must be at least one group.

roles Sequence[str]

A list of roles to be attached. There must be at least one role.

users Sequence[str]

A list of users to be attached. There must be at least one user.

policyArn String

The Amazon Resource Name (ARN) of the policy to be attached.

groups List<String>

A list of groups to be attached. There must be at least one group.

roles List<String>

A list of roles to be attached. There must be at least one role.

users List<String>

A list of users to be attached. There must be at least one user.

BudgetActionDefinitionScpActionDefinition

PolicyId string

The policy ID attached.

TargetIds List<string>

A list of target IDs.

PolicyId string

The policy ID attached.

TargetIds []string

A list of target IDs.

policyId String

The policy ID attached.

targetIds List<String>

A list of target IDs.

policyId string

The policy ID attached.

targetIds string[]

A list of target IDs.

policy_id str

The policy ID attached.

target_ids Sequence[str]

A list of target IDs.

policyId String

The policy ID attached.

targetIds List<String>

A list of target IDs.

BudgetActionDefinitionSsmActionDefinition

ActionSubType string

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

InstanceIds List<string>

The EC2 and RDS instance IDs.

Region string

The Region to run the SSM document.

ActionSubType string

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

InstanceIds []string

The EC2 and RDS instance IDs.

Region string

The Region to run the SSM document.

actionSubType String

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

instanceIds List<String>

The EC2 and RDS instance IDs.

region String

The Region to run the SSM document.

actionSubType string

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

instanceIds string[]

The EC2 and RDS instance IDs.

region string

The Region to run the SSM document.

action_sub_type str

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

instance_ids Sequence[str]

The EC2 and RDS instance IDs.

region str

The Region to run the SSM document.

actionSubType String

The action subType. Valid values are STOP_EC2_INSTANCES or STOP_RDS_INSTANCES.

instanceIds List<String>

The EC2 and RDS instance IDs.

region String

The Region to run the SSM document.

BudgetActionSubscriber

Address string

The address that AWS sends budget notifications to, either an SNS topic or an email.

SubscriptionType string

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

Address string

The address that AWS sends budget notifications to, either an SNS topic or an email.

SubscriptionType string

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

address String

The address that AWS sends budget notifications to, either an SNS topic or an email.

subscriptionType String

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

address string

The address that AWS sends budget notifications to, either an SNS topic or an email.

subscriptionType string

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

address str

The address that AWS sends budget notifications to, either an SNS topic or an email.

subscription_type str

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

address String

The address that AWS sends budget notifications to, either an SNS topic or an email.

subscriptionType String

The type of notification that AWS sends to a subscriber. Valid values are SNS or EMAIL.

Import

Budgets can be imported using AccountID:ActionID:BudgetName, e.g.,

 $ pulumi import aws:budgets/budgetAction:BudgetAction myBudget 123456789012:some-id:myBudget`

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.