infra-foundry 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of infra-foundry might be problematic. Click here for more details.
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +207 -0
- package/dist/amplify/component.d.ts +11 -0
- package/dist/amplify/component.d.ts.map +1 -0
- package/dist/amplify/component.js +83 -0
- package/dist/amplify/component.js.map +1 -0
- package/dist/amplify/constants.d.ts +2 -0
- package/dist/amplify/constants.d.ts.map +1 -0
- package/dist/amplify/constants.js +60 -0
- package/dist/amplify/constants.js.map +1 -0
- package/dist/amplify/iam.d.ts +3 -0
- package/dist/amplify/iam.d.ts.map +1 -0
- package/dist/amplify/iam.js +125 -0
- package/dist/amplify/iam.js.map +1 -0
- package/dist/amplify/index.d.ts +3 -0
- package/dist/amplify/index.d.ts.map +1 -0
- package/dist/amplify/index.js +19 -0
- package/dist/amplify/index.js.map +1 -0
- package/dist/amplify/types.d.ts +24 -0
- package/dist/amplify/types.d.ts.map +1 -0
- package/dist/amplify/types.js +3 -0
- package/dist/amplify/types.js.map +1 -0
- package/dist/cloudflare/component.d.ts +12 -0
- package/dist/cloudflare/component.d.ts.map +1 -0
- package/dist/cloudflare/component.js +54 -0
- package/dist/cloudflare/component.js.map +1 -0
- package/dist/cloudflare/index.d.ts +3 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +19 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/cloudflare/types.d.ts +12 -0
- package/dist/cloudflare/types.d.ts.map +1 -0
- package/dist/cloudflare/types.js +3 -0
- package/dist/cloudflare/types.js.map +1 -0
- package/dist/ecr/component.d.ts +13 -0
- package/dist/ecr/component.d.ts.map +1 -0
- package/dist/ecr/component.js +64 -0
- package/dist/ecr/component.js.map +1 -0
- package/dist/ecr/index.d.ts +3 -0
- package/dist/ecr/index.d.ts.map +1 -0
- package/dist/ecr/index.js +19 -0
- package/dist/ecr/index.js.map +1 -0
- package/dist/ecr/service.d.ts +10 -0
- package/dist/ecr/service.d.ts.map +1 -0
- package/dist/ecr/service.js +21 -0
- package/dist/ecr/service.js.map +1 -0
- package/dist/ecs/component.d.ts +14 -0
- package/dist/ecs/component.d.ts.map +1 -0
- package/dist/ecs/component.js +132 -0
- package/dist/ecs/component.js.map +1 -0
- package/dist/ecs/iam.d.ts +5 -0
- package/dist/ecs/iam.d.ts.map +1 -0
- package/dist/ecs/iam.js +29 -0
- package/dist/ecs/iam.js.map +1 -0
- package/dist/ecs/index.d.ts +3 -0
- package/dist/ecs/index.d.ts.map +1 -0
- package/dist/ecs/index.js +19 -0
- package/dist/ecs/index.js.map +1 -0
- package/dist/ecs/service.d.ts +14 -0
- package/dist/ecs/service.d.ts.map +1 -0
- package/dist/ecs/service.js +202 -0
- package/dist/ecs/service.js.map +1 -0
- package/dist/ecs/types.d.ts +39 -0
- package/dist/ecs/types.d.ts.map +1 -0
- package/dist/ecs/types.js +3 -0
- package/dist/ecs/types.js.map +1 -0
- package/dist/image/component.d.ts +18 -0
- package/dist/image/component.d.ts.map +1 -0
- package/dist/image/component.js +20 -0
- package/dist/image/component.js.map +1 -0
- package/dist/image/index.d.ts +2 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +18 -0
- package/dist/image/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/route53/component.d.ts +9 -0
- package/dist/route53/component.d.ts.map +1 -0
- package/dist/route53/component.js +27 -0
- package/dist/route53/component.js.map +1 -0
- package/dist/route53/index.d.ts +4 -0
- package/dist/route53/index.d.ts.map +1 -0
- package/dist/route53/index.js +20 -0
- package/dist/route53/index.js.map +1 -0
- package/dist/route53/service.d.ts +10 -0
- package/dist/route53/service.d.ts.map +1 -0
- package/dist/route53/service.js +63 -0
- package/dist/route53/service.js.map +1 -0
- package/dist/route53/types.d.ts +19 -0
- package/dist/route53/types.d.ts.map +1 -0
- package/dist/route53/types.js +3 -0
- package/dist/route53/types.js.map +1 -0
- package/dist/s3/component.d.ts +13 -0
- package/dist/s3/component.d.ts.map +1 -0
- package/dist/s3/component.js +128 -0
- package/dist/s3/component.js.map +1 -0
- package/dist/s3/iam.d.ts +4 -0
- package/dist/s3/iam.d.ts.map +1 -0
- package/dist/s3/iam.js +41 -0
- package/dist/s3/iam.js.map +1 -0
- package/dist/s3/index.d.ts +4 -0
- package/dist/s3/index.d.ts.map +1 -0
- package/dist/s3/index.js +20 -0
- package/dist/s3/index.js.map +1 -0
- package/dist/s3/types.d.ts +5 -0
- package/dist/s3/types.d.ts.map +1 -0
- package/dist/s3/types.js +3 -0
- package/dist/s3/types.js.map +1 -0
- package/dist/secret/component.d.ts +13 -0
- package/dist/secret/component.d.ts.map +1 -0
- package/dist/secret/component.js +38 -0
- package/dist/secret/component.js.map +1 -0
- package/dist/secret/iam.d.ts +4 -0
- package/dist/secret/iam.d.ts.map +1 -0
- package/dist/secret/iam.js +28 -0
- package/dist/secret/iam.js.map +1 -0
- package/dist/secret/index.d.ts +3 -0
- package/dist/secret/index.d.ts.map +1 -0
- package/dist/secret/index.js +19 -0
- package/dist/secret/index.js.map +1 -0
- package/dist/ses/component.d.ts +20 -0
- package/dist/ses/component.d.ts.map +1 -0
- package/dist/ses/component.js +64 -0
- package/dist/ses/component.js.map +1 -0
- package/dist/ses/iam.d.ts +4 -0
- package/dist/ses/iam.d.ts.map +1 -0
- package/dist/ses/iam.js +27 -0
- package/dist/ses/iam.js.map +1 -0
- package/dist/ses/index.d.ts +4 -0
- package/dist/ses/index.d.ts.map +1 -0
- package/dist/ses/index.js +20 -0
- package/dist/ses/index.js.map +1 -0
- package/dist/ses/service.d.ts +12 -0
- package/dist/ses/service.d.ts.map +1 -0
- package/dist/ses/service.js +57 -0
- package/dist/ses/service.js.map +1 -0
- package/dist/ses/types.d.ts +15 -0
- package/dist/ses/types.d.ts.map +1 -0
- package/dist/ses/types.js +3 -0
- package/dist/ses/types.js.map +1 -0
- package/dist/utils/addEnvSuffix.d.ts +9 -0
- package/dist/utils/addEnvSuffix.d.ts.map +1 -0
- package/dist/utils/addEnvSuffix.js +15 -0
- package/dist/utils/addEnvSuffix.js.map +1 -0
- package/dist/utils/commonTags.d.ts +6 -0
- package/dist/utils/commonTags.d.ts.map +1 -0
- package/dist/utils/commonTags.js +10 -0
- package/dist/utils/commonTags.js.map +1 -0
- package/dist/utils/context.d.ts +9 -0
- package/dist/utils/context.d.ts.map +1 -0
- package/dist/utils/context.js +13 -0
- package/dist/utils/context.js.map +1 -0
- package/dist/utils/domain.d.ts +41 -0
- package/dist/utils/domain.d.ts.map +1 -0
- package/dist/utils/domain.js +63 -0
- package/dist/utils/domain.js.map +1 -0
- package/dist/utils/environment.d.ts +17 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +19 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/vpc/component.d.ts +13 -0
- package/dist/vpc/component.d.ts.map +1 -0
- package/dist/vpc/component.js +125 -0
- package/dist/vpc/component.js.map +1 -0
- package/dist/vpc/index.d.ts +2 -0
- package/dist/vpc/index.d.ts.map +1 -0
- package/dist/vpc/index.js +18 -0
- package/dist/vpc/index.js.map +1 -0
- package/package.json +92 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2025-01-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Initial public release
|
|
15
|
+
- AWS Amplify components for static site hosting
|
|
16
|
+
- AWS S3 components with CloudFront CDN integration
|
|
17
|
+
- AWS ECS Fargate components for container orchestration
|
|
18
|
+
- AWS ECR components for container registry
|
|
19
|
+
- AWS Route53 components for DNS management
|
|
20
|
+
- AWS SES components for email services
|
|
21
|
+
- AWS VPC components for networking
|
|
22
|
+
- AWS Secrets Manager components
|
|
23
|
+
- Cloudflare components for DNS and CDN
|
|
24
|
+
- Docker image building components
|
|
25
|
+
- Utility functions for environment management and tagging
|
|
26
|
+
|
|
27
|
+
[Unreleased]: https://github.com/0xhssn/infra-foundry/compare/v0.3.0...HEAD
|
|
28
|
+
[0.3.0]: https://github.com/0xhssn/infra-foundry/releases/tag/v0.3.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Hamza Hassan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# 🏗️ Infra Foundry
|
|
2
|
+
|
|
3
|
+
A platform-agnostic cloud infrastructure components library for modern applications. Built with TypeScript and Pulumi, Infra Foundry provides reusable, composable infrastructure components that work across AWS, Cloudflare, and other cloud providers.
|
|
4
|
+
|
|
5
|
+
## 📊 Version
|
|
6
|
+
|
|
7
|
+
Current version: **0.3.0**
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **🔧 Reusable Components** - Pre-built factories for common cloud services
|
|
12
|
+
- **🌍 Platform Agnostic** - Works with AWS, Cloudflare, and other providers
|
|
13
|
+
- **📦 TypeScript First** - Full type safety and IntelliSense support
|
|
14
|
+
- **⚡ Pulumi Powered** - Leverages Pulumi's infrastructure as code capabilities
|
|
15
|
+
- **🎯 Production Ready** - Battle-tested components used in production environments
|
|
16
|
+
|
|
17
|
+
## 🚀 Quick Start
|
|
18
|
+
|
|
19
|
+
- Create a new Pulumi project
|
|
20
|
+
```bash
|
|
21
|
+
mkdir my-infrastructure && cd my-infrastructure
|
|
22
|
+
pulumi new typescript
|
|
23
|
+
```
|
|
24
|
+
- In your infra project repo
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Install directly from GitHub
|
|
28
|
+
yarn add git+ssh://git@github.com/0xhssn/infra-foundry.git
|
|
29
|
+
|
|
30
|
+
# or add as dependency in package.json
|
|
31
|
+
"dependencies": {
|
|
32
|
+
...
|
|
33
|
+
"infra-foundry": "git+ssh://git@github.com/0xhssn/infra-foundry.git",
|
|
34
|
+
...
|
|
35
|
+
}
|
|
36
|
+
# and then install
|
|
37
|
+
yarn install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Create a Pulumi Organisation via Pulumi console
|
|
41
|
+
- Create and select a stack in your organization
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# stack-name refers to the environment to be deployed ex. `prod`, `dev`
|
|
45
|
+
pulumi stack init <your-org>/<stack-name>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- Preview your infrastructure changes
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pulumi preview --stack <your-org>/<stack-name>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Deploy your infrastructure
|
|
55
|
+
```bash
|
|
56
|
+
pulumi up --stack <your-org>/<stack-name>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 📦 Available Components
|
|
60
|
+
|
|
61
|
+
- **Amplify** - Static site hosting and CI/CD
|
|
62
|
+
- **S3** - Object storage buckets and configurations
|
|
63
|
+
- **Route53** - DNS hosting and record management
|
|
64
|
+
- **Cloudflare** - CDN and DNS records
|
|
65
|
+
- **Amazon SES** - Automated Emails
|
|
66
|
+
|
|
67
|
+
## 🏗️ Project Structure
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
src/
|
|
71
|
+
├── amplify/ # AWS Amplify components
|
|
72
|
+
│ ├── component.ts
|
|
73
|
+
│ ├── types.ts
|
|
74
|
+
│ ├── iam.ts
|
|
75
|
+
│ └── index.ts
|
|
76
|
+
├── route53/ # AWS Route53 components
|
|
77
|
+
├── s3/ # AWS S3 components
|
|
78
|
+
├── cloudflare/ # Cloudflare components
|
|
79
|
+
└── utils/ # Shared utilities
|
|
80
|
+
├── addEnvSuffix.ts
|
|
81
|
+
├── domain.ts
|
|
82
|
+
└── tags.ts
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 🛠️ Development
|
|
86
|
+
|
|
87
|
+
### Prerequisites
|
|
88
|
+
|
|
89
|
+
- Node.js >= 20.0.0
|
|
90
|
+
- TypeScript >= 5.0.0
|
|
91
|
+
- Pulumi CLI
|
|
92
|
+
|
|
93
|
+
### Setup
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Clone the repository
|
|
97
|
+
git clone https://github.com/0xhssn/infra-foundry.git
|
|
98
|
+
cd infra-foundry
|
|
99
|
+
|
|
100
|
+
# Install dependencies
|
|
101
|
+
yarn install
|
|
102
|
+
|
|
103
|
+
# Build the project
|
|
104
|
+
yarn build
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Code Quality
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Run linting
|
|
111
|
+
yarn lint
|
|
112
|
+
|
|
113
|
+
# Fix linting issues
|
|
114
|
+
yarn lint:fix
|
|
115
|
+
|
|
116
|
+
# Format code
|
|
117
|
+
yarn format
|
|
118
|
+
|
|
119
|
+
# Check formatting
|
|
120
|
+
yarn format:check
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 🔗 Linking your Repository for CI
|
|
124
|
+
|
|
125
|
+
To set up continuous integration for your infrastructure repository:
|
|
126
|
+
|
|
127
|
+
### 1. Create a new SSH key pair
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Generate a new SSH key pair for CI/CD
|
|
131
|
+
ssh-keygen -t ed25519 -C "your_name@flatout.solutions" -f ~/.ssh/ci_deploy_key
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 2. Add private key to repository secrets
|
|
135
|
+
|
|
136
|
+
- Go to your repository settings on GitHub
|
|
137
|
+
- Navigate to "Secrets and variables" → "Actions"
|
|
138
|
+
- Add the private key content as a repository secret named `SSH_PRIVATE_KEY`
|
|
139
|
+
- Copy the content of `~/.ssh/ci_deploy_key` (the private key)
|
|
140
|
+
|
|
141
|
+
### 3. Share public key with contributors
|
|
142
|
+
|
|
143
|
+
- Copy the content of `~/.ssh/ci_deploy_key.pub` (the public key)
|
|
144
|
+
- Share this public key with contributors of this repository
|
|
145
|
+
|
|
146
|
+
## 🚀 Release Automation
|
|
147
|
+
|
|
148
|
+
Infra Foundry uses [semantic-release](https://semantic-release.gitbook.io/) for fully automated version management and package publishing. Versions are determined automatically based on commit messages following [Conventional Commits](https://www.conventionalcommits.org/).
|
|
149
|
+
|
|
150
|
+
### How It Works
|
|
151
|
+
|
|
152
|
+
1. **Commit Analysis**: Commits are analyzed to determine the next version bump
|
|
153
|
+
2. **Changelog Generation**: CHANGELOG.md is automatically updated
|
|
154
|
+
3. **NPM Publishing**: Package is published to npm registry
|
|
155
|
+
4. **GitHub Release**: A GitHub release is created with release notes
|
|
156
|
+
|
|
157
|
+
### Release Channels
|
|
158
|
+
|
|
159
|
+
| Branch | Channel | Example Version |
|
|
160
|
+
| ------- | ----------- | --------------- |
|
|
161
|
+
| `main` | Stable | `1.2.3` |
|
|
162
|
+
| `beta` | Pre-release | `1.2.3-beta.1` |
|
|
163
|
+
| `alpha` | Pre-release | `1.2.3-alpha.1` |
|
|
164
|
+
|
|
165
|
+
### Setting Up NPM_TOKEN
|
|
166
|
+
|
|
167
|
+
To enable automated npm publishing, add the `NPM_TOKEN` secret to your repository:
|
|
168
|
+
|
|
169
|
+
1. Go to [npmjs.com](https://www.npmjs.com/) → Access Tokens
|
|
170
|
+
2. Generate New Token → Select "Automation" type
|
|
171
|
+
3. Copy the token
|
|
172
|
+
4. In GitHub: Repository → Settings → Secrets and variables → Actions
|
|
173
|
+
5. Add new secret: Name = `NPM_TOKEN`, Value = your token
|
|
174
|
+
|
|
175
|
+
### Version Bump Rules
|
|
176
|
+
|
|
177
|
+
| Commit Type | Example | Version Bump |
|
|
178
|
+
| --------------- | ------------------- | ------------- |
|
|
179
|
+
| Breaking change | `feat(s3)!: ...` | Major (1.0.0) |
|
|
180
|
+
| Feature | `feat(ecs): ...` | Minor (0.1.0) |
|
|
181
|
+
| Fix | `fix(amplify): ...` | Patch (0.0.1) |
|
|
182
|
+
|
|
183
|
+
## 📖 Examples
|
|
184
|
+
|
|
185
|
+
Check out the [examples directory](./examples) for complete infrastructure setups:
|
|
186
|
+
|
|
187
|
+
- **MFS Infrastructure** - Multi-app Amplify deployment with custom domains
|
|
188
|
+
- **Basic Setup** - Simple single-app deployment
|
|
189
|
+
- **Advanced Configuration** - Complex multi-environment setup
|
|
190
|
+
|
|
191
|
+
## 🤝 Contributing
|
|
192
|
+
|
|
193
|
+
We welcome contributions! Please see our [Contributing Guidelines](./CONTRIBUTING.md) for details.
|
|
194
|
+
|
|
195
|
+
## 📄 License
|
|
196
|
+
|
|
197
|
+
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
|
|
198
|
+
|
|
199
|
+
## 🔗 Links
|
|
200
|
+
|
|
201
|
+
- [Documentation](https://github.com/0xhssn/infra-foundry#readme)
|
|
202
|
+
- [Issue Tracker](https://github.com/0xhssn/infra-foundry/issues)
|
|
203
|
+
- [Pulumi Documentation](https://www.pulumi.com/docs/)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
Built with ❤️ by [Hamza Hassan](https://linkedin.com/in/hhssnn)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { amplify } from '@pulumi/aws';
|
|
2
|
+
import { ComponentResource, ComponentResourceOptions } from '@pulumi/pulumi';
|
|
3
|
+
import { AmplifyAppConfig } from './types';
|
|
4
|
+
export declare class AmplifyApp extends ComponentResource {
|
|
5
|
+
readonly app: amplify.App;
|
|
6
|
+
branch: amplify.Branch;
|
|
7
|
+
domainAssociation?: amplify.DomainAssociation;
|
|
8
|
+
constructor({ name, repository, githubAccessToken, appRoot, branchName, domainName, environmentVariables, }: AmplifyAppConfig, opts?: ComponentResourceOptions);
|
|
9
|
+
private createDomainAssociation;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/amplify/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAI5E,OAAO,EAAE,gBAAgB,EAAkC,MAAM,SAAS,CAAA;AAI1E,qBAAa,UAAW,SAAQ,iBAAiB;IAC/C,SAAgB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAA;IACzB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAA;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAA;gBAGlD,EACE,IAAI,EACJ,UAAU,EACV,iBAAiB,EACjB,OAAa,EACb,UAAU,EACV,UAAU,EACV,oBAAoB,GACrB,EAAE,gBAAgB,EACnB,IAAI,CAAC,EAAE,wBAAwB;IAwEjC,OAAO,CAAC,uBAAuB;CAuBhC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmplifyApp = void 0;
|
|
4
|
+
const aws_1 = require("@pulumi/aws");
|
|
5
|
+
const pulumi_1 = require("@pulumi/pulumi");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const iam_1 = require("./iam");
|
|
8
|
+
const commonTags_1 = require("../utils/commonTags");
|
|
9
|
+
const context_1 = require("../utils/context");
|
|
10
|
+
class AmplifyApp extends pulumi_1.ComponentResource {
|
|
11
|
+
constructor({ name, repository, githubAccessToken, appRoot = '.', branchName, domainName, environmentVariables, }, opts) {
|
|
12
|
+
super('infra-foundry:amplify:AmplifyApp', name, {}, opts);
|
|
13
|
+
const amplifyServiceRole = (0, iam_1.createAmplifyServiceRole)(name, this);
|
|
14
|
+
this.app = new aws_1.amplify.App(`${name}-app`, {
|
|
15
|
+
name,
|
|
16
|
+
repository,
|
|
17
|
+
iamServiceRoleArn: amplifyServiceRole.arn,
|
|
18
|
+
accessToken: githubAccessToken,
|
|
19
|
+
buildSpec: (0, constants_1.createMonorepoBuildSpec)(appRoot),
|
|
20
|
+
platform: 'WEB_COMPUTE',
|
|
21
|
+
environmentVariables: {
|
|
22
|
+
NODE_ENV: context_1.context.environment,
|
|
23
|
+
AMPLIFY_DIFF_DEPLOY: 'true',
|
|
24
|
+
AMPLIFY_DIFF_DEPLOY_ROOT: appRoot,
|
|
25
|
+
AMPLIFY_MONOREPO_APP_ROOT: appRoot,
|
|
26
|
+
_LIVE_UPDATES: '[{"name":"Amplify CLI","pkg":"@aws-amplify/cli","type":"npm","version":"latest"}]',
|
|
27
|
+
...(environmentVariables !== null && environmentVariables !== void 0 ? environmentVariables : {}),
|
|
28
|
+
},
|
|
29
|
+
tags: {
|
|
30
|
+
...commonTags_1.commonTags,
|
|
31
|
+
Component: 'Amplify',
|
|
32
|
+
AppRoot: appRoot,
|
|
33
|
+
},
|
|
34
|
+
}, { parent: this, dependsOn: [amplifyServiceRole] });
|
|
35
|
+
this.branch = new aws_1.amplify.Branch(`${name}-branch`, {
|
|
36
|
+
appId: this.app.id,
|
|
37
|
+
branchName,
|
|
38
|
+
enableAutoBuild: true,
|
|
39
|
+
framework: 'Next.js - SSR',
|
|
40
|
+
stage: context_1.context.isProduction ? 'PRODUCTION' : 'DEVELOPMENT',
|
|
41
|
+
environmentVariables: {
|
|
42
|
+
NODE_ENV: context_1.context.environment,
|
|
43
|
+
AMPLIFY_MONOREPO_APP_ROOT: appRoot,
|
|
44
|
+
AMPLIFY_DIFF_DEPLOY: 'true',
|
|
45
|
+
AMPLIFY_DIFF_DEPLOY_ROOT: appRoot,
|
|
46
|
+
...(environmentVariables !== null && environmentVariables !== void 0 ? environmentVariables : {}),
|
|
47
|
+
},
|
|
48
|
+
tags: {
|
|
49
|
+
...commonTags_1.commonTags,
|
|
50
|
+
Component: 'AmplifyBranch',
|
|
51
|
+
},
|
|
52
|
+
}, {
|
|
53
|
+
parent: this.app,
|
|
54
|
+
dependsOn: [amplifyServiceRole, this.app],
|
|
55
|
+
});
|
|
56
|
+
if (domainName) {
|
|
57
|
+
this.domainAssociation = this.createDomainAssociation({ name: `${name}-app`, domainName });
|
|
58
|
+
}
|
|
59
|
+
this.registerOutputs({
|
|
60
|
+
app: this.app,
|
|
61
|
+
branch: this.branch,
|
|
62
|
+
domainAssociation: this.domainAssociation,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
createDomainAssociation({ name, domainName, }) {
|
|
66
|
+
return new aws_1.amplify.DomainAssociation(`${name}-domain`, {
|
|
67
|
+
domainName,
|
|
68
|
+
appId: this.app.id,
|
|
69
|
+
subDomains: [
|
|
70
|
+
{
|
|
71
|
+
branchName: this.branch.branchName,
|
|
72
|
+
prefix: '',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
waitForVerification: false,
|
|
76
|
+
}, {
|
|
77
|
+
parent: this.app,
|
|
78
|
+
dependsOn: [this.app, this.branch],
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.AmplifyApp = AmplifyApp;
|
|
83
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/amplify/component.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/amplify/constants.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsD/D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMonorepoBuildSpec = createMonorepoBuildSpec;
|
|
4
|
+
function createMonorepoBuildSpec(appRoot) {
|
|
5
|
+
if (appRoot !== '.') {
|
|
6
|
+
return `
|
|
7
|
+
version: 1
|
|
8
|
+
applications:
|
|
9
|
+
- appRoot: "${appRoot}"
|
|
10
|
+
frontend:
|
|
11
|
+
phases:
|
|
12
|
+
preBuild:
|
|
13
|
+
commands:
|
|
14
|
+
- yarn install --frozen-lockfile
|
|
15
|
+
build:
|
|
16
|
+
commands:
|
|
17
|
+
- yarn build
|
|
18
|
+
artifacts:
|
|
19
|
+
baseDirectory: .next
|
|
20
|
+
files:
|
|
21
|
+
- '**/*'
|
|
22
|
+
cache:
|
|
23
|
+
paths:
|
|
24
|
+
- node_modules/**/*
|
|
25
|
+
- .yarn-cache/**/*
|
|
26
|
+
customHeaders:
|
|
27
|
+
- pattern: '**/*'
|
|
28
|
+
headers:
|
|
29
|
+
- key: 'Cache-Control'
|
|
30
|
+
value: 'public, max-age=0, must-revalidate'
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return `
|
|
35
|
+
version: 1
|
|
36
|
+
frontend:
|
|
37
|
+
phases:
|
|
38
|
+
preBuild:
|
|
39
|
+
commands:
|
|
40
|
+
- yarn install --frozen-lockfile
|
|
41
|
+
build:
|
|
42
|
+
commands:
|
|
43
|
+
- yarn build
|
|
44
|
+
artifacts:
|
|
45
|
+
baseDirectory: .next
|
|
46
|
+
files:
|
|
47
|
+
- '**/*'
|
|
48
|
+
cache:
|
|
49
|
+
paths:
|
|
50
|
+
- node_modules/**/*
|
|
51
|
+
- .yarn-cache/**/*
|
|
52
|
+
customHeaders:
|
|
53
|
+
- pattern: '**/*'
|
|
54
|
+
headers:
|
|
55
|
+
- key: 'Cache-Control'
|
|
56
|
+
value: 'public, max-age=0, must-revalidate'
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/amplify/constants.ts"],"names":[],"mappings":";;AAAA,0DAsDC;AAtDD,SAAgB,uBAAuB,CAAC,OAAe;IACrD,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QACpB,OAAO;;;sBAGW,OAAO;;;;;;;;;;;;;;;;;;;;;;KAsBxB,CAAA;IACH,CAAC;SAAM,CAAC;QACN,OAAO;;;;;;;;;;;;;;;;;;;;;;;KAuBN,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iam.d.ts","sourceRoot":"","sources":["../../src/amplify/iam.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIlD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,uCAyJ/E"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAmplifyServiceRole = createAmplifyServiceRole;
|
|
4
|
+
const aws_1 = require("@pulumi/aws");
|
|
5
|
+
const commonTags_1 = require("../utils/commonTags");
|
|
6
|
+
function createAmplifyServiceRole(name, parent) {
|
|
7
|
+
const role = new aws_1.iam.Role(`${name}-amplify-service-role`, {
|
|
8
|
+
name: `${name}-amplify-service-role`,
|
|
9
|
+
assumeRolePolicy: JSON.stringify({
|
|
10
|
+
Version: '2012-10-17',
|
|
11
|
+
Statement: [
|
|
12
|
+
{
|
|
13
|
+
Effect: 'Allow',
|
|
14
|
+
Principal: { Service: 'amplify.amazonaws.com' },
|
|
15
|
+
Action: 'sts:AssumeRole',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
}),
|
|
19
|
+
managedPolicyArns: [aws_1.iam.ManagedPolicy.AmplifyBackendDeployFullAccess],
|
|
20
|
+
tags: { ...commonTags_1.commonTags, Component: 'AmplifyServiceRole' },
|
|
21
|
+
}, { parent });
|
|
22
|
+
const domainsPolicy = new aws_1.iam.Policy(`${name}-amplify-domains-policy`, {
|
|
23
|
+
name: `${name}-amplify-domains-policy`,
|
|
24
|
+
policy: JSON.stringify({
|
|
25
|
+
Version: '2012-10-17',
|
|
26
|
+
Statement: [
|
|
27
|
+
{
|
|
28
|
+
Effect: 'Allow',
|
|
29
|
+
Action: [
|
|
30
|
+
'route53:ListHostedZones',
|
|
31
|
+
'route53:GetHostedZone',
|
|
32
|
+
'route53:ListResourceRecordSets',
|
|
33
|
+
'route53:ChangeResourceRecordSets',
|
|
34
|
+
'route53:GetChange',
|
|
35
|
+
'route53:ListTagsForResource',
|
|
36
|
+
],
|
|
37
|
+
Resource: '*',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
Effect: 'Allow',
|
|
41
|
+
Action: [
|
|
42
|
+
'acm:ListCertificates',
|
|
43
|
+
'acm:RequestCertificate',
|
|
44
|
+
'acm:DescribeCertificate',
|
|
45
|
+
'acm:GetCertificate',
|
|
46
|
+
],
|
|
47
|
+
Resource: '*',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
Effect: 'Allow',
|
|
51
|
+
Action: ['cloudfront:CreateInvalidation'],
|
|
52
|
+
Resource: '*',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
tags: { ...commonTags_1.commonTags, Component: 'AmplifyDomainsPolicy' },
|
|
57
|
+
}, { parent: role });
|
|
58
|
+
const amplifyPolicy = new aws_1.iam.Policy(`${name}-amplify-policy`, {
|
|
59
|
+
name: `${name}-amplify-policy`,
|
|
60
|
+
policy: JSON.stringify({
|
|
61
|
+
Version: '2012-10-17',
|
|
62
|
+
Statement: [
|
|
63
|
+
{
|
|
64
|
+
Effect: 'Allow',
|
|
65
|
+
Action: [
|
|
66
|
+
'amplify:StartJob',
|
|
67
|
+
'amplify:StopJob',
|
|
68
|
+
'amplify:GetApp',
|
|
69
|
+
'amplify:UpdateApp',
|
|
70
|
+
'amplify:GetBranch',
|
|
71
|
+
'amplify:UpdateBranch',
|
|
72
|
+
'amplify:GetJob',
|
|
73
|
+
'amplify:CreateDeployment',
|
|
74
|
+
'amplify:StartDeployment',
|
|
75
|
+
'amplify:StopDeployment',
|
|
76
|
+
],
|
|
77
|
+
Resource: '*',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
}),
|
|
81
|
+
tags: { ...commonTags_1.commonTags, Component: 'AmplifyPolicy' },
|
|
82
|
+
}, { parent });
|
|
83
|
+
const logsPolicy = new aws_1.iam.Policy(`${name}-amplify-logs-policy`, {
|
|
84
|
+
name: `${name}-amplify-logs-policy`,
|
|
85
|
+
policy: JSON.stringify({
|
|
86
|
+
Version: '2012-10-17',
|
|
87
|
+
Statement: [
|
|
88
|
+
{
|
|
89
|
+
Effect: 'Allow',
|
|
90
|
+
Action: [
|
|
91
|
+
'logs:CreateLogGroup',
|
|
92
|
+
'logs:CreateLogStream',
|
|
93
|
+
'logs:PutLogEvents',
|
|
94
|
+
'logs:DescribeLogStreams',
|
|
95
|
+
'logs:PutRetentionPolicy',
|
|
96
|
+
],
|
|
97
|
+
Resource: [
|
|
98
|
+
'arn:aws:logs:*:*:log-group:/aws/amplify/*',
|
|
99
|
+
'arn:aws:logs:*:*:log-group:/aws/amplify/*:log-stream:*',
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
Effect: 'Allow',
|
|
104
|
+
Action: ['logs:DescribeLogGroups'],
|
|
105
|
+
Resource: '*',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
}),
|
|
109
|
+
tags: { ...commonTags_1.commonTags, Component: 'AmplifyLogsPolicy' },
|
|
110
|
+
}, { parent: role });
|
|
111
|
+
new aws_1.iam.RolePolicyAttachment(`${name}-amplify-domains-policy-attachment`, {
|
|
112
|
+
role: role.name,
|
|
113
|
+
policyArn: domainsPolicy.arn,
|
|
114
|
+
}, { parent: role });
|
|
115
|
+
new aws_1.iam.RolePolicyAttachment(`${name}-amplify-policy-attachment`, {
|
|
116
|
+
role: role.name,
|
|
117
|
+
policyArn: amplifyPolicy.arn,
|
|
118
|
+
}, { parent: role });
|
|
119
|
+
new aws_1.iam.RolePolicyAttachment(`${name}-amplify-logs-policy-attachment`, {
|
|
120
|
+
role: role.name,
|
|
121
|
+
policyArn: logsPolicy.arn,
|
|
122
|
+
}, { parent: role });
|
|
123
|
+
return role;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=iam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iam.js","sourceRoot":"","sources":["../../src/amplify/iam.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/amplify/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./component"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/amplify/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { iam } from '@pulumi/aws';
|
|
2
|
+
import { EnvironmentVariablesType } from '../utils/environment';
|
|
3
|
+
export interface AmplifyAppConfig {
|
|
4
|
+
name: string;
|
|
5
|
+
appRoot?: string;
|
|
6
|
+
repository: string;
|
|
7
|
+
branchName: string;
|
|
8
|
+
domainName?: string;
|
|
9
|
+
githubAccessToken: string;
|
|
10
|
+
environmentVariables?: EnvironmentVariablesType;
|
|
11
|
+
}
|
|
12
|
+
export interface AmplifyDomainAssociationConfig {
|
|
13
|
+
name: string;
|
|
14
|
+
domainName: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AmplifyDomainRolePolicy {
|
|
17
|
+
amplifyDomainRole: iam.Role;
|
|
18
|
+
amplifyDomainPolicy: iam.Policy;
|
|
19
|
+
}
|
|
20
|
+
export interface AmplifyCicdRolePolicy {
|
|
21
|
+
amplifyCicdRole: iam.Role;
|
|
22
|
+
amplifyCicdPolicy: iam.Policy;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/amplify/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAElB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,oBAAoB,CAAC,EAAE,wBAAwB,CAAA;CAChD;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,GAAG,CAAC,IAAI,CAAA;IAC3B,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,GAAG,CAAC,IAAI,CAAA;IACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/amplify/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DnsRecord, GetZoneResult } from '@pulumi/cloudflare';
|
|
2
|
+
import { Output, ComponentResource, ComponentResourceOptions } from '@pulumi/pulumi';
|
|
3
|
+
import { CloudflareNameserverConfig } from './types';
|
|
4
|
+
export declare class CloudflareNameserver extends ComponentResource {
|
|
5
|
+
readonly nameserverRecords: Output<DnsRecord[]>;
|
|
6
|
+
readonly zoneInfo: Output<GetZoneResult> | undefined;
|
|
7
|
+
constructor(name: string, config: CloudflareNameserverConfig, opts?: ComponentResourceOptions);
|
|
8
|
+
private _createNsRecordsOnCloudflare;
|
|
9
|
+
private _createNsRecordsOnCloudflareWithZoneId;
|
|
10
|
+
private _createNameserverRecords;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/cloudflare/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAS,MAAM,EAAU,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAGnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAGpD,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,SAAgB,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;IACtD,SAAgB,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;gBAE/C,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,0BAA0B,EAAE,IAAI,CAAC,EAAE,wBAAwB;IAe7F,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,sCAAsC;IAW9C,OAAO,CAAC,wBAAwB;CAuBjC"}
|