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

feat(core): automatic cross stack, cross region references (under feature flag) #22008

Merged
merged 37 commits into from Oct 31, 2022

Commits on Sep 12, 2022

  1. feat(core): automatic cross stack, cross region references

    This PR adds the ability to automatically create references in
    cross-region stacks. You can now do something like
    
    ```ts
    const stack1 = new Stack(app, 'Stack1', { env: { region: 'us-east-1' } });
    const cert = new certificatemanager.Certificate(stack1, 'Cert', {...});
    
    const stack2 = new Stack(app, 'Stack2', { env: { region: 'us-east-2' } });
    new cloudfront.Distribution(stack2, 'Distro', {
      certificate: cert,
    })
    ```
    
    To accomplish this, I've added a new construct `ExportsReader` which
    creates a Lambda backed custom resource. This custom resource will
    return all of the CloudFormation exports in a given region.
    
    Given the above example, this would create an output in `stack1`
    
    ```json
    {
      "Outputs": {
        "ExportsOutputRefCert5C9FAEC110AE5C6A": {
          "Value": {
            "Ref": "Cert5C9FAEC1"
          },
          "Export": {
            "Name": "East1:ExportsOutputRefCert5C9FAEC110AE5C6A"
          }
        }
      }
    }
    ```
    
    And then an "import" in `stack2` which references the `ExportReader`
    
    ```json
    {
     "Resources": {
      "Distro87EBE6BA": {
       "Type": "AWS::CloudFront::Distribution",
       "Properties": {
        "DistributionConfig": {
         "ViewerCertificate": {
          "AcmCertificateArn": {
           "Fn::GetAtt": [
            "ExportsReaderuseast1D746CBDB",
            "East1:ExportsOutputRefCert5C9FAEC110AE5C6A"
           ]
          }
        }
       }
      }
     }
    }
    ```
    
    Currently this will create a single ExportsReader per region, but we
    could potentially update this to just use a single ExportsReader which
    can list exports from a list of regions.
    
    Future extensions:
    - Could be updated to do cross account references as well
    - Could be used to implement weak references
    corymhall committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    7f47baa View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2022

  1. fixing build

    corymhall committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    4ce8290 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. Configuration menu
    Copy the full SHA
    97416cc View commit details
    Browse the repository at this point in the history
  2. fixing integration tests

    corymhall committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    cfcdd08 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7a31868 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b54bd80 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2022

  1. updating README

    corymhall committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    80f4092 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. switching to ssm writer

    corymhall committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    783cb02 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    104a249 View commit details
    Browse the repository at this point in the history
  3. updating integration tests

    corymhall committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    49944e6 View commit details
    Browse the repository at this point in the history
  4. renaming

    corymhall committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    a4ac262 View commit details
    Browse the repository at this point in the history
  5. updating docs

    corymhall committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    3f99d97 View commit details
    Browse the repository at this point in the history
  6. fixing build

    corymhall committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    13b831b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    38c4226 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2022

  1. Configuration menu
    Copy the full SHA
    56b4fe6 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2022

  1. rerunning integ tests

    corymhall committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    5160273 View commit details
    Browse the repository at this point in the history
  2. fixing formatting

    corymhall committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    1933290 View commit details
    Browse the repository at this point in the history
  3. fixing tests

    corymhall committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    472c337 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2022

  1. Configuration menu
    Copy the full SHA
    308cb1b View commit details
    Browse the repository at this point in the history
  2. updating docs

    corymhall committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    b02046d View commit details
    Browse the repository at this point in the history
  3. fixing integ tests

    corymhall committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    b833df2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    954e005 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a58b1e7 View commit details
    Browse the repository at this point in the history
  6. fixing formatting

    corymhall committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    d702e0f View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2022

  1. fixing version of aws-sdk

    corymhall committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f9cbab7 View commit details
    Browse the repository at this point in the history
  2. fix test

    corymhall committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    3a1c86b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    38b6779 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. Configuration menu
    Copy the full SHA
    2c1a37b View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2022

  1. Configuration menu
    Copy the full SHA
    500ea0c View commit details
    Browse the repository at this point in the history
  2. updates based on review comments

    - moving feature flag to stack property
    - renaming some things
    corymhall committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    7ffd80b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5fe1d7b View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. Configuration menu
    Copy the full SHA
    01f3366 View commit details
    Browse the repository at this point in the history
  2. fixing tests

    corymhall committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    9e1c2dc View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. Configuration menu
    Copy the full SHA
    6b9660d View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2022

  1. Configuration menu
    Copy the full SHA
    fdea663 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c1f2ff View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6197448 View commit details
    Browse the repository at this point in the history