Devops Interview
Devops Interview
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
}
To prevent it from being created without encryption, you can use terraform
validate to check the configuration.
user_data = <<-EOF
#!/bin/bash
apt-get update
apt-get install -y nginx
systemctl start nginx
systemctl enable nginx
EOF
}
This will update all the provider plugins to their latest compatible versions.
7. What is $*, $@, $?. Have you used shift? What is CI/CD?
$*: Represents all the arguments passed to the script as a single
string.
$@: Similar to $*, but treats each argument as a separate word. This is
useful if you want to handle arguments individually in the script.
$?: Represents the exit status of the last executed command. A value
of 0 indicates success, and any non-zero value indicates an error.
Under the "Templates" section, create a new job template and specify
the playbook.
You can then run the job from the UI or use the API.
11. How to create your own base image? How to build it?
To create a custom base image, you can start with a minimal operating
system (like Ubuntu or Alpine) and install only the necessary packages.
Here’s an example of building a custom Docker image:
1. Create a Dockerfile:
dockerfileCopyEditFROM ubuntu:20.04
RUN apt-get update && apt-get install -y nginx
COPY ./index.html /usr/share/nginx/html/
CMD ["nginx", "-g", "daemon off;"]
COPY: Copies files from the host machine into the image.
Docker Swarm: A native clustering tool for Docker that turns a group
of Docker engines into a single, virtual Docker engine.
When you run terraform apply, Terraform will detect that one of the
resources has been deleted (because the state file no longer matches the
actual cloud state) and will recreate the resource to match the configuration.
This will only destroy the specified resource while leaving others intact.
Let me know if you need further details!