Skip to content

Add a method for generating physical resource ids like the Java plugin (but better) #85

Description

@benkehoe

Existing CloudFormation resources, when not given an explicit name, use the pattern {StackName}-{LogicalId}-{RandomSuffix}. This is useful as it helps users easily find resources corresponding to a given stack among many resources created by identical templates (e.g., they all have the same logical id but are in different stacks). The Java plugin provides a utility function, generateResourceIdentifier, that can take a logical id and create an identifier. However, it doesn't take stack name. The Python plugin should create a utility function that takes both stack name and logical id. Users could just pass in the logical id as {StackName}-{LogicalId}, but a) they may not think to do so, and b) this prevents the method from smartly trimming down these values in the face of length constraints, which CloudFormation usually does.

Would this go in resource.py or utils.py? We have an implementation in our CFN custom resource library that could be simplified and used here.

Activity

  1. jaymccon commented on Mar 31, 2020

    @jaymccon
    Contributor

    perhaps making this a method of ResourceHandlerRequest would make sense, if stack id is added as an attribute, then we'd have both logical id and stack id, so wouldn't need to take any inputs.

  2. self-assigned this
    on Oct 2, 2020
  3. linked a pull request that will close this issueIdentifier Utils Module #126on Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions