Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref and GetAtt Specificiations #34

Closed
kddejong opened this issue May 4, 2018 · 1 comment
Closed

Ref and GetAtt Specificiations #34

kddejong opened this issue May 4, 2018 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@kddejong
Copy link
Contributor

kddejong commented May 4, 2018

I've been writing some individual checks that would check the Ref or GeAtt of resource properties.

For example we would check the that a Ref for VpcId goes to a resource of AWS::EC2::VPC. If it was to a parameter we would check the parameter is of appropriate type (String, AWS::EC2::VPC::Id)

Type: "AWS::EC2::Subnet"
Properties:
  CidrBlock: String
  VpcId: String

After writing a few of these I'm starting to see a lot of repeat and I'm wondering if this would be better defined in a JSON/YAML document. We can then write a singular rule to check these items limiting repeated code.
An example of that document is as follows.

{
  "RelationshipTypes": {
    "String": {
      "Ref": {
        "Parameters": [
          "String"
        ]
      }
    },
    "VpcId": {
      "Ref": {
        "Resources": [
          "AWS::EC2::VPC"
        ],
        "Parameters": [
          "String",
          "AWS::EC2::VPC::Id"
        ]
      },
      "GetAtt": {
        "AWS::EC2::SecurityGroup": "VpcId"
      }
    }
  },
  "ResourceTypes": {
    "AWS::EC2::Subnet": {
      "Properties": {
        "VpcId": {
          "RelationshipType": "VpcId"
        },
        "MapPublicIpOnLaunch": {
          "RelationshipType": "String"
        }
      }
    }
  }
}
@kddejong kddejong added enhancement New feature or request question Further information is requested labels May 4, 2018
@kddejong kddejong mentioned this issue May 8, 2018
73 tasks
@kddejong
Copy link
Contributor Author

This model is built out. Going to call this done for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant