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

Asset deployment and a sample web application #511

Merged
merged 37 commits into from
Oct 2, 2024

Conversation

ericzbeard
Copy link
Contributor

@ericzbeard ericzbeard commented Aug 30, 2024

This PR adds the concept of Metadata commands to Rain, and it adds a complete serverless web application sample. (Sorry I know this is a huge PR, but I needed to add a lot of new features to make it possible to deploy a fully functional application with a single deploy command)

Resources:
  Bucket:
    Type: AWS::S3::Bucket
    Metadata:
      Rain:
        Version: 1
        EmptyOnDelete: true
        RunBefore:
          Command: before-deployment.sh
        RunAfter:
          Command: after-deployment.sh
        Content: site 
        DistributionLogicalId: SiteDistribution

Rain will run the commands indicated before and after deployment. Then after a create or update operation, rain will upload the contents of the specified directory to this S3 bucket. Then it will invalidate a CloudFront distribution. On a delete operation, it will delete all contents of the bucket.

This PR also adds some useful new modules in the test/modules directory and shows how to use them in test/webapp/webapp.yaml. Once the module system feels mature enough, I'd like to dedicate an entire repo to rain modules.

You should be able to deploy the sample with rain deploy --experimental test/webapp/webapp.yaml. The only manual operation will be to go into Cognito and create a user, then you can go to the Hosted UI in the app client configuration section to log in. The Dynamo table is empty at first, you can manually add some entries since the web app only does GETs.

@ericzbeard ericzbeard marked this pull request as ready for review October 1, 2024 23:39
@ericzbeard ericzbeard merged commit 4398aa0 into aws-cloudformation:main Oct 2, 2024
1 check passed
@ericzbeard ericzbeard deleted the webapp branch October 2, 2024 16:49
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 16, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aws-cloudformation/rain](https://github.com/aws-cloudformation/rain) | minor | `v1.15.0` -> `v1.16.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>aws-cloudformation/rain (aws-cloudformation/rain)</summary>

### [`v1.16.1`](https://github.com/aws-cloudformation/rain/releases/tag/v1.16.1)

[Compare Source](aws-cloudformation/rain@v1.16.0...v1.16.1)

This release features a set of new S3 Bucket Metadata commands that can be used to run scripts, upload content, and invalidate CloudFront distributions. The S3 directive also gets a new `Run` property that allows you to run build scripts for your lambda functions before uploading them. There is a fully functional serverless web application sample in `test/webapp` that demonstrates these new features.

#### What's Changed

-   Adds Cross Compilation support for Linux ARM 64 by [@&#8203;georgealton](https://github.com/georgealton) in aws-cloudformation/rain#516
-   Asset deployment and a sample web application by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#511
-   Use regional endpoints for large template uploads to S3 by [@&#8203;davidsuehring](https://github.com/davidsuehring) in aws-cloudformation/rain#539
-   Add Outputs to Pkl serialization, and fix formatting Pkl to Yaml with Pkl modules by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#540
-   Fix skipping read only props by full path by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#541
-   Version 1.16.0 by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#542
-   Fixed release action

#### Dependabot

-   Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows by [@&#8203;dependabot](https://github.com/dependabot) in aws-cloudformation/rain#514

#### New Contributors

-   [@&#8203;georgealton](https://github.com/georgealton) made their first contribution in aws-cloudformation/rain#516
-   [@&#8203;davidsuehring](https://github.com/davidsuehring) made their first contribution in aws-cloudformation/rain#539

**Full Changelog**: aws-cloudformation/rain@v1.15.0...v1.16.0

### [`v1.16.0`](https://github.com/aws-cloudformation/rain/releases/tag/v1.16.0)

[Compare Source](aws-cloudformation/rain@v1.15.0...v1.16.0)

This release features a set of new S3 Bucket Metadata commands that can be used to run scripts, upload content, and invalidate CloudFront distributions. The S3 directive also gets a new `Run` property that allows you to run build scripts for your lambda functions before uploading them. There is a fully functional serverless web application sample in `test/webapp` that demonstrates these new features.

#### What's Changed

-   Adds Cross Compilation support for Linux ARM 64 by [@&#8203;georgealton](https://github.com/georgealton) in aws-cloudformation/rain#516
-   Asset deployment and a sample web application by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#511
-   Use regional endpoints for large template uploads to S3 by [@&#8203;davidsuehring](https://github.com/davidsuehring) in aws-cloudformation/rain#539
-   Add Outputs to Pkl serialization, and fix formatting Pkl to Yaml with Pkl modules by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#540
-   Fix skipping read only props by full path by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#541
-   Version 1.16.0 by [@&#8203;ericzbeard](https://github.com/ericzbeard) in aws-cloudformation/rain#542

#### Dependabot

-   Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows by [@&#8203;dependabot](https://github.com/dependabot) in aws-cloudformation/rain#514

#### New Contributors

-   [@&#8203;georgealton](https://github.com/georgealton) made their first contribution in aws-cloudformation/rain#516
-   [@&#8203;davidsuehring](https://github.com/davidsuehring) made their first contribution in aws-cloudformation/rain#539

**Full Changelog**: aws-cloudformation/rain@v1.15.0...v1.16.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant