Class Stack


  • public class Stack
    extends com.pulumi.resources.CustomResource
    Provides a CloudFormation Stack resource. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudformation.Stack;
     import com.pulumi.aws.cloudformation.StackArgs;
     import static com.pulumi.codegen.internal.Serialization.*;
     import java.util.ArrayList;
     import java.util.Arrays;
     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 network = new Stack("network", StackArgs.builder()
                 .name("networking-stack")
                 .parameters(Map.of("VPCCidr", "10.0.0.0/16"))
                 .templateBody(serializeJson(
                     jsonObject(
                         jsonProperty("Parameters", jsonObject(
                             jsonProperty("VPCCidr", jsonObject(
                                 jsonProperty("Type", "String"),
                                 jsonProperty("Default", "10.0.0.0/16"),
                                 jsonProperty("Description", "Enter the CIDR block for the VPC. Default is 10.0.0.0/16.")
                             ))
                         )),
                         jsonProperty("Resources", jsonObject(
                             jsonProperty("myVpc", jsonObject(
                                 jsonProperty("Type", "AWS::EC2::VPC"),
                                 jsonProperty("Properties", jsonObject(
                                     jsonProperty("CidrBlock", jsonObject(
                                         jsonProperty("Ref", "VPCCidr")
                                     )),
                                     jsonProperty("Tags", jsonArray(jsonObject(
                                         jsonProperty("Key", "Name"),
                                         jsonProperty("Value", "Primary_CF_VPC")
                                     )))
                                 ))
                             ))
                         ))
                     )))
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import CloudFormation Stacks using the `name`. For example: ```sh $ pulumi import aws:cloudformation/stack:Stack stack networking-stack ```
    • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      Stack​(java.lang.String name)  
      Stack​(java.lang.String name, StackArgs args)  
      Stack​(java.lang.String name, StackArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> capabilities()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disableRollback()  
      static Stack get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, StackState 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.util.Optional<java.lang.String>> iamRoleArn()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> notificationArns()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> onFailure()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> outputs()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> parameters()  
      com.pulumi.core.Output<java.lang.String> policyBody()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> policyUrl()  
      com.pulumi.core.Output<java.lang.String> region()  
      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()  
      com.pulumi.core.Output<java.lang.String> templateBody()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateUrl()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> timeoutInMinutes()  
      • 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

      • Stack

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

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

        public Stack​(java.lang.String name,
                     @Nullable
                     StackArgs 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

      • capabilities

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> capabilities()
        Returns:
        A list of capabilities. Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND`
      • disableRollback

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disableRollback()
        Returns:
        Set to true to disable rollback of the stack if stack creation failed. Conflicts with `onFailure`.
      • iamRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> iamRoleArn()
        Returns:
        The ARN of an IAM role that AWS CloudFormation assumes to create the stack. If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Stack name.
      • notificationArns

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> notificationArns()
        Returns:
        A list of SNS topic ARNs to publish stack related events.
      • onFailure

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> onFailure()
        Returns:
        Action to be taken if stack creation fails. This must be one of: `DO_NOTHING`, `ROLLBACK`, or `DELETE`. Conflicts with `disableRollback`.
      • outputs

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> outputs()
        Returns:
        A map of outputs from the stack.
      • parameters

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> parameters()
        Returns:
        A map of Parameter structures that specify input parameters for the stack.
      • policyBody

        public com.pulumi.core.Output<java.lang.String> policyBody()
        Returns:
        Structure containing the stack policy body. Conflicts w/ `policyUrl`.
      • policyUrl

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> policyUrl()
        Returns:
        Location of a file containing the stack policy. Conflicts w/ `policyBody`.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of resource tags to associate with this stack. .If configured with a provider `defaultTags` 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 `defaultTags` configuration block.
      • templateBody

        public com.pulumi.core.Output<java.lang.String> templateBody()
        Returns:
        Structure containing the template body (max size: 51,200 bytes).
      • templateUrl

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateUrl()
        Returns:
        Location of a file containing the template body (max size: 460,800 bytes).
      • timeoutInMinutes

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> timeoutInMinutes()
        Returns:
        The amount of time that can pass before the stack status becomes `CREATE_FAILED`.
      • get

        public static Stack get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                StackState 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.