I have two Cloudformation files being used to make two different stacks containing a VPC each. One is an admin VPC that will be used to access the other VPC via ssh and all that, typical bastiony use case.

I spin up the admin VPC and then pass its ID into the second CF file as a parameter specifically with the VPC Id type:

"AdminVPC": {
  "Description": "ID of the admin VPC",
  "Type": "AWS::EC2::VPC::Id"

But then when I am trying to set up the network ACL of the VPC, I am doing

"Type": "AWS::EC2::NetworkAclEntry",
  "Properties": {
    "CidrBlock": {
      "Fn::GetAtt": [
          "Ref": "AdminVPC"

Which, when I run a ecs cf validate, yields only the message

An error occurred (ValidationError) when calling the ValidateTemplate operation: Internal Failure

It works fine if I just hardcode in a CIDR block like

"CidrBlock": "",

But the docs claim that:

  1. Using a GetAtt to get the CIDR block off the vpc ID should work
  2. For the Fn::GetAtt attribute name, you can use the Ref function.

So I'm not sure what is wrong with this usage...

1 Answer 1


the first argument to Fn::GetAtt must be the name of logical resource defined in your template, so the string must be one of the Resources created within the template.

When using AWS Parameter types all that gets passed to the template is the id of that resource, therefore the only value contained in {"Ref": "AdminVPC"} would be some like vpc-abc123 . You don't pass the VPC to the template, just its id.

The solution to your problem would be to accept the CIDR as a parameter into the template, the template creating the VPC should have an Output that Uses {"Fn::GetAtt": ["AdminVPC", "CidrBlock"]}

  • 1
    OK thanks! I guess I figured if I was going to the trouble of declaring it as a VPC Id instead of just a string as a parameter that I could treat it as a VPC Id and it'd look it up like any other one defined locally. Aug 26, 2016 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .