Class Activation


  • public class Activation
    extends com.pulumi.resources.CustomResource
    Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command. ## Example Usage <!--Start PulumiCodeChooser -->
     
     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()
                 .name("test_role")
                 .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()
                 .name("test_ssm_activation")
                 .description("Test")
                 .iamRole(testRole.id())
                 .registrationLimit("5")
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(testAttach)
                     .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import AWS SSM Activation using the `id`. For example: ```sh $ pulumi import aws:ssm/activation:Activation example e488f2f6-e686-4afb-8a04-ef6dfEXAMPLE ``` -> __Note:__ The `activation_code` attribute cannot be imported.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> activationCode()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.lang.String> expirationDate()  
      com.pulumi.core.Output<java.lang.Boolean> expired()  
      static Activation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ActivationState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> iamRole()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.Integer> registrationCount()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> registrationLimit()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Activation

        public Activation​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Activation

        public Activation​(java.lang.String name,
                          ActivationArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Activation

        public Activation​(java.lang.String name,
                          ActivationArgs args,
                          @Nullable
                          com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • activationCode

        public com.pulumi.core.Output<java.lang.String> activationCode()
        Returns:
        The code the system generates when it processes the activation.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        The description of the resource that you want to register.
      • expirationDate

        public com.pulumi.core.Output<java.lang.String> expirationDate()
        Returns:
        UTC timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) 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

        public com.pulumi.core.Output<java.lang.Boolean> expired()
        Returns:
        If the current activation has expired.
      • iamRole

        public com.pulumi.core.Output<java.lang.String> iamRole()
        Returns:
        The IAM Role to attach to the managed instance.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The default name of the registered managed instance.
      • registrationCount

        public com.pulumi.core.Output<java.lang.Integer> registrationCount()
        Returns:
        The number of managed instances that are currently registered using this activation.
      • registrationLimit

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> registrationLimit()
        Returns:
        The maximum number of managed instances you want to register. The default value is 1 instance.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        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

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • get

        public static Activation get​(java.lang.String name,
                                     com.pulumi.core.Output<java.lang.String> id,
                                     @Nullable
                                     ActivationState state,
                                     @Nullable
                                     com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.