aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

[ AWS::Cloudformation::Stack ] Support for custom-named NestedStacks #1836

Open greg5123334 opened 9 months ago

greg5123334 commented 9 months ago

Name of the resource

AWS::CloudFormation::Stack

Resource name

No response

Description

Currently, it seems that there is no way to apply custom naming conventions to NestedStacks. They default to the following convention: {ParentStackName}-{LogicalId}-{GUID}

The StackName is documented, and found in the resource type's schema:

Upon deployment, the parent stack fails to create NestedStack with: Encountered unsupported property StackName

Kindly consider allowing customized NestedStack names

Schema aws cloudformation describe-type --type-name AWS::CloudFormation::Stack --type RESOURCE --output json > aws-cloudformation-stack.json

{
    "typeName": "AWS::CloudFormation::Stack",
    "description": "The AWS::CloudFormation::Stack resource nests a stack as a resource in a top-level template.",
    "additionalProperties": false,
    "properties": {
      "Capabilities": {
        "type": "array",
        "uniqueItems": false,
        "items": {
          "type": "string",
          "enum": [
            "CAPABILITY_IAM",
            "CAPABILITY_NAMED_IAM",
            "CAPABILITY_AUTO_EXPAND"
          ]
        }
      },
      "RoleARN": {
        "type": "string"
      },
      "Outputs": {
        "type": "array",
        "uniqueItems": false,
        "items": {
          "$ref": "#/definitions/Output"
        }
      },
      "Description": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      },
      "DisableRollback": {
        "type": "boolean"
      },
      "EnableTerminationProtection": {
        "type": "boolean"
      },
      "NotificationARNs": {
        "type": "array",
        "uniqueItems": false,
        "items": {
          "type": "string"
        },
        "maxItems": 5
      },
      "Parameters": {
        "type": "object",
        "additionalProperties": false,
        "patternProperties": {
          "[a-zA-Z0-9]+": {
            "type": "string"
          }
        }
      },
      "ParentId": {
        "type": "string"
      },
      "RootId": {
        "type": "string"
      },
      "ChangeSetId": {
        "type": "string"
      },
      "StackName": {
        "type": "string"
      },
      "StackId": {
        "type": "string"
      },
      "StackPolicyBody": {
        "type": "object"
      },
      "StackPolicyURL": {
        "type": "string"
      },
      "StackStatus": {
        "type": "string",
        "enum": [
          "CREATE_IN_PROGRESS",
          "CREATE_FAILED",
          "CREATE_COMPLETE",
          "ROLLBACK_IN_PROGRESS",
          "ROLLBACK_FAILED",
          "ROLLBACK_COMPLETE",
          "DELETE_IN_PROGRESS",
          "DELETE_FAILED",
          "DELETE_COMPLETE",
          "UPDATE_IN_PROGRESS",
          "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS",
          "UPDATE_COMPLETE",
          "UPDATE_FAILED",
          "UPDATE_ROLLBACK_IN_PROGRESS",
          "UPDATE_ROLLBACK_FAILED",
          "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS",
          "UPDATE_ROLLBACK_COMPLETE",
          "REVIEW_IN_PROGRESS",
          "IMPORT_IN_PROGRESS",
          "IMPORT_COMPLETE",
          "IMPORT_ROLLBACK_IN_PROGRESS",
          "IMPORT_ROLLBACK_FAILED",
          "IMPORT_ROLLBACK_COMPLETE"
        ]
      },
      "StackStatusReason": {
        "type": "string"
      },
      "Tags": {
        "type": "array",
        "uniqueItems": false,
        "insertionOrder": false,
        "items": {
          "$ref": "#/definitions/Tag"
        },
        "maxItems": 50
      },
      "TemplateBody": {
        "type": "object"
      },
      "TemplateURL": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      },
      "TimeoutInMinutes": {
        "type": "integer",
        "minimum": 1
      },
      "LastUpdateTime": {
        "type": "string"
      },
      "CreationTime": {
        "type": "string"
      }
    },
    "definitions": {
      "Tag": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "Key": {
            "type": "string"
          },
          "Value": {
            "type": "string"
          }
        },
        "required": [
          "Value",
          "Key"
        ]
      },
      "Output": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "Description": {
            "type": "string"
          },
          "ExportName": {
            "type": "string"
          },
          "OutputKey": {
            "type": "string"
          },
          "OutputValue": {
            "type": "string"
          }
        }
      }
    },
    "required": [
      "StackName"
    ],
    "readOnlyProperties": [
      "/properties/StackId",
      "/properties/StackStatus",
      "/properties/CreationTime",
      "/properties/RootId",
      "/properties/ParentId",
      "/properties/ChangeSetId",
      "/properties/Outputs",
      "/properties/LastUpdateTime"
    ],
    "writeOnlyProperties": [
      "/properties/TemplateURL",
      "/properties/StackPolicyURL"
    ],
    "createOnlyProperties": [
      "/properties/StackName"
    ],
    "primaryIdentifier": [
      "/properties/StackId"
    ],
    "additionalIdentifiers": [
      [
        "/properties/StackName"
      ]
    ],
    "tagging": {
      "taggable": true,
      "tagOnCreate": true,
      "tagUpdatable": true,
      "cloudFormationSystemTags": true,
      "tagProperty": "/properties/Tags"
    },
    "handlers": {
      "create": {
        "permissions": [
          "cloudformation:DescribeStacks",
          "cloudformation:CreateStack",
          "iam:PassRole"
        ]
      },
      "update": {
        "permissions": [
          "cloudformation:DescribeStacks",
          "cloudformation:UpdateStack",
          "cloudformation:UpdateTerminationProtection",
          "cloudformation:SetStackPolicy",
          "iam:PassRole"
        ]
      },
      "delete": {
        "permissions": [
          "cloudformation:DescribeStacks",
          "cloudformation:DeleteStack"
        ]
      },
      "read": {
        "permissions": [
          "cloudformation:DescribeStacks",
          "cloudformation:GetStackPolicy",
          "cloudformation:GetTemplate"
        ]
      },
      "list": {
        "permissions": [
          "cloudformation:ListStacks"
        ]
      }
    }
  }

Other Details

No response

jk2l commented 9 months ago

It will be great, i often found finding child stack is difficult when the name is unpredictable