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
        {
            PolicyArn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
            Role = testRole.Name,
        });
        var foo = new Aws.Ssm.Activation("foo", new Aws.Ssm.ActivationArgs
        {
            Description = "Test",
            IamRole = testRole.Id,
            RegistrationLimit = 5,
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                "aws_iam_role_policy_attachment.test_attach",
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ssm"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        testRole, err := iam.NewRole(ctx, "testRole", &iam.RoleArgs{
            AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%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", "\n")),
        })
        if err != nil {
            return err
        }
        _, err = iam.NewRolePolicyAttachment(ctx, "testAttach", &iam.RolePolicyAttachmentArgs{
            PolicyArn: pulumi.String("arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"),
            Role:      testRole.Name,
        })
        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{
            "aws_iam_role_policy_attachment.test_attach",
        }))
        if err != nil {
            return err
        }
        return nil
    })
}
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",
    policy_arn="arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
    role=test_role.name)
foo = aws.ssm.Activation("foo",
    description="Test",
    iam_role=test_role.id,
    registration_limit="5",
    opts=ResourceOptions(depends_on=["aws_iam_role_policy_attachment.test_attach"]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testRole = new aws.iam.Role("test_role", {
    assumeRolePolicy: `  {
    "Version": "2012-10-17",
    "Statement": {
      "Effect": "Allow",
      "Principal": {"Service": "ssm.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  }
`,
});
const testAttach = new aws.iam.RolePolicyAttachment("test_attach", {
    policyArn: "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
    role: testRole.name,
});
const foo = new aws.ssm.Activation("foo", {
    description: "Test",
    iamRole: testRole.id,
    registrationLimit: 5,
}, { dependsOn: [testAttach] });

Create a Activation Resource

def Activation(resource_name, opts=None, description=None, expiration_date=None, iam_role=None, name=None, registration_limit=None, tags=None, __props__=None);
func NewActivation(ctx *Context, name string, args ActivationArgs, opts ...ResourceOption) (*Activation, error)
public Activation(string name, ActivationArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Activation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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.

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.

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.

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 float

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

tags Dict[str, str]

A map of tags to assign to the object.

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.

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.

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.

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 float

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

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
static get(resource_name, id, opts=None, activation_code=None, description=None, expiration_date=None, expired=None, iam_role=None, name=None, registration_count=None, registration_limit=None, tags=None, __props__=None);
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)
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.

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.

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.

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.

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 float

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

registration_limit float

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

tags Dict[str, str]

A map of tags to assign to the object.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.