Skip to content

Commit 3e4e2bc

Browse files
committed
IaC folder done
1 parent 03107a8 commit 3e4e2bc

File tree

5 files changed

+70
-57
lines changed

5 files changed

+70
-57
lines changed

src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.mdx renamed to src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.md

File renamed without changes.

src/content/docs/aws/integrations/infrastructure-as-code/crossplane.mdx renamed to src/content/docs/aws/integrations/infrastructure-as-code/crossplane.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,23 @@ The installation may take a few minutes.
3939
In parallel, we can install the `crossplane` command-line tool.
4040
```bash
4141
curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | bash
42-
{/* <disable-copy>...</disable-copy> */} {/* mdx-disabled */}
4342
sudo mv crossplane /usr/local/bin
4443
```
4544
To confirm that the installation was successful, we can run these commands, which should yield output similar to the following:
4645
```bash
4746
crossplane version
48-
{/* <disable-copy>Client Version: v1.17.0 */} {/* mdx-disabled */}
49-
Server Version: v1.17.0</disable-copy>
47+
```
48+
```bash title="Output"
49+
Client Version: v1.17.0
50+
Server Version: v1.17.0
51+
```
5052

53+
```bash
5154
kubectl get crds | grep crossplane
52-
{/* <disable-copy>compositions.apiextensions.crossplane.io 2023-09-03T11:30:36Z */} {/* mdx-disabled */}
55+
```
56+
```bash title="Output"
57+
compositions.apiextensions.crossplane.io 2023-09-03T11:30:36Z
5358
configurations.pkg.crossplane.io 2023-09-03T11:30:36Z
54-
...</disable-copy>
5559
```
5660

5761
### Installing the Crossplane AWS Provider
@@ -87,12 +91,13 @@ EOF
8791

8892
After some time, the providers should get into healthy state, which can be confirmed via `kubectl get providers`:
8993
```bash
90-
{/* kubectl get providers<disable-copy> */} {/* mdx-disabled */}
94+
kubectl get providers
95+
```
96+
```bash title="Output"
9197
NAME INSTALLED HEALTHY PACKAGE AGE
9298
upbound-provider-family-aws True True xpkg.upbound.io/upbound/provider-family-aws:v0.40.0 2m
9399
provider-aws-s3 True True xpkg.upbound.io/upbound/provider-aws-s3:v0.40.0 2m
94100
provider-aws-sqs True True xpkg.upbound.io/upbound/provider-aws-sqs:v0.40.0 2m
95-
</disable-copy>
96101
```
97102

98103
Next, we install a secret to define the test credentials for the AWS provider:
@@ -139,12 +144,10 @@ EOF
139144
```
140145

141146
:::note
142-
143147
The endpoint `http://host.docker.internal:4566` in the listing above assumes that you are running Kubernetes in the local Docker engine, and that LocalStack is up and running and available on default port `4566`.
144148
:::
145149

146150
:::note
147-
148151
The Crossplane AWS provider currently requires us to specify the list of `services` for which the local `endpoint` is used as the target URL.
149152
Please make sure to extend this list accordingly if you're working with additional LocalStack services.
150153
:::
@@ -169,18 +172,20 @@ EOF
169172
If everything is wired up correctly, you should now see some activity in the LocalStack log outputs, where Crossplane starts deploying the S3 bucket against LocalStack.
170173
After some time, the bucket should be transitioning into `ready` state within Crossplane:
171174
```bash
172-
{/* kubectl get buckets<disable-copy> */} {/* mdx-disabled */}
175+
kubectl get buckets
176+
```
177+
```bash
173178
NAME READY SYNCED EXTERNAL-NAME AGE
174179
crossplane-test-bucket True True crossplane-test-bucket 30s
175-
</disable-copy>
176180
```
177181

178182
...
179183
and the bucket it should also be visible when querying the local S3 buckets in LocalStack via [`awslocal`](https://github.com/localstack/awscli-local):
180184
```bash
181-
{/* awslocal s3 ls<disable-copy> */} {/* mdx-disabled */}
185+
awslocal s3 ls
186+
```
187+
```bash title="Output"
182188
2023-09-03 15:18:47 crossplane-test-bucket
183-
</disable-copy>
184189
```
185190

186191
We can repeat the same exercise for creating a local SQS queue named `crossplane-test-queue`:
@@ -199,22 +204,24 @@ EOF
199204

200205
After some time, the queue should transition into `ready` state in Crossplane:
201206
```bash
202-
{/* kubectl get queues<disable-copy> */} {/* mdx-disabled */}
207+
kubectl get queues
208+
```
209+
```bash title="Output"
203210
NAME READY SYNCED EXTERNAL-NAME AGE
204211
crossplane-test-queue True True http://host.docker.internal:4566/000000000000/crossplane-test-queue 40s
205-
</disable-copy>
206212
```
207213

208-
...
209-
and the queue should be visible when listing the SQS queues in LocalStack:
214+
...and the queue should be visible when listing the SQS queues in LocalStack:
210215
```bash
211-
{/* awslocal sqs list-queues<disable-copy> */} {/* mdx-disabled */}
216+
awslocal sqs list-queues
217+
```
218+
219+
```bash title="Output"
212220
{
213221
"QueueUrls": [
214222
"http://localhost:4566/000000000000/crossplane-test-queue"
215223
]
216224
}
217-
</disable-copy>
218225
```
219226

220227
### Summary

src/content/docs/aws/integrations/infrastructure-as-code/former2.mdx renamed to src/content/docs/aws/integrations/infrastructure-as-code/former2.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,45 @@ You can verify that the resources were created successfully by running the follo
6666

6767
```bash
6868
localstack logs
69-
{/* <disable-copy> */} {/* mdx-disabled */}
69+
```
70+
71+
```bash title="Output"
7072
2023-10-14T15:31:08.852 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.CreateBucket => 200
7173
2023-10-14T15:31:09.356 INFO --- [ asgi_gw_0] localstack.request.aws : AWS sqs.CreateQueue => 200
7274
2023-10-14T15:31:12.920 INFO --- [ asgi_gw_0] botocore.credentials : Found credentials in environment variables.
7375
2023-10-14T15:31:13.332 INFO --- [ asgi_gw_0] localstack.utils.bootstrap : Execution of "require" took 2028.25ms
7476
2023-10-14T15:31:13.712 INFO --- [ asgi_gw_0] localstack.request.aws : AWS dynamodb.CreateTable => 200
75-
</disable-copy>
77+
```
78+
79+
```bash
7680
awslocal s3 ls
77-
<disable-copy>
81+
```
82+
```bash title="Output"
7883
2023-10-14 21:01:08 my-bucket
79-
</disable-copy>
84+
```
85+
86+
```bash
8087
awslocal sqs list-queues
81-
<disable-copy>
88+
```
89+
90+
```bash title="Output"
8291
{
8392
"QueueUrls": [
8493
"http://localhost:4566/000000000000/my-queue"
8594
]
8695
}
87-
</disable-copy>
96+
```
97+
98+
```bash
8899
awslocal dynamodb list-tables
89-
<disable-copy>
100+
```
101+
102+
```bash title="Output"
90103
{
91104
"TableNames": [
92105
"my-table"
93106
]
94107
}
95-
</disable-copy>
96108
```
97109

98110
### Configure Former2
@@ -102,15 +114,13 @@ Open the [**Credentials**](https://former2.com/#section-setup-credentials) tab a
102114
For LocalStack, you can just configure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables as `test` and `test`, respectively.
103115

104116
![Enter test credentials on Former2 Dashboard](/images/aws/former2-credentials.png)
105-
<br></br>
106117

107118
Click on [**Continue to Parameters**](https://former2.com/#section-setup-parameters) and include your own CloudFormation stack parameters by adding them below.
108119
Click on [**Continue to Settings**](https://former2.com/#section-setup-settings) and navigate to **Custom Endpoints**.
109120
Toggle the **Use LocalStack Endpoint** switch to enable the LocalStack endpoint URL (`http://localhost:4566`).
110121
Click on [**Go to Dashboard**](https://former2.com/#section-dashboard) to complete the setup.
111122

112123
![LocalStack endpoint toggle on Former2 Dashboard](/images/aws/former2-localstack-endpoint.png)
113-
<br></br>
114124

115125
You can now click on **Scan Account** button on the top-right corner of the dashboard to scan your LocalStack instance for resources.
116126
Once the scan is complete, you can select the resources you want to generate IaC outputs for.
@@ -120,12 +130,10 @@ Once the scan is complete, you can select the resources you want to generate IaC
120130
Navigate to [S3](https://former2.com/#section-storage-s3), [DynamoDB](https://former2.com/#section-database-dynamodb), and [SQS](https://former2.com/#section-applicationintegration-sqs) to verify that the resources you created earlier are listed.
121131

122132
![S3 Console on Former2 Dashboard](/images/aws/former2-s3.png)
123-
<br></br>
124133

125134
You can select the resources you want to generate IaC outputs for and click on **Add Selected**.
126135
Finally, you can click on **Generate** on the top-left corner of the dashboard to generate the IaC outputs.
127136

128137
![CloudFormation Output on Former2 Dashboard](/images/aws/former2-cloudformation-output.png)
129-
<br></br>
130138

131139
You can also choose to generate the IaC outputs in a different format by clicking on the various options available on the left-hand side of the dashboard.

src/content/docs/aws/integrations/infrastructure-as-code/pulumi.mdx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66
order: 2
77
---
88

9+
import { FileTree } from "@astrojs/starlight/components";
10+
911
## Introduction
1012

1113
Pulumi's SDK for infrastructure-as-code allows you to create, deploy, and manage AWS containers, serverless functions, and other infrastructure using popular programming languages.
@@ -22,7 +24,6 @@ This guide will show you how to set up local AWS resources using both the `pulum
2224
## `pulumilocal` wrapper script
2325

2426
:::note
25-
2627
`pulumi-local` currently does not support the `aws-native` package as it relies on the AWS Cloud Control API.
2728
For additional information, refer to the [GitHub issue](https://github.com/localstack/localstack/issues/11523).
2829
:::
@@ -43,7 +44,6 @@ export PULUMI_BACKEND_URL=file://`pwd`/myproj
4344
```
4445

4546
:::note
46-
4747
For further options please consult the official documentation on available [environment variables](https://www.pulumi.com/docs/cli/environment-variables/) and [local backend](https://www.pulumi.com/docs/concepts/state/#local-filesystem).
4848
:::
4949

@@ -59,10 +59,10 @@ You can now use the `pulumilocal` command to interact with your Pulumi project.
5959

6060
```bash
6161
pulumilocal --help
62-
{/* <disable-copy> */} {/* mdx-disabled */}
62+
```
63+
```bash title="Output"
6364
Pulumi - Modern Infrastructure as Code
6465
...
65-
<disable-copy>
6666
```
6767

6868
### Create a new Pulumi project
@@ -75,7 +75,6 @@ pulumilocal new aws-typescript -y -s lsdev --cwd myproj
7575
```
7676

7777
:::tip
78-
7978
The `--cwd` option is unnecessary if you're already in the project directory.
8079
:::
8180

@@ -142,24 +141,22 @@ Installing dependencies...
142141
143142
This will create the following directory structure.
144143
145-
```bash
146-
tree -L 1
147-
.
148-
├── index.ts
149-
├── node_modules
150-
├── package.json
151-
├── package-lock.json
152-
├── Pulumi.dev.yaml
153-
├── Pulumi.yaml
154-
└── tsconfig.json
155-
```
144+
<FileTree>
145+
- index.ts
146+
- node_modules
147+
- package.json
148+
- package-lock.json
149+
- Pulumi.dev.yaml
150+
- Pulumi.yaml
151+
- tsconfig.json
152+
</FileTree>
156153
157154
### Configure the stack
158155
159156
Modify your stack configuration in `Pulumi.dev.yaml` to include endpoints for AWS services pointing to `http://localhost:4566`.
160157
However, these endpoints may change depending on the AWS plugin version you are using.
161158
162-
```yaml
159+
```yaml showLineNumbers
163160
config:
164161
aws:accessKey: test
165162
aws:s3UsePathStyle: "true"

src/content/docs/aws/integrations/infrastructure-as-code/terraform.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ After installation, you can use the `tflocal` command, which has the same interf
5151

5252
```bash
5353
tflocal --help
54-
{/* <disable-copy> */} {/* mdx-disabled */}
54+
```
55+
56+
```bash title="Output"
5557
Usage: terraform [global options] <subcommand> [args]
5658
...
57-
<disable-copy>
5859
```
5960

6061
### Deploy the Terraform configuration
@@ -88,7 +89,6 @@ tflocal apply
8889
| `AWS_ACCESS_KEY_ID` | `test` (`accountId`: 000000000000) | AWS Access Key ID to use for multi-account setups |
8990

9091
:::note
91-
9292
While using `CUSTOMIZE_ACCESS_KEY`, following cases are taking precedence over each other from top to bottom:
9393
1. If the `AWS_ACCESS_KEY_ID` environment variable is set.
9494
2. If `access_key` is configured in the Terraform AWS provider.
@@ -144,9 +144,9 @@ Furthermore, it's necessary to configure the individual services to use LocalSta
144144
For S3, this configuration resembles the following snippet, where we've chosen to use the virtual hosted-style endpoint:
145145

146146
```hcl
147-
endpoints {
148-
s3 = "http://s3.localhost.localstack.cloud:4566"
149-
}
147+
endpoints {
148+
s3 = "http://s3.localhost.localstack.cloud:4566"
149+
}
150150
```
151151

152152
:::note
@@ -226,7 +226,6 @@ provider "aws" {
226226
```
227227

228228
:::note
229-
230229
To heuristically detect whether your Terraform configuration should be deployed against LocalStack, you can use the following snippet:
231230

232231
```hcl
@@ -414,6 +413,7 @@ Note: You can always add providers using 'cdktf provider add' later on
414413
<TabItem label="Python">
415414
```python
416415
$ pipenv install cdktf-cdktf-provider-aws
416+
```
417417
</TabItem>
418418
<TabItem label="TypeScript">
419419
```javascript
@@ -524,14 +524,15 @@ OpenTofu is an open-source fork of Terraform acting as a drop-in replacement for
524524

525525
```bash
526526
TF_CMD=tofu tflocal --help
527-
<disable-copy>
527+
```
528+
529+
```bash title="Output"
528530
Usage: tofu [global options] <subcommand> [args]
529531

530532
The available commands for execution are listed below.
531533
The primary workflow commands are given first, followed by
532534
less common or more advanced commands.
533535
...
534-
</disable-copy>
535536
```
536537

537538
## Terragrunt

0 commit comments

Comments
 (0)