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

aws.servicecatalog.ServiceAction

Explore with Pulumi AI

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

    Manages a Service Catalog self-service action.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.servicecatalog.ServiceAction("example", {
        description: "Motor generator unit",
        name: "MGU",
        definition: {
            name: "AWS-RestartEC2Instance",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.servicecatalog.ServiceAction("example",
        description="Motor generator unit",
        name="MGU",
        definition={
            "name": "AWS-RestartEC2Instance",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicecatalog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := servicecatalog.NewServiceAction(ctx, "example", &servicecatalog.ServiceActionArgs{
    			Description: pulumi.String("Motor generator unit"),
    			Name:        pulumi.String("MGU"),
    			Definition: &servicecatalog.ServiceActionDefinitionArgs{
    				Name: pulumi.String("AWS-RestartEC2Instance"),
    			},
    		})
    		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.ServiceCatalog.ServiceAction("example", new()
        {
            Description = "Motor generator unit",
            Name = "MGU",
            Definition = new Aws.ServiceCatalog.Inputs.ServiceActionDefinitionArgs
            {
                Name = "AWS-RestartEC2Instance",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.servicecatalog.ServiceAction;
    import com.pulumi.aws.servicecatalog.ServiceActionArgs;
    import com.pulumi.aws.servicecatalog.inputs.ServiceActionDefinitionArgs;
    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 ServiceAction("example", ServiceActionArgs.builder()
                .description("Motor generator unit")
                .name("MGU")
                .definition(ServiceActionDefinitionArgs.builder()
                    .name("AWS-RestartEC2Instance")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:servicecatalog:ServiceAction
        properties:
          description: Motor generator unit
          name: MGU
          definition:
            name: AWS-RestartEC2Instance
    

    Create ServiceAction Resource

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

    Constructor syntax

    new ServiceAction(name: string, args: ServiceActionArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceAction(resource_name: str,
                      args: ServiceActionArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceAction(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      definition: Optional[ServiceActionDefinitionArgs] = None,
                      accept_language: Optional[str] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None)
    func NewServiceAction(ctx *Context, name string, args ServiceActionArgs, opts ...ResourceOption) (*ServiceAction, error)
    public ServiceAction(string name, ServiceActionArgs args, CustomResourceOptions? opts = null)
    public ServiceAction(String name, ServiceActionArgs args)
    public ServiceAction(String name, ServiceActionArgs args, CustomResourceOptions options)
    
    type: aws:servicecatalog:ServiceAction
    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 ServiceActionArgs
    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 ServiceActionArgs
    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 ServiceActionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceActionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceActionArgs
    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 serviceActionResource = new Aws.ServiceCatalog.ServiceAction("serviceActionResource", new()
    {
        Definition = new Aws.ServiceCatalog.Inputs.ServiceActionDefinitionArgs
        {
            Name = "string",
            Version = "string",
            AssumeRole = "string",
            Parameters = "string",
            Type = "string",
        },
        AcceptLanguage = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := servicecatalog.NewServiceAction(ctx, "serviceActionResource", &servicecatalog.ServiceActionArgs{
    	Definition: &servicecatalog.ServiceActionDefinitionArgs{
    		Name:       pulumi.String("string"),
    		Version:    pulumi.String("string"),
    		AssumeRole: pulumi.String("string"),
    		Parameters: pulumi.String("string"),
    		Type:       pulumi.String("string"),
    	},
    	AcceptLanguage: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	Name:           pulumi.String("string"),
    })
    
    var serviceActionResource = new ServiceAction("serviceActionResource", ServiceActionArgs.builder()
        .definition(ServiceActionDefinitionArgs.builder()
            .name("string")
            .version("string")
            .assumeRole("string")
            .parameters("string")
            .type("string")
            .build())
        .acceptLanguage("string")
        .description("string")
        .name("string")
        .build());
    
    service_action_resource = aws.servicecatalog.ServiceAction("serviceActionResource",
        definition={
            "name": "string",
            "version": "string",
            "assume_role": "string",
            "parameters": "string",
            "type": "string",
        },
        accept_language="string",
        description="string",
        name="string")
    
    const serviceActionResource = new aws.servicecatalog.ServiceAction("serviceActionResource", {
        definition: {
            name: "string",
            version: "string",
            assumeRole: "string",
            parameters: "string",
            type: "string",
        },
        acceptLanguage: "string",
        description: "string",
        name: "string",
    });
    
    type: aws:servicecatalog:ServiceAction
    properties:
        acceptLanguage: string
        definition:
            assumeRole: string
            name: string
            parameters: string
            type: string
            version: string
        description: string
        name: string
    

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

    Definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    AcceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    Description string
    Self-service action description.
    Name string

    Self-service action name.

    The following arguments are optional:

    Definition ServiceActionDefinitionArgs
    Self-service action definition configuration block. Detailed below.
    AcceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    Description string
    Self-service action description.
    Name string

    Self-service action name.

    The following arguments are optional:

    definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    acceptLanguage String
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    description String
    Self-service action description.
    name String

    Self-service action name.

    The following arguments are optional:

    definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    acceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    description string
    Self-service action description.
    name string

    Self-service action name.

    The following arguments are optional:

    definition ServiceActionDefinitionArgs
    Self-service action definition configuration block. Detailed below.
    accept_language str
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    description str
    Self-service action description.
    name str

    Self-service action name.

    The following arguments are optional:

    definition Property Map
    Self-service action definition configuration block. Detailed below.
    acceptLanguage String
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    description String
    Self-service action description.
    name String

    Self-service action name.

    The following arguments are optional:

    Outputs

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

    Get an existing ServiceAction 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?: ServiceActionState, opts?: CustomResourceOptions): ServiceAction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accept_language: Optional[str] = None,
            definition: Optional[ServiceActionDefinitionArgs] = None,
            description: Optional[str] = None,
            name: Optional[str] = None) -> ServiceAction
    func GetServiceAction(ctx *Context, name string, id IDInput, state *ServiceActionState, opts ...ResourceOption) (*ServiceAction, error)
    public static ServiceAction Get(string name, Input<string> id, ServiceActionState? state, CustomResourceOptions? opts = null)
    public static ServiceAction get(String name, Output<String> id, ServiceActionState 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:
    AcceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    Definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    Description string
    Self-service action description.
    Name string

    Self-service action name.

    The following arguments are optional:

    AcceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    Definition ServiceActionDefinitionArgs
    Self-service action definition configuration block. Detailed below.
    Description string
    Self-service action description.
    Name string

    Self-service action name.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    description String
    Self-service action description.
    name String

    Self-service action name.

    The following arguments are optional:

    acceptLanguage string
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    definition ServiceActionDefinition
    Self-service action definition configuration block. Detailed below.
    description string
    Self-service action description.
    name string

    Self-service action name.

    The following arguments are optional:

    accept_language str
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    definition ServiceActionDefinitionArgs
    Self-service action definition configuration block. Detailed below.
    description str
    Self-service action description.
    name str

    Self-service action name.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values are en (English), jp (Japanese), and zh (Chinese). Default is en.
    definition Property Map
    Self-service action definition configuration block. Detailed below.
    description String
    Self-service action description.
    name String

    Self-service action name.

    The following arguments are optional:

    Supporting Types

    ServiceActionDefinition, ServiceActionDefinitionArgs

    Name string
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    Version string
    SSM document version. For example, 1.
    AssumeRole string
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    Parameters string
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    Type string
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.
    Name string
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    Version string
    SSM document version. For example, 1.
    AssumeRole string
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    Parameters string
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    Type string
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.
    name String
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    version String
    SSM document version. For example, 1.
    assumeRole String
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    parameters String
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    type String
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.
    name string
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    version string
    SSM document version. For example, 1.
    assumeRole string
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    parameters string
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    type string
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.
    name str
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    version str
    SSM document version. For example, 1.
    assume_role str
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    parameters str
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    type str
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.
    name String
    Name of the SSM document. For example, AWS-RestartEC2Instance. If you are using a shared SSM document, you must provide the ARN instead of the name.
    version String
    SSM document version. For example, 1.
    assumeRole String
    ARN of the role that performs the self-service actions on your behalf. For example, arn:aws:iam::12345678910:role/ActionRole. To reuse the provisioned product launch role, set to LAUNCH_ROLE.
    parameters String
    List of parameters in JSON format. For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
    type String
    Service action definition type. Valid value is SSM_AUTOMATION. Default is SSM_AUTOMATION.

    Import

    Using pulumi import, import aws_servicecatalog_service_action using the service action ID. For example:

    $ pulumi import aws:servicecatalog/serviceAction:ServiceAction example act-f1w12eperfslh
    

    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