AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

Activation

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var testRole = new Aws.Iam.Role("testRole", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"  {
    ""Version"": ""2012-10-17"",
    ""Statement"": {
      ""Effect"": ""Allow"",
      ""Principal"": {""Service"": ""ssm.amazonaws.com""},
      ""Action"": ""sts:AssumeRole""
    }
  }
",
        });
        var testAttach = new Aws.Iam.RolePolicyAttachment("testAttach", new Aws.Iam.RolePolicyAttachmentArgs
        {
            Role = testRole.Name,
            PolicyArn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
        });
        var foo = new Aws.Ssm.Activation("foo", new Aws.Ssm.ActivationArgs
        {
            Description = "Test",
            IamRole = testRole.Id,
            RegistrationLimit = 5,
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                testAttach,
            },
        });
    }

}
package main

import (
	"fmt"

	"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 {
		testRole, err := iam.NewRole(ctx, "testRole", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf("%v%v%v%v%v%v%v%v", "  {\n", "    \"Version\": \"2012-10-17\",\n", "    \"Statement\": {\n", "      \"Effect\": \"Allow\",\n", "      \"Principal\": {\"Service\": \"ssm.amazonaws.com\"},\n", "      \"Action\": \"sts:AssumeRole\"\n", "    }\n", "  }\n")),
		})
		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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import com.pulumi.resources.CustomResourceOptions;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testRole = new Role("testRole", RoleArgs.builder()        
            .assumeRolePolicy("""
  {
    "Version": "2012-10-17",
    "Statement": {
      "Effect": "Allow",
      "Principal": {"Service": "ssm.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  }
            """)
            .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

test_role = aws.iam.Role("testRole", assume_role_policy="""  {
    "Version": "2012-10-17",
    "Statement": {
      "Effect": "Allow",
      "Principal": {"Service": "ssm.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  }
""")
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 testRole = new aws.iam.Role("testRole", {assumeRolePolicy: `  {
    "Version": "2012-10-17",
    "Statement": {
      "Effect": "Allow",
      "Principal": {"Service": "ssm.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  }
`});
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: |2
          {
            "Version": "2012-10-17",
            "Statement": {
              "Effect": "Allow",
              "Principal": {"Service": "ssm.amazonaws.com"},
              "Action": "sts:AssumeRole"
            }
          }
  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}

Create a 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 .

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 .

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 .

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 .

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 .

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 .

Look up an 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 .

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 .

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 .

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 .

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 .

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 .

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
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.