Skip to content

Commit 240183e

Browse files
authored
Merge pull request #147 from Lemoncode/review-terraform
Review terraform
2 parents 8d2ac9a + 3830f8f commit 240183e

File tree

9 files changed

+108
-176
lines changed

9 files changed

+108
-176
lines changed

05-iac/00-terraform/01-setup/readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,41 @@ Para editar el `PATH`, seguiremos los siguientes pasos:
3333
3. Pulsar `edit` y modificarlo de forma adecuada
3434
4. Asegurar que hemos incluido `;` --> `c:\path;c:\path2`
3535

36+
## Visual Studio Code Devconatiners
37+
38+
Crear en el raíz del proyecto el directorio `.devcontainer`, dentro de este directorio añadimos el fichero `devcontainer.json`
39+
40+
```json
41+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
42+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
43+
{
44+
"name": "Ubuntu",
45+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
46+
"features": {
47+
"ghcr.io/devcontainers/features/aws-cli:1": {},
48+
"ghcr.io/devcontainers/features/terraform:1": {}
49+
}
50+
51+
// Features to add to the dev container. More info: https://containers.dev/features.
52+
// "features": {},
53+
54+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
55+
// "forwardPorts": [],
56+
57+
// Use 'postCreateCommand' to run commands after the container is created.
58+
// "postCreateCommand": "uname -a",
59+
60+
// Configure tool-specific properties.
61+
// "customizations": {},
62+
63+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
64+
// "remoteUser": "root"
65+
}
66+
67+
```
68+
69+
Ahora sólo tenemos que reabrir el directorio utilizando la opción de `Devcontainers` y tendremos el entorno preparado para trabajar con `Terraform` y `AWS`
70+
3671
## Referencias
3772

3873
[Terraform Downloads](https://www.terraform.io/downloads)

05-iac/00-terraform/04-usando-inputs-outputs/02-demo.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ terraform apply "d1.tfplan"
1616

1717
Crear `./lab/lc_web_app/variables.tf`.
1818

19-
```tf
19+
```ini
2020
# variables.tf
2121
variable "aws_access_key" {
2222
type = string
@@ -90,7 +90,7 @@ provider "aws" {
9090

9191
Vamos a crear nuevas entradas en `variables.tf` para los recursos de Networking.
9292

93-
```tf
93+
```ini
9494
# ....
9595
# NETWORKING
9696
variable "vpc_cidr_block" {
@@ -183,7 +183,7 @@ resource "aws_route_table" "rtb" {
183183

184184
Creamos nuevas entradas en `variables.tf` par los recusos de los SG
185185

186-
```tf
186+
```ini
187187
# ....
188188

189189
# SECURITY GROUPS
@@ -200,7 +200,7 @@ variable "sg_ingress_port" {
200200
}
201201

202202
variable "sg_egress_cidr_blocks" {
203-
type map = list(string)
203+
type = list(string)
204204
description = "cidr blocks allow for egress"
205205
default = ["0.0.0.0/0"]
206206
}

05-iac/00-terraform/04-usando-inputs-outputs/03-demo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ terraform apply "d1.tfplan"
1616

1717
Crear `./lab/lc_web_app/locals.tf`.
1818

19-
```tf
19+
```ini
2020
locals {
2121
common_tags = {
2222

@@ -31,7 +31,7 @@ Queremos añadir 3 valores, `company`, `project` y `billing_code`. Vamos a sacar
3131

3232
Actualizamos `variables.tf`
3333

34-
```tf
34+
```ini
3535
# ....
3636
# COMMON
3737
variable "company" {

05-iac/00-terraform/04-usando-inputs-outputs/04-demo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ terraform apply "d1.tfplan"
1212

1313
Creamos `./lab/lc_web_app/outputs.tf`
1414

15-
```tf
15+
```ini
1616
output "aws_instance_public_dns" {
1717

1818
}
1919
```
2020

2121
Para la entrada tomamos el valor expuesto por la instacia en `main.tf`
2222

23-
```tf
23+
```ini
2424
resource "aws_instance" "nginx1" {
2525
```
2626

05-iac/00-terraform/05-incorporando-recursos/07-demo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ EOF
7070

7171
Actualizamos `loadbalancer.tf`
7272

73-
```tf
73+
```ini
7474
## aws_lb
7575

7676
## aws_lb_target_group

05-iac/00-terraform/06-incorporando-nuevos-providers/14-demo.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Crear `lab/lc_web_app/s3.tf`
1919
```tf
2020
# aws_s3_bucket
2121
22-
# aws_s3_bucket_object
22+
# aws_s3_bucket_acl
23+
24+
# aws_s3_bucket_policy
2325
2426
# aws_iam_role
2527

0 commit comments

Comments
 (0)