Skip to content

Commit c4f99ee

Browse files
authored
Merge pull request MichaelCade#425 from manuelver/feature/translateES-15
Feature/translate es 15
2 parents 26e2599 + 3db01c0 commit c4f99ee

4 files changed

Lines changed: 154 additions & 158 deletions

File tree

2022/es/Days/day59.md

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
## Create a VM with Terraform & Variables
1+
## Crear una VM con Terraform y Variables
22

3-
In this session, we are going to be creating a VM or two VMs using terraform inside VirtualBox. This is not normal, VirtualBox is a workstation virtualisation option and this would not be a use case for Terraform but I am currently 36,000ft in the air and as much as I have deployed public cloud resources this high in the clouds it is much faster to do this locally on my laptop.
3+
En esta sesión, vamos a crear una o dos VMs utilizando Terraform dentro de VirtualBox. Esto no es lo habitual, ya que VirtualBox es una opción de virtualización de estaciones de trabajo y este no sería un caso de uso típico para Terraform, pero actualmente estoy a 36,000 pies de altura y, aunque he implementado recursos de la nube pública a esta altitud en las nubes, es mucho más rápido hacerlo localmente en mi computadora portátil.
44

5-
Purely for demo purposes but the concept is the same we are going to have our desired state configuration code and then we are going to run that against the VirtualBox provider. In the past, we have used vagrant here and I covered the differences between vagrant and terraform at the beginning of the section.
5+
Solo con fines de demostración, pero el concepto es el mismo: vamos a tener nuestro código de configuración de estado deseado y luego lo ejecutaremos con el proveedor de VirtualBox. En el pasado, hemos utilizado Vagrant aquí y ya he cubierto las diferencias entre Vagrant y Terraform al principio de la sección.
6+
Crear una máquina virtual en VirtualBox
67

7-
### Create a virtual machine in VirtualBox
8+
## Lo primero que vamos a hacer es crear una nueva carpeta llamada VirtualBox. Luego podemos crear un archivo VirtualBox.tf y ahí es donde definiremos nuestros recursos. El siguiente código, que se encuentra en la carpeta VirtualBox como VirtualBox.tf, creará 2 VMs en VirtualBox.
89

9-
The first thing we are going to do is create a new folder called VirtualBox, we can then create a VirtualBox.tf file and this is going to be where we define our resources. The code below which can be found in the VirtualBox folder as VirtualBox.tf is going to create 2 VMs in Virtualbox.
10+
Puedes encontrar más información sobre el proveedor de VirtualBox de la comunidad aquí[here](https://registry.terraform.io/providers/terra-farm/virtualbox/latest/docs/resources/vm)
1011

11-
You can find more about the community VirtualBox provider [here](https://registry.terraform.io/providers/terra-farm/virtualbox/latest/docs/resources/vm)
12-
13-
```
12+
```terraform
1413
terraform {
1514
required_providers {
1615
virtualbox = {
@@ -20,7 +19,7 @@ terraform {
2019
}
2120
}
2221
23-
# There are currently no configuration options for the provider itself.
22+
# Actualmente no hay opciones de configuración para el propio proveedor.
2423
2524
resource "virtualbox_vm" "node" {
2625
count = 2
@@ -45,53 +44,48 @@ output "IPAddr_2" {
4544
4645
```
4746

48-
Now that we have our code defined we can now perform the `terraform init` on our folder to download the provider for Virtualbox.
47+
Ahora que hemos definido nuestro código, podemos ejecutar `terraform init` en nuestra carpeta para descargar el proveedor de VirtualBox.
4948

5049
![](Images/Day59_IAC1.png)
5150

52-
You will also need to have VirtualBox installed on your system as well. We can then next run `terraform plan` to see what our code will create for us. Followed by `terraform apply` the below image shows your completed process.
51+
También necesitarás tener VirtualBox instalado en tu sistema. A continuación, podemos ejecutar terraform plan para ver qué creará nuestro código. Luego, ejecutamos `terraform apply`. La siguiente imagen muestra el proceso completo.
5352

5453
![](Images/Day59_IAC2.png)
5554

56-
In Virtualbox, you will now see your 2 virtual machines.
55+
En VirtualBox, ahora verás tus 2 máquinas virtuales.
5756

5857
![](Images/Day59_IAC3.png)
5958

60-
### Change configuration
59+
### Cambiar la configuración
6160

62-
Let's add another node to our deployment. We can simply change the count line to show our new desired number of nodes. When we run our `terraform apply` it will look something like the below.
61+
Agreguemos otro nodo a nuestra implementación. Simplemente podemos cambiar la línea de conteo para indicar nuestro nuevo número deseado de nodos. Cuando ejecutemos `terraform apply`, se verá algo como lo siguiente.
6362

6463
![](Images/Day59_IAC4.png)
6564

66-
Once complete in VirtualBox you can see we now have 3 nodes up and running.
65+
Una vez que se complete, en VirtualBox verás que ahora tenemos 3 nodos en funcionamiento.
6766

6867
![](Images/Day59_IAC5.png)
6968

70-
When we are finished we can clear this up using the `terraform destroy` and our machines will be removed.
69+
Cuando hayamos terminado, podemos limpiar esto utilizando `terraform destroy` y nuestras máquinas serán eliminadas.
7170

7271
![](Images/Day59_IAC6.png)
7372

74-
### Variables & Outputs
75-
76-
We did mention outputs when we ran our hello-world example in the last session. But we can get into more detail here.
77-
78-
But there are many other variables that we can use here as well, there are also a few different ways in which we can define variables.
79-
80-
- We can manually enter our variables with the `terraform plan` or `terraform apply` command
81-
82-
- We can define them in the .tf file within the block
83-
84-
- We can use environment variables within our system using `TF_VAR_NAME` as the format.
73+
### Variables y Salidas
8574

86-
- My preference is to use a terraform.tfvars file in our project folder.
75+
Mencionamos las salidas cuando ejecutamos nuestro ejemplo de "hola mundo" en la última sesión. Pero aquí podemos entrar en más detalle.
8776

88-
- There is an \*auto.tfvars file option
77+
Pero hay muchas otras variables que podemos utilizar aquí, también hay algunas formas diferentes en las que podemos definir variables.
8978

90-
- or we can define when we run the `terraform plan` or `terraform apply` with the `-var` or `-var-file`.
79+
- Podemos ingresar manualmente nuestras variables con el comando `terraform plan` o `terraform apply`.
80+
- Podemos definirlas en el archivo .tf dentro del bloque correspondiente.
81+
- Podemos utilizar variables de entorno en nuestro sistema utilizando el formato `TF_VAR_NOMBRE`.
82+
- Mi preferencia es usar un archivo terraform.tfvars en la carpeta de nuestro proyecto.
83+
- Existe la opción de utilizar un archivo \*auto.tfvars.
84+
- También podemos definir las variables al ejecutar `terraform plan` o `terraform apply` con las opciones `-var` o `-var-file`.
9185

92-
Starting from the bottom moving up would be the order in which the variables are defined.
86+
Comenzando desde abajo y avanzando hacia arriba, así se define el orden en el que se definen las variables.
9387

94-
We have also mentioned that the state file will contain sensitive information. We can define our sensitive information as a variable and we can define this as being sensitive.
88+
También hemos mencionado que el archivo de estado contendrá información confidencial. Podemos definir nuestra información confidencial como una variable y especificar que es confidencial.
9589

9690
```
9791
variable "some resource" {
@@ -102,9 +96,9 @@ variable "some resource" {
10296
}
10397
```
10498

105-
## Resources
99+
## Recursos
106100

107-
I have listed a lot of resources down below and I think this topic has been covered so many times out there, If you have additional resources be sure to raise a PR with your resources and I will be happy to review and add them to the list.
101+
He enumerado muchos recursos a continuación y creo que este tema ha sido cubierto tantas veces, si tienes recursos adicionales, asegúrate de enviar una solicitud de extracción (PR) con tus recursos y estaré encantado de revisarlos y agregarlos a la lista.
108102

109103
- [What is Infrastructure as Code? Difference of Infrastructure as Code Tools](https://www.youtube.com/watch?v=POPP2WTJ8es)
110104
- [Terraform Tutorial | Terraform Course Overview 2021](https://www.youtube.com/watch?v=m3cKkYXl-8o)
@@ -116,5 +110,6 @@ I have listed a lot of resources down below and I think this topic has been cove
116110
- [Terraform Simple Projects](https://terraform.joshuajebaraj.com/)
117111
- [Terraform Tutorial - The Best Project Ideas](https://www.youtube.com/watch?v=oA-pPa0vfks)
118112
- [Awesome Terraform](https://github.com/shuaibiyy/awesome-terraform)
113+
- [Herramientas para Terraform](https://vergaracarmona.es/herramientas-para-terraform/)
119114

120-
See you on [Day 60](day60.md)
115+
Nos vemos en el [Día 60](day60.md)

2022/es/Days/day60.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## Docker Containers, Provisioners & Modules
1+
## Contenedores de Docker, provisionadores y módulos
22

3-
On [Day 59](day59.md) we provisioned a virtual machine using Terraform to our local FREE VirtualBox environment. In this section, we are going to deploy a Docker container with some configuration to our local Docker environment.
3+
En el [ 59](day59.md) provisionamos una máquina virtual utilizando Terraform en nuestro entorno local de VirtualBox GRATIS. En esta sección, vamos a implementar un contenedor de Docker con alguna configuración en nuestro entorno local de Docker.
44

5-
### Docker Demo
5+
### Demostración de Docker
66

7-
First up we are going to use the code block below, the outcome of the below is that we would like a simple web app to be deployed into docker and to publish this so that it is available to our network. We will be using nginx and we will make this available externally on our laptop over localhost and port 8000. We are using a docker provider from the community and you can see the docker image we are using also stated in our configuration.
7+
Primero, vamos a utilizar el bloque de código a continuación. El resultado de esto es que queremos desplegar una aplicación web simple en Docker y publicarla para que esté disponible en nuestra red. Vamos a utilizar nginx y lo haremos disponible externamente en nuestro portátil a través de localhost y el puerto 8000. Estamos utilizando un proveedor de Docker de la comunidad y también puedes ver la imagen de Docker que estamos utilizando en nuestra configuración.
88

9-
```
9+
```terraform
1010
terraform {
1111
required_providers {
1212
docker = {
@@ -33,25 +33,25 @@ resource "docker_container" "nginx" {
3333
}
3434
```
3535

36-
The first task is to use `terraform init` command to download the provider to our local machine.
36+
La primera tarea es utilizar el comando `terraform init` para descargar el proveedor en nuestra máquina local.
3737

3838
![](Images/Day60_IAC1.png)
3939

40-
We then run our `terraform apply` followed by `docker ps` and you can see we have a running container.
40+
Luego ejecutamos `terraform apply` seguido de `docker ps` y puedes ver que tenemos un contenedor en ejecución.
4141

4242
![](Images/Day60_IAC2.png)
4343

44-
If we then open a browser we can navigate to `http://localhost:8000/` and you will see we have access to our NGINX container.
44+
Si abrimos un navegador y navegamos a `http://localhost:8000/`, verás que tenemos acceso a nuestro contenedor NGINX.
4545

4646
![](Images/Day60_IAC3.png)
4747

48-
You can find out more information on the [Docker Provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/container)
48+
Puedes encontrar más información sobre [Docker Provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/container)
4949

50-
The above is a very simple demo of what can be done with Terraform plus Docker and how we can now manage this under the Terraform state. We covered docker-compose in the containers section and there is a little crossover in a way between this, infrastructure as code as well as then Kubernetes.
50+
Lo anterior es una demostración muy sencilla de lo que se puede hacer con Terraform y Docker, y cómo podemos administrarlo ahora bajo el estado de Terraform. Cubrimos docker-compose en la sección de contenedores y hay un poco de superposición en cierto sentido entre esto, la infraestructura como código y luego Kubernetes.
5151

52-
To show this and how Terraform can handle a little more complexity, we are going to take the docker-compose file for WordPress and MySQL that we created with docker-compose and we will put this to Terraform. You can find the [docker-wordpress.tf](2022/Days/IaC/Docker-WordPress/docker-WordPress.tf)
52+
Para mostrar esto y cómo Terraform puede manejar un poco más de complejidad, vamos a tomar el archivo docker-compose de WordPress y MySQL que creamos con docker-compose y lo vamos a poner en Terraform. Puedes encontrar el [docker-wordpress.tf](2022/Days/IaC/Docker-WordPress/docker-WordPress.tf)
5353

54-
```
54+
```terraform
5555
terraform {
5656
required_providers {
5757
docker = {
@@ -111,25 +111,25 @@ resource "docker_container" "wordpress" {
111111
}
112112
```
113113

114-
We again put this in a new folder and then run our `terraform init` command to pull down our provisioners required.
114+
Nuevamente, colocamos esto en una nueva carpeta y luego ejecutamos el comando `terraform init` para descargar los provisionadores requeridos.
115115

116116
![](Images/Day60_IAC4.png)
117117

118-
We then run our `terraform apply` command and then take a look at our docker ps output we should see our newly created containers.
118+
Luego ejecutamos el comando `terraform apply` y luego echamos un vistazo a la salida de `docker ps` y deberíamos ver nuestros contenedores recién creados.
119119

120120
![](Images/Day60_IAC5.png)
121121

122-
We can then also navigate to our WordPress front end. Much like when we went through this process with docker-compose in the containers section we can now run through the setup and our WordPress posts would be living in our MySQL database.
122+
También podemos navegar a nuestra interfaz de WordPress. Al igual que cuando pasamos por este proceso con docker-compose en la sección de contenedores, ahora podemos realizar la configuración y nuestras publicaciones de WordPress estarían en nuestra base de datos de MySQL.
123123

124124
![](Images/Day60_IAC6.png)
125125

126-
Now we have covered containers and Kubernetes in some detail, we probably know that this is ok for testing but if you were going to be running a website you would not do this with containers alone and you would look at using Kubernetes to achieve this, Next up we are going to take a look using Terraform with Kubernetes.
126+
Ahora que hemos cubierto los contenedores y Kubernetes en detalle, probablemente sepamos que esto está bien para pruebas, pero si vamos a ejecutar un sitio web, no lo haríamos solo con contenedores y consideraríamos utilizar Kubernetes para lograr esto. A continuación, vamos a echar un vistazo a cómo utilizar Terraform con Kubernetes.
127127

128-
### Provisioners
128+
### Provisionadores
129129

130-
Provisioners are there so that if something cannot be declarative we have a way in which to parse this to our deployment.
130+
Los provisionadores están ahí para que, si algo no puede ser declarativo, tengamos una forma de enviar esto a nuestra implementación.
131131

132-
If you have no other alternative and adding this complexity to your code is the place to go then you can do this by running something similar to the following block of code.
132+
Si no tienes otra alternativa y agregar esta complejidad a tu código es el camino a seguir, puedes hacerlo ejecutando algo similar al siguiente bloque de código.
133133

134134
```
135135
resource "docker_container" "db" {
@@ -142,9 +142,9 @@ resource "docker_container" "db" {
142142
143143
```
144144

145-
The remote-exec provisioner invokes a script on a remote resource after it is created. This could be used for something OS-specific or it could be used to wrap in a configuration management tool. Although notice that we have some of these covered in their provisioners.
145+
El provisionador `remote-exec` invoca un script en un recurso remoto después de que se crea. Esto podría usarse para algo específico del sistema operativo o podría usarse para envolver en una herramienta de gestión de configuración. Aunque debes tener en cuenta que algunos de estos ya están cubiertos en sus propios provisionadores.
146146

147-
[More details on provisioners](https://www.terraform.io/language/resources/provisioners/syntax)
147+
[Más detalles de provisionadores](https://www.terraform.io/language/resources/provisioners/syntax)
148148

149149
- file
150150
- local-exec
@@ -154,21 +154,21 @@ The remote-exec provisioner invokes a script on a remote resource after it is cr
154154
- chef
155155
- puppet
156156

157-
### Modules
157+
### Módulos
158158

159-
Modules are containers for multiple resources that are used together. A module consists of a collection of .tf files in the same directory.
159+
Los módulos son contenedores para múltiples recursos que se utilizan juntos. Un módulo consiste en una colección de archivos .tf en el mismo directorio.
160160

161-
Modules are a good way to separate your infrastructure resources as well as be able to pull in third-party modules that have already been created so you do not have to reinvent the wheel.
161+
Los módulos son una buena forma de separar tus recursos de infraestructura, así como de poder utilizar módulos de terceros que ya han sido creados para no tener que reinventar la rueda.
162162

163-
For example, if we wanted to use the same project to build out some VMs, VPCs, Security Groups and then also a Kubernetes cluster we would likely want to split our resources out into modules to better define our resources and where they are grouped.
163+
Por ejemplo, si queremos utilizar el mismo proyecto para crear algunas VM, VPC, grupos de seguridad y también un clúster de Kubernetes, probablemente querríamos dividir nuestros recursos en módulos para definir mejor nuestros recursos y dónde se agrupan.
164164

165-
Another benefit to modules is that you can take these modules and use them on other projects or share them publicly to help the community.
165+
Otra ventaja de los módulos es que puedes tomar estos módulos y usarlos en otros proyectos o compartirlos públicamente para ayudar a la comunidad.
166166

167-
We are breaking down our infrastructure into components, components are known here as modules.
167+
Estamos dividiendo nuestra infraestructura en componentes, y esos componentes se conocen aquí como módulos.
168168

169-
## Resources
169+
## Recursos
170170

171-
I have listed a lot of resources down below and I think this topic has been covered so many times out there, If you have additional resources be sure to raise a PR with your resources and I will be happy to review and add them to the list.
171+
He enumerado muchos recursos a continuación y creo que este tema ha sido cubierto muchas veces, así que si tienes recursos adicionales, asegúrate de enviar una solicitud de extracción (PR) con tus recursos y estaré encantado de revisarlos y agregarlos a la lista.
172172

173173
- [What is Infrastructure as Code? Difference of Infrastructure as Code Tools](https://www.youtube.com/watch?v=POPP2WTJ8es)
174174
- [Terraform Tutorial | Terraform Course Overview 2021](https://www.youtube.com/watch?v=m3cKkYXl-8o)
@@ -180,5 +180,6 @@ I have listed a lot of resources down below and I think this topic has been cove
180180
- [Terraform Simple Projects](https://terraform.joshuajebaraj.com/)
181181
- [Terraform Tutorial - The Best Project Ideas](https://www.youtube.com/watch?v=oA-pPa0vfks)
182182
- [Awesome Terraform](https://github.com/shuaibiyy/awesome-terraform)
183+
- [Herramientas para Terraform](https://vergaracarmona.es/herramientas-para-terraform/)
183184

184-
See you on [Day 61](day61.md)
185+
Nos vemos en el [Día 61](day61.md)

0 commit comments

Comments
 (0)