• Terraform apply without updating modified resources

    2 min read

    Terraform plan apply refresh

    When we are deploying infrastructure using terraform we need to understand that we should not be modifying what we have deployed, otherwise terraform will undo these changes if we apply it again. This is actually a good thing to make sure the code reflex the state of the infrastructure but sometimes can be a pain

    24/01/2022

    Read more...
  • Using AWS Karpenter with spot instances

    3 min read

    One of the advantages of using AWS Karpenter is that makes straightforward using spot instances. But how do we handle termination notices coming from AWS?

    21/01/2022

    Read more...
  • Terraform: retrieve AWS information

    2 min read

    When running terraform on an AWS account we might need to have some context information such as it's account ID or the region we are in. Instead of having to set them as variables we can use the aws_caller_identity, aws_partition and aws_region datasources to retrieve this information

    19/01/2022

    Read more...
  • Using multi-stage build to optimize Docker images

    2 min read

    docker build multistage

    To be able to build a Docker image we might need some packages that we won't be using at runtime, an example of this would be the compiler or any of the tools we might be using to build it (make, ant, maven...)

    Instead of installing the tools to remove them later on while building the Docker image we can use a multistage build so we can just copy the artifacts we need to the final image.

    17/01/2022

    Read more...
  • Load a Jenkins Pipeline Shared Library from a git repository

    2 min read

    To load a specific Jenkins Pipeline Shared Library we can use the @Library() function, but the library needs to be configured on Jenkins:

    @Library('demo-shared-library') _
    

    This is particularly annoying if:

    • We don't have admin access to Jenkins (so we might need to request every single change)
    • We need to test several libraries, so we would need to configure every single library we want to test

    13/01/2022

    Read more...

More recent...

Older content...