AWS CLI Cloudformation OperationInProgressException when calling the CreateStackInstances operation











up vote
1
down vote

favorite
1












I'm using the aws cli to create a cloudformation stackset



echo "creating stackset..."



some_stackset_id=$(aws cloudformation create-stack-set 
--stack-set-name $StacksetName
--template-url $TemplateURL
--capabilities '["CAPABILITY_NAMED_IAM"]'
--administration-role-arn "arn:aws:iam::000000000009:role/AWSCloudFormationStackSetAdministrationRole"
--execution-role-name "AWSCloudFormationStackSetExecutionRole"
--parameters '[
{"ParameterKey":"env","ParameterValue":"DEV","UsePreviousValue": false, "ResolvedValue": "DEV"}

]'
| jq '.StackSetId')


echo "Waiting for stack instance to be created ..."



aws cloudformation wait stack-create-complete 
--region $region
--stack-name $some_stackset_id


echo "Creating stack instances..."



some_id=$(aws cloudformation create-stack-instances 
--stack-set-name myStackset
--accounts '["0000030000"]'
--regions '["us-east-1"]'
--operation-preferences='
{
"RegionOrder": ["us-east-1"],
"FailureToleranceCount": 0,
"MaxConcurrentCount": 3
}' | jq '.OperationId')


echo "Done creating stack instances"



When I wait for the stackset to finish creating before I can create stack instances within that stackset, the cli is supposed to




Wait until stack status is CREATE_COMPLETE. It will poll every 30
seconds until a successful state has been reached. This will exit with
a return code of 255 after 120 failed checks.
https://docs.aws.amazon.com/cli/latest/reference/cloudformation/wait/stack-create-complete.html




However, that's not the behavior i'm observing. As soon as the cli gets to that aws cloudformation wait stack-create-complete... it doesn't wait there for 30 secs as it's supposed to according to the cli doc, instead, it just moves on to the next command (create-stack-instances) which fails with OperationInProgressException any idea why?










share|improve this question

















This question has an open bounty worth +50
reputation from pelican ending in 12 hours.


This question has not received enough attention.




















    up vote
    1
    down vote

    favorite
    1












    I'm using the aws cli to create a cloudformation stackset



    echo "creating stackset..."



    some_stackset_id=$(aws cloudformation create-stack-set 
    --stack-set-name $StacksetName
    --template-url $TemplateURL
    --capabilities '["CAPABILITY_NAMED_IAM"]'
    --administration-role-arn "arn:aws:iam::000000000009:role/AWSCloudFormationStackSetAdministrationRole"
    --execution-role-name "AWSCloudFormationStackSetExecutionRole"
    --parameters '[
    {"ParameterKey":"env","ParameterValue":"DEV","UsePreviousValue": false, "ResolvedValue": "DEV"}

    ]'
    | jq '.StackSetId')


    echo "Waiting for stack instance to be created ..."



    aws cloudformation wait stack-create-complete 
    --region $region
    --stack-name $some_stackset_id


    echo "Creating stack instances..."



    some_id=$(aws cloudformation create-stack-instances 
    --stack-set-name myStackset
    --accounts '["0000030000"]'
    --regions '["us-east-1"]'
    --operation-preferences='
    {
    "RegionOrder": ["us-east-1"],
    "FailureToleranceCount": 0,
    "MaxConcurrentCount": 3
    }' | jq '.OperationId')


    echo "Done creating stack instances"



    When I wait for the stackset to finish creating before I can create stack instances within that stackset, the cli is supposed to




    Wait until stack status is CREATE_COMPLETE. It will poll every 30
    seconds until a successful state has been reached. This will exit with
    a return code of 255 after 120 failed checks.
    https://docs.aws.amazon.com/cli/latest/reference/cloudformation/wait/stack-create-complete.html




    However, that's not the behavior i'm observing. As soon as the cli gets to that aws cloudformation wait stack-create-complete... it doesn't wait there for 30 secs as it's supposed to according to the cli doc, instead, it just moves on to the next command (create-stack-instances) which fails with OperationInProgressException any idea why?










    share|improve this question

















    This question has an open bounty worth +50
    reputation from pelican ending in 12 hours.


    This question has not received enough attention.


















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I'm using the aws cli to create a cloudformation stackset



      echo "creating stackset..."



      some_stackset_id=$(aws cloudformation create-stack-set 
      --stack-set-name $StacksetName
      --template-url $TemplateURL
      --capabilities '["CAPABILITY_NAMED_IAM"]'
      --administration-role-arn "arn:aws:iam::000000000009:role/AWSCloudFormationStackSetAdministrationRole"
      --execution-role-name "AWSCloudFormationStackSetExecutionRole"
      --parameters '[
      {"ParameterKey":"env","ParameterValue":"DEV","UsePreviousValue": false, "ResolvedValue": "DEV"}

      ]'
      | jq '.StackSetId')


      echo "Waiting for stack instance to be created ..."



      aws cloudformation wait stack-create-complete 
      --region $region
      --stack-name $some_stackset_id


      echo "Creating stack instances..."



      some_id=$(aws cloudformation create-stack-instances 
      --stack-set-name myStackset
      --accounts '["0000030000"]'
      --regions '["us-east-1"]'
      --operation-preferences='
      {
      "RegionOrder": ["us-east-1"],
      "FailureToleranceCount": 0,
      "MaxConcurrentCount": 3
      }' | jq '.OperationId')


      echo "Done creating stack instances"



      When I wait for the stackset to finish creating before I can create stack instances within that stackset, the cli is supposed to




      Wait until stack status is CREATE_COMPLETE. It will poll every 30
      seconds until a successful state has been reached. This will exit with
      a return code of 255 after 120 failed checks.
      https://docs.aws.amazon.com/cli/latest/reference/cloudformation/wait/stack-create-complete.html




      However, that's not the behavior i'm observing. As soon as the cli gets to that aws cloudformation wait stack-create-complete... it doesn't wait there for 30 secs as it's supposed to according to the cli doc, instead, it just moves on to the next command (create-stack-instances) which fails with OperationInProgressException any idea why?










      share|improve this question















      I'm using the aws cli to create a cloudformation stackset



      echo "creating stackset..."



      some_stackset_id=$(aws cloudformation create-stack-set 
      --stack-set-name $StacksetName
      --template-url $TemplateURL
      --capabilities '["CAPABILITY_NAMED_IAM"]'
      --administration-role-arn "arn:aws:iam::000000000009:role/AWSCloudFormationStackSetAdministrationRole"
      --execution-role-name "AWSCloudFormationStackSetExecutionRole"
      --parameters '[
      {"ParameterKey":"env","ParameterValue":"DEV","UsePreviousValue": false, "ResolvedValue": "DEV"}

      ]'
      | jq '.StackSetId')


      echo "Waiting for stack instance to be created ..."



      aws cloudformation wait stack-create-complete 
      --region $region
      --stack-name $some_stackset_id


      echo "Creating stack instances..."



      some_id=$(aws cloudformation create-stack-instances 
      --stack-set-name myStackset
      --accounts '["0000030000"]'
      --regions '["us-east-1"]'
      --operation-preferences='
      {
      "RegionOrder": ["us-east-1"],
      "FailureToleranceCount": 0,
      "MaxConcurrentCount": 3
      }' | jq '.OperationId')


      echo "Done creating stack instances"



      When I wait for the stackset to finish creating before I can create stack instances within that stackset, the cli is supposed to




      Wait until stack status is CREATE_COMPLETE. It will poll every 30
      seconds until a successful state has been reached. This will exit with
      a return code of 255 after 120 failed checks.
      https://docs.aws.amazon.com/cli/latest/reference/cloudformation/wait/stack-create-complete.html




      However, that's not the behavior i'm observing. As soon as the cli gets to that aws cloudformation wait stack-create-complete... it doesn't wait there for 30 secs as it's supposed to according to the cli doc, instead, it just moves on to the next command (create-stack-instances) which fails with OperationInProgressException any idea why?







      amazon-web-services amazon-cloudformation aws-cli






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 at 16:04

























      asked Nov 19 at 15:41









      pelican

      1,21921435




      1,21921435






      This question has an open bounty worth +50
      reputation from pelican ending in 12 hours.


      This question has not received enough attention.








      This question has an open bounty worth +50
      reputation from pelican ending in 12 hours.


      This question has not received enough attention.


























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          A Cloudformation stackSet is different from a stack. The waiter you are using aws cloudformation wait stack-create-complete is for stacks, not stackSets. Unfortunately there is no waiter for stackSets at this time, though using a bash loops is not difficult to create your own waiter.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378108%2faws-cli-cloudformation-operationinprogressexception-when-calling-the-createstack%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            A Cloudformation stackSet is different from a stack. The waiter you are using aws cloudformation wait stack-create-complete is for stacks, not stackSets. Unfortunately there is no waiter for stackSets at this time, though using a bash loops is not difficult to create your own waiter.






            share|improve this answer

























              up vote
              0
              down vote













              A Cloudformation stackSet is different from a stack. The waiter you are using aws cloudformation wait stack-create-complete is for stacks, not stackSets. Unfortunately there is no waiter for stackSets at this time, though using a bash loops is not difficult to create your own waiter.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                A Cloudformation stackSet is different from a stack. The waiter you are using aws cloudformation wait stack-create-complete is for stacks, not stackSets. Unfortunately there is no waiter for stackSets at this time, though using a bash loops is not difficult to create your own waiter.






                share|improve this answer












                A Cloudformation stackSet is different from a stack. The waiter you are using aws cloudformation wait stack-create-complete is for stacks, not stackSets. Unfortunately there is no waiter for stackSets at this time, though using a bash loops is not difficult to create your own waiter.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                cementblocks

                1,368613




                1,368613






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378108%2faws-cli-cloudformation-operationinprogressexception-when-calling-the-createstack%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python