1. Packages
  2. AWS Classic
  3. API Docs
  4. ssm
  5. Activation

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

aws.ssm.Activation

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

    Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        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[]
                            {
                                "ssm.amazonaws.com",
                            },
                        },
                    },
                    Actions = new[]
                    {
                        "sts:AssumeRole",
                    },
                },
            },
        });
    
        var testRole = new Aws.Iam.Role("testRole", new()
        {
            AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        });
    
        var testAttach = new Aws.Iam.RolePolicyAttachment("testAttach", new()
        {
            Role = testRole.Name,
            PolicyArn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
        });
    
        var foo = new Aws.Ssm.Activation("foo", new()
        {
            Description = "Test",
            IamRole = testRole.Id,
            RegistrationLimit = 5,
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                testAttach,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    			Statements: []iam.GetPolicyDocumentStatement{
    				{
    					Effect: pulumi.StringRef("Allow"),
    					Principals: []iam.GetPolicyDocumentStatementPrincipal{
    						{
    							Type: "Service",
    							Identifiers: []string{
    								"ssm.amazonaws.com",
    							},
    						},
    					},
    					Actions: []string{
    						"sts:AssumeRole",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		testRole, err := iam.NewRole(ctx, "testRole", &iam.RoleArgs{
    			AssumeRolePolicy: *pulumi.String(assumeRole.Json),
    		})
    		if err != nil {
    			return err
    		}
    		testAttach, err := iam.NewRolePolicyAttachment(ctx, "testAttach", &iam.RolePolicyAttachmentArgs{
    			Role:      testRole.Name,
    			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ssm.NewActivation(ctx, "foo", &ssm.ActivationArgs{
    			Description:       pulumi.String("Test"),
    			IamRole:           testRole.ID(),
    			RegistrationLimit: pulumi.Int(5),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			testAttach,
    		}))
    		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.Role;
    import com.pulumi.aws.iam.RoleArgs;
    import com.pulumi.aws.iam.RolePolicyAttachment;
    import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
    import com.pulumi.aws.ssm.Activation;
    import com.pulumi.aws.ssm.ActivationArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                .statements(GetPolicyDocumentStatementArgs.builder()
                    .effect("Allow")
                    .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                        .type("Service")
                        .identifiers("ssm.amazonaws.com")
                        .build())
                    .actions("sts:AssumeRole")
                    .build())
                .build());
    
            var testRole = new Role("testRole", RoleArgs.builder()        
                .assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
            var testAttach = new RolePolicyAttachment("testAttach", RolePolicyAttachmentArgs.builder()        
                .role(testRole.name())
                .policyArn("arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore")
                .build());
    
            var foo = new Activation("foo", ActivationArgs.builder()        
                .description("Test")
                .iamRole(testRole.id())
                .registrationLimit("5")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(testAttach)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    assume_role = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
        effect="Allow",
        principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
            type="Service",
            identifiers=["ssm.amazonaws.com"],
        )],
        actions=["sts:AssumeRole"],
    )])
    test_role = aws.iam.Role("testRole", assume_role_policy=assume_role.json)
    test_attach = aws.iam.RolePolicyAttachment("testAttach",
        role=test_role.name,
        policy_arn="arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore")
    foo = aws.ssm.Activation("foo",
        description="Test",
        iam_role=test_role.id,
        registration_limit=5,
        opts=pulumi.ResourceOptions(depends_on=[test_attach]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const assumeRole = aws.iam.getPolicyDocument({
        statements: [{
            effect: "Allow",
            principals: [{
                type: "Service",
                identifiers: ["ssm.amazonaws.com"],
            }],
            actions: ["sts:AssumeRole"],
        }],
    });
    const testRole = new aws.iam.Role("testRole", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
    const testAttach = new aws.iam.RolePolicyAttachment("testAttach", {
        role: testRole.name,
        policyArn: "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
    });
    const foo = new aws.ssm.Activation("foo", {
        description: "Test",
        iamRole: testRole.id,
        registrationLimit: 5,
    }, {
        dependsOn: [testAttach],
    });
    
    resources:
      testRole:
        type: aws:iam:Role
        properties:
          assumeRolePolicy: ${assumeRole.json}
      testAttach:
        type: aws:iam:RolePolicyAttachment
        properties:
          role: ${testRole.name}
          policyArn: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
      foo:
        type: aws:ssm:Activation
        properties:
          description: Test
          iamRole: ${testRole.id}
          registrationLimit: '5'
        options:
          dependson:
            - ${testAttach}
    variables:
      assumeRole:
        fn::invoke:
          Function: aws:iam:getPolicyDocument
          Arguments:
            statements:
              - effect: Allow
                principals:
                  - type: Service
                    identifiers:
                      - ssm.amazonaws.com
                actions:
                  - sts:AssumeRole
    

    Create Activation Resource

    new Activation(name: string, args: ActivationArgs, opts?: CustomResourceOptions);
    @overload
    def Activation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: Optional[str] = None,
                   expiration_date: Optional[str] = None,
                   iam_role: Optional[str] = None,
                   name: Optional[str] = None,
                   registration_limit: Optional[int] = None,
                   tags: Optional[Mapping[str, str]] = None)
    @overload
    def Activation(resource_name: str,
                   args: ActivationArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewActivation(ctx *Context, name string, args ActivationArgs, opts ...ResourceOption) (*Activation, error)
    public Activation(string name, ActivationArgs args, CustomResourceOptions? opts = null)
    public Activation(String name, ActivationArgs args)
    public Activation(String name, ActivationArgs args, CustomResourceOptions options)
    
    type: aws:ssm:Activation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ActivationArgs
    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 ActivationArgs
    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 ActivationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ActivationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ActivationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    IamRole string

    The IAM Role to attach to the managed instance.

    Description string

    The description of the resource that you want to register.

    ExpirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    Name string

    The default name of the registered managed instance.

    RegistrationLimit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    Tags Dictionary<string, string>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    IamRole string

    The IAM Role to attach to the managed instance.

    Description string

    The description of the resource that you want to register.

    ExpirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    Name string

    The default name of the registered managed instance.

    RegistrationLimit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    Tags map[string]string

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    iamRole String

    The IAM Role to attach to the managed instance.

    description String

    The description of the resource that you want to register.

    expirationDate String

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    name String

    The default name of the registered managed instance.

    registrationLimit Integer

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Map<String,String>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    iamRole string

    The IAM Role to attach to the managed instance.

    description string

    The description of the resource that you want to register.

    expirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    name string

    The default name of the registered managed instance.

    registrationLimit number

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags {[key: string]: string}

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    iam_role str

    The IAM Role to attach to the managed instance.

    description str

    The description of the resource that you want to register.

    expiration_date str

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    name str

    The default name of the registered managed instance.

    registration_limit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Mapping[str, str]

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    iamRole String

    The IAM Role to attach to the managed instance.

    description String

    The description of the resource that you want to register.

    expirationDate String

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    name String

    The default name of the registered managed instance.

    registrationLimit Number

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Map<String>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

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

    ActivationCode string

    The code the system generates when it processes the activation.

    Expired bool

    If the current activation has expired.

    Id string

    The provider-assigned unique ID for this managed resource.

    RegistrationCount int

    The number of managed instances that are currently registered using this activation.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    ActivationCode string

    The code the system generates when it processes the activation.

    Expired bool

    If the current activation has expired.

    Id string

    The provider-assigned unique ID for this managed resource.

    RegistrationCount int

    The number of managed instances that are currently registered using this activation.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode String

    The code the system generates when it processes the activation.

    expired Boolean

    If the current activation has expired.

    id String

    The provider-assigned unique ID for this managed resource.

    registrationCount Integer

    The number of managed instances that are currently registered using this activation.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode string

    The code the system generates when it processes the activation.

    expired boolean

    If the current activation has expired.

    id string

    The provider-assigned unique ID for this managed resource.

    registrationCount number

    The number of managed instances that are currently registered using this activation.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activation_code str

    The code the system generates when it processes the activation.

    expired bool

    If the current activation has expired.

    id str

    The provider-assigned unique ID for this managed resource.

    registration_count int

    The number of managed instances that are currently registered using this activation.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode String

    The code the system generates when it processes the activation.

    expired Boolean

    If the current activation has expired.

    id String

    The provider-assigned unique ID for this managed resource.

    registrationCount Number

    The number of managed instances that are currently registered using this activation.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Look up Existing Activation Resource

    Get an existing Activation 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?: ActivationState, opts?: CustomResourceOptions): Activation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            activation_code: Optional[str] = None,
            description: Optional[str] = None,
            expiration_date: Optional[str] = None,
            expired: Optional[bool] = None,
            iam_role: Optional[str] = None,
            name: Optional[str] = None,
            registration_count: Optional[int] = None,
            registration_limit: Optional[int] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> Activation
    func GetActivation(ctx *Context, name string, id IDInput, state *ActivationState, opts ...ResourceOption) (*Activation, error)
    public static Activation Get(string name, Input<string> id, ActivationState? state, CustomResourceOptions? opts = null)
    public static Activation get(String name, Output<String> id, ActivationState 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:
    ActivationCode string

    The code the system generates when it processes the activation.

    Description string

    The description of the resource that you want to register.

    ExpirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    Expired bool

    If the current activation has expired.

    IamRole string

    The IAM Role to attach to the managed instance.

    Name string

    The default name of the registered managed instance.

    RegistrationCount int

    The number of managed instances that are currently registered using this activation.

    RegistrationLimit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    Tags Dictionary<string, string>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    ActivationCode string

    The code the system generates when it processes the activation.

    Description string

    The description of the resource that you want to register.

    ExpirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    Expired bool

    If the current activation has expired.

    IamRole string

    The IAM Role to attach to the managed instance.

    Name string

    The default name of the registered managed instance.

    RegistrationCount int

    The number of managed instances that are currently registered using this activation.

    RegistrationLimit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    Tags map[string]string

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode String

    The code the system generates when it processes the activation.

    description String

    The description of the resource that you want to register.

    expirationDate String

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    expired Boolean

    If the current activation has expired.

    iamRole String

    The IAM Role to attach to the managed instance.

    name String

    The default name of the registered managed instance.

    registrationCount Integer

    The number of managed instances that are currently registered using this activation.

    registrationLimit Integer

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Map<String,String>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode string

    The code the system generates when it processes the activation.

    description string

    The description of the resource that you want to register.

    expirationDate string

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    expired boolean

    If the current activation has expired.

    iamRole string

    The IAM Role to attach to the managed instance.

    name string

    The default name of the registered managed instance.

    registrationCount number

    The number of managed instances that are currently registered using this activation.

    registrationLimit number

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags {[key: string]: string}

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activation_code str

    The code the system generates when it processes the activation.

    description str

    The description of the resource that you want to register.

    expiration_date str

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    expired bool

    If the current activation has expired.

    iam_role str

    The IAM Role to attach to the managed instance.

    name str

    The default name of the registered managed instance.

    registration_count int

    The number of managed instances that are currently registered using this activation.

    registration_limit int

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Mapping[str, str]

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    activationCode String

    The code the system generates when it processes the activation.

    description String

    The description of the resource that you want to register.

    expirationDate String

    UTC timestamp in RFC3339 format by which this activation request should expire. The default value is 24 hours from resource creation time. This provider will only perform drift detection of its value when present in a configuration.

    expired Boolean

    If the current activation has expired.

    iamRole String

    The IAM Role to attach to the managed instance.

    name String

    The default name of the registered managed instance.

    registrationCount Number

    The number of managed instances that are currently registered using this activation.

    registrationLimit Number

    The maximum number of managed instances you want to register. The default value is 1 instance.

    tags Map<String>

    A map of tags to assign to the object. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Import

    AWS SSM Activation can be imported using the id, e.g.,

     $ pulumi import aws:ssm/activation:Activation example e488f2f6-e686-4afb-8a04-ef6dfEXAMPLE
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi