question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting the following error: "Unresolved resource dependencies [GeneralPurposeContainerRole] in the Resources block of the template"

See original GitHub issue

Upon testing my cloudformation template, I was receiving the following error:

An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: Unresolved resource dependencies [GeneralPurposeContainerRole] in the Resources block of the template

I don’t understand what specifically this error is pointing to. Below is the part of the template that appears to be the source of the error:

Resources:
  GeneralPurposeContainerRole:
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - ecs-tasks.amazonaws.com
            Action:
            - sts:AssumeRole
      Path: '/'
      Policies:
        - PolicyName: ContainerS3Access
          PolicyDocument:
            Statement:
            - Effect: Allow
              Action:
              - s3:PutObject
              - s3:GetObject
              - s3:DeleteObject
              - s3:List*
              Resource:
                # TODO: Make these non psychcore-specific
              - arn:aws:s3:::pipeline-validation/*
              - arn:aws:s3:::wgs-pipeline-vqsr-test/*
              - arn:aws:s3:::test-references/*
              - arn:aws:s3:::psychcore-pipelines/output/*
              - arn:aws:s3:::psychcore-pipelines/validation/samples/*
              - arn:aws:s3:::psychcore-data/reference_indexs/*
              - arn:aws:s3:::psychcore-pipelines
              - arn:aws:s3:::psychcore-pipelines
              - arn:aws:s3:::psychcore-data
              - arn:aws:s3:::*
            - Effect: Allow
              Action:
              - s3:List*
              - s3:ListMultipartUploadParts
              - s3:AbortMultipartUpload
              - s3:ListBucketMultipartUploads
              Resource:
              - arn:aws:s3:::pipeline-validation
              - arn:aws:s3:::wgs-pipeline-vqsr-test
              - arn:aws:s3:::test-references
              - arn:aws:s3:::psychcore-pipelines/output/
              - arn:aws:s3:::psychcore-pipelines/validation/samples/
              - arn:aws:s3:::psychcore-data/reference_indexs/
              - arn:aws:s3:::psychcore-pipelines
              - arn:aws:s3:::psychcore-pipelines
              - arn:aws:s3:::psychcore-data
              - arn:aws:s3:::*

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
svdgraafcommented, Feb 20, 2018

I’m not an expert on these nested stacks, but isn’t it so, that the nested stacks only can use resources from their parents and not vice versa?

@claudiadast @HyperBrain This is not entirely correct. While you cannot reference the resources directly, you can reference the outputs from the substack. You will need to output the values that you need in the substack, and you can them reference in the main stack as a property of your substack (eg: mySubStack.myOutputtedValue. See the docs here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html

This is also how you can pass on references from substacks into other substacks within your main template, passing the outputs as parameters in the target substacks. Be aware that you can easily create circular references though 😄 Cloudformation will usually be very good in figuring out the order in which to create things.

I think this is also the problem here, but it’s hard to determine based on just this snippet. Double check that there is no reference to the resource in the main stack. If there is, you need to pass back the Arn of the role as an output in the substack. You can then reference that Arn where you need it in the main stack.

0reactions
pmuenscommented, Jul 30, 2019

Closing this issue since it’s quite stale. Please refer to the Serverless Forums or Gitter where issues like this can be discussed with our broad developer community.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Template format error: Unresolved resource dependencies in ...
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template.
Read more >
Template format error: Unresolved resource dependencies
I try to create an EC2 instance with the template below: Parameters: KeyName: ...
Read more >
Resolve template validation or template format errors in ... - AWS
These templates return the following error: "Unresolved resource dependencies [test] in the Resources block of the template.
Read more >
Template format error: Unresolved resource dependencies ...
I have an existing project that I made some minor text edits to and then deployed and it errors with the message below....
Read more >
Bug: Unresolved resource dependencies [ASGBucket ... - GitLab
... and set a preexisting bucket name I get the following error: ... dependencies [ASGBucket] in the Resources block of the template.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found