Skip to content

Commit 1e547fa

Browse files
committed
Resolve conflicts
2 parents 2c73d5b + 117aca4 commit 1e547fa

File tree

6 files changed

+119
-110
lines changed

6 files changed

+119
-110
lines changed

.github/auto-release.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/banner.png

990 KB
Loading

README.md

Lines changed: 70 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
2+
13
<!-- markdownlint-disable -->
2-
# github-action-terraform-plan-storage <a href="https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content="><img align="right" src="https://cloudposse.com/logo-300x69.svg" width="150" /></a>
3-
<a href="https://github.com/cloudposse/github-action-terraform-plan-storage/releases/latest"><img src="https://img.shields.io/github/release/cloudposse/github-action-terraform-plan-storage.svg" alt="Latest Release"/></a><a href="https://slack.cloudposse.com"><img src="https://slack.cloudposse.com/badge.svg" alt="Slack Community"/></a><a href="https://ask.sweetops.com/"><img src="https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg" alt="Discourse Forum"/></a>
4+
<a href="https://cpco.io/homepage"><img src="https://github.com/cloudposse/github-action-terraform-plan-storage/blob/main/.github/banner.png?raw=true" alt="Project Banner"/></a><br/>
5+
<p align="right">
6+
<a href="https://github.com/cloudposse/github-action-terraform-plan-storage/releases/latest"><img src="https://img.shields.io/github/release/cloudposse/github-action-terraform-plan-storage.svg" alt="Latest Release"/></a><a href="https://slack.cloudposse.com"><img src="https://slack.cloudposse.com/badge.svg" alt="Slack Community"/></a><a href="https://ask.sweetops.com/"><img src="https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg" alt="Discourse Forum"/></a></p>
47
<!-- markdownlint-restore -->
58

69
<!--
@@ -27,16 +30,16 @@
2730
A GitHub Action to securely store Terraform plan files in a cloud storage (S3 or Azure Blob Storage) with metadata storage in cloud document database (DynamoDB or CosmosDB).
2831

2932

30-
---
31-
> [!NOTE]
32-
> This project is part of Cloud Posse's comprehensive ["SweetOps"](https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=) approach towards DevOps.
33-
> <details><summary><strong>Learn More</strong></summary>
34-
>
35-
> It's 100% Open Source and licensed under the [APACHE2](LICENSE).
33+
> [!TIP]
34+
> #### 👽 Use Atmos with Terraform
35+
> Cloud Posse uses [`atmos`](https://atmos.tools) to easily orchestrate multiple environments using Terraform. <br/>
36+
> Works with [Github Actions](https://atmos.tools/integrations/github-actions/), [Atlantis](https://atmos.tools/integrations/atlantis), or [Spacelift](https://atmos.tools/integrations/spacelift).
3637
>
37-
> </details>
38-
39-
<a href="https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=readme_header_link"><img src="https://cloudposse.com/readme/header/img"/></a>
38+
> <details>
39+
> <summary><strong>Watch demo of using Atmos with Terraform</strong></summary>
40+
> <img src="https://github.com/cloudposse/atmos/blob/master/docs/demo.gif?raw=true"/><br/>
41+
> <i>Example of running <a href="https://atmos.tools"><code>atmos</code></a> to manage infrastructure from our <a href="https://atmos.tools/quick-start/">Quick Start</a> tutorial.</i>
42+
> </detalis>
4043
4144

4245
## Introduction
@@ -47,9 +50,8 @@ the plan files when a feature branch is opened and applied when merged.
4750

4851

4952

50-
## Usage
51-
5253

54+
## Usage
5355

5456

5557
## AWS (default)
@@ -128,6 +130,14 @@ Again set the `component`, `stack`, `planPath`, and `action` in the same manner
128130
cosmosEndpoint: "https://my-cosmo-account.documents.azure.com:443/"
129131
```
130132

133+
> [!IMPORTANT]
134+
> In Cloud Posse's examples, we avoid pinning modules to specific versions to prevent discrepancies between the documentation
135+
> and the latest released versions. However, for your own projects, we strongly advise pinning each module to the exact version
136+
> you're using. This practice ensures the stability of your infrastructure. Additionally, we recommend implementing a systematic
137+
> approach for updating versions to avoid unexpected changes.
138+
139+
140+
131141

132142

133143

@@ -180,23 +190,60 @@ For additional context, refer to some of these links.
180190
- [Reference Architectures](https://cloudposse.com/) - Launch effortlessly with our turnkey reference architectures, built either by your team or ours.
181191

182192

193+
194+
> [!TIP]
195+
> #### Use Terraform Reference Architectures for AWS
196+
>
197+
> Use Cloud Posse's ready-to-go [terraform architecture blueprints](https://cloudposse.com/reference-architecture/) for AWS to get up and running quickly.
198+
>
199+
> ✅ We build it together with your team.<br/>
200+
> ✅ Your team owns everything.<br/>
201+
> ✅ 100% Open Source and backed by fanatical support.<br/>
202+
>
203+
> <a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>
204+
> <details><summary>📚 <strong>Learn More</strong></summary>
205+
>
206+
> <br/>
207+
>
208+
> Cloud Posse is the leading [**DevOps Accelerator**](https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support) for funded startups and enterprises.
209+
>
210+
> *Your team can operate like a pro today.*
211+
>
212+
> Ensure that your team succeeds by using Cloud Posse's proven process and turnkey blueprints. Plus, we stick around until you succeed.
213+
> #### Day-0: Your Foundation for Success
214+
> - **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
215+
> - **Deployment Strategy.** Adopt a proven deployment strategy with GitHub Actions, enabling automated, repeatable, and reliable software releases.
216+
> - **Site Reliability Engineering.** Gain total visibility into your applications and services with Datadog, ensuring high availability and performance.
217+
> - **Security Baseline.** Establish a secure environment from the start, with built-in governance, accountability, and comprehensive audit logs, safeguarding your operations.
218+
> - **GitOps.** Empower your team to manage infrastructure changes confidently and efficiently through Pull Requests, leveraging the full power of GitHub Actions.
219+
>
220+
> <a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>
221+
>
222+
> #### Day-2: Your Operational Mastery
223+
> - **Training.** Equip your team with the knowledge and skills to confidently manage the infrastructure, ensuring long-term success and self-sufficiency.
224+
> - **Support.** Benefit from a seamless communication over Slack with our experts, ensuring you have the support you need, whenever you need it.
225+
> - **Troubleshooting.** Access expert assistance to quickly resolve any operational challenges, minimizing downtime and maintaining business continuity.
226+
> - **Code Reviews.** Enhance your team’s code quality with our expert feedback, fostering continuous improvement and collaboration.
227+
> - **Bug Fixes.** Rely on our team to troubleshoot and resolve any issues, ensuring your systems run smoothly.
228+
> - **Migration Assistance.** Accelerate your migration process with our dedicated support, minimizing disruption and speeding up time-to-value.
229+
> - **Customer Workshops.** Engage with our team in weekly workshops, gaining insights and strategies to continuously improve and innovate.
230+
>
231+
> <a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>
232+
> </details>
233+
183234
## ✨ Contributing
184235

185236
This project is under active development, and we encourage contributions from our community.
237+
238+
239+
186240
Many thanks to our outstanding contributors:
187241

188242
<a href="https://github.com/cloudposse/github-action-terraform-plan-storage/graphs/contributors">
189243
<img src="https://contrib.rocks/image?repo=cloudposse/github-action-terraform-plan-storage&max=24" />
190244
</a>
191245

192-
### 🐛 Bug Reports & Feature Requests
193-
194-
Please use the [issue tracker](https://github.com/cloudposse/github-action-terraform-plan-storage/issues) to report any bugs or file feature requests.
195-
196-
### 💻 Developing
197-
198-
If you are interested in being a contributor and want to get involved in developing this project or help out with Cloud Posse's other projects, we would love to hear from you!
199-
Hit us up in [Slack](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=slack), in the `#cloudposse` channel.
246+
For 🐛 bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/github-action-terraform-plan-storage/issues).
200247

201248
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
202249
1. Review our [Code of Conduct](https://github.com/cloudposse/github-action-terraform-plan-storage/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md).
@@ -221,38 +268,6 @@ Dropped straight into your Inbox every week — and usually a 5-minute read.
221268

222269
[Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q&A_ that you can’t find anywhere else.
223270
It's **FREE** for everyone!
224-
225-
## About
226-
227-
This project is maintained by <a href="https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=">Cloud Posse, LLC</a>.
228-
<a href="https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content="><img src="https://cloudposse.com/logo-300x69.svg" align="right" /></a>
229-
230-
We are a [**DevOps Accelerator**](https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support) for funded startups and enterprises.
231-
Use our ready-to-go terraform architecture blueprints for AWS to get up and running quickly.
232-
We build it with you. You own everything. Your team wins. Plus, we stick around until you succeed.
233-
234-
<a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=commercial_support"><img alt="Learn More" src="https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge"/></a>
235-
236-
*Your team can operate like a pro today.*
237-
238-
Ensure that your team succeeds by using our proven process and turnkey blueprints. Plus, we stick around until you succeed.
239-
240-
<details>
241-
<summary>📚 <strong>See What's Included</strong></summary>
242-
243-
- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
244-
- **Deployment Strategy.** You'll have a battle-tested deployment strategy using GitHub Actions that's automated and repeatable.
245-
- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices.
246-
- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes.
247-
- **GitOps.** You'll be able to operate your infrastructure via Pull Requests.
248-
- **Training.** You'll receive hands-on training so your team can operate what we build.
249-
- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel.
250-
- **Troubleshooting.** You'll get help to triage when things aren't working.
251-
- **Code Reviews.** You'll receive constructive feedback on Pull Requests.
252-
- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects.
253-
</details>
254-
255-
<a href="https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-terraform-plan-storage&utm_content=readme_commercial_support_link"><img src="https://cloudposse.com/readme/commercial-support/img"/></a>
256271
## License
257272

258273
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="License"></a>
@@ -287,6 +302,8 @@ under the License.
287302
## Trademarks
288303

289304
All other trademarks referenced herein are the property of their respective owners.
305+
306+
290307
## Copyrights
291308

292309
Copyright © 2023-2024 [Cloud Posse, LLC](https://cloudposse.com)

dist/index.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185422,8 +185422,13 @@ class DynamoDBMetadataRepo {
185422185422
return __awaiter(this, void 0, void 0, function* () {
185423185423
const params = {
185424185424
TableName: this.tableName,
185425+
<<<<<<< HEAD
185425185426
KeyConditionExpression: "#commitSHA= :commitSHA",
185426185427
FilterExpression: "#owner = :owner and #repo = :repo and #component = :component and #stack = :stack",
185428+
=======
185429+
ExclusiveStartKey: undefined,
185430+
FilterExpression: "#owner = :owner and #repo = :repo and #commitSHA = :commitSHA and #component = :component and #stack = :stack",
185431+
>>>>>>> main
185427185432
ExpressionAttributeNames: {
185428185433
"#owner": "repoOwner",
185429185434
"#repo": "repoName",
@@ -185442,13 +185447,29 @@ class DynamoDBMetadataRepo {
185442185447
IndexName: "commitSHA-index",
185443185448
ScanIndexForward: false
185444185449
};
185450+
<<<<<<< HEAD
185445185451
const command = new lib_dynamodb_1.QueryCommand(params);
185446185452
const response = yield this.dynamo.send(command);
185447185453
if (!response.Items || response.Items.length === 0) {
185454+
=======
185455+
let results = [];
185456+
let response;
185457+
do {
185458+
const command = new lib_dynamodb_1.ScanCommand(params);
185459+
response = yield this.dynamo.send(command);
185460+
if (response.Items && response.Items.length >= 0) {
185461+
results = results.concat(response.Items);
185462+
}
185463+
if (response.LastEvaluatedKey) {
185464+
params.ExclusiveStartKey = response.LastEvaluatedKey;
185465+
}
185466+
} while (response.LastEvaluatedKey);
185467+
if (results.length === 0) {
185468+
>>>>>>> main
185448185469
throw new repository_1.RepositoryErrors.PlanNotFoundError(component, stack, commitSHA);
185449185470
}
185450185471
const items = [];
185451-
response.Items.forEach((item) => {
185472+
results.forEach((item) => {
185452185473
items.push(this.mapper.toDomain(item));
185453185474
});
185454185475
const sortedItems = items.sort((a, b) => {

dist/index.js.map

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/terraformPlan/repo/DynamoDbMetadataRepo.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import {
22
DynamoDBDocumentClient,
3+
<<<<<<< HEAD
4+
=======
5+
ScanCommandInput,
6+
ScanCommandOutput,
7+
ScanCommand,
8+
>>>>>>> main
39
QueryCommandInput,
410
QueryCommand,
511
PutCommand,
@@ -10,6 +16,7 @@ import {
1016
TerraformPlan,
1117
TerraformPlanDynamoDBMapper
1218
} from "@modules/terraformPlan";
19+
import {NativeAttributeValue} from "@aws-sdk/util-dynamodb";
1320

1421
const projectionExpression =
1522
"id, branch, commitSHA, component, contentsHash, repoOwner, pr, repoName, stack, tainted, createdAt";
@@ -55,12 +62,25 @@ export class DynamoDBMetadataRepo implements IMetadataRepository {
5562
const command = new QueryCommand(params);
5663
const response = await this.dynamo.send(command);
5764

58-
if (!response.Items || response.Items.length === 0) {
65+
do {
66+
const command = new ScanCommand(params);
67+
response = await this.dynamo.send(command);
68+
69+
if (response.Items && response.Items.length >= 0) {
70+
results = results.concat(response.Items)
71+
}
72+
73+
if (response.LastEvaluatedKey) {
74+
params.ExclusiveStartKey = response.LastEvaluatedKey
75+
}
76+
} while (response.LastEvaluatedKey)
77+
78+
if (results.length === 0) {
5979
throw new RepositoryErrors.PlanNotFoundError(component, stack, commitSHA);
6080
}
6181

6282
const items: TerraformPlan[] = [];
63-
response.Items.forEach((item) => {
83+
results.forEach((item) => {
6484
items.push(this.mapper.toDomain(item));
6585
});
6686

0 commit comments

Comments
 (0)