• AWS S3 CLI: How to check if a file exists?

    Introduction

    In this tutorial, we will look at a few different ways how you can check if a particular file exists in S3.

    s3 ls

    You can use the following command to check if a file exists in an S3 bucket:

    aws s3 ls s3://bucket-name/path/to/file
    

    If the file exists, the command will return its metadata. If the file does not exist, the command will return an error message.

    However, this command will not work if you have multiple files with the same prefix. For example, if you have the following files in your bucket:

    Read on →

  • AWS S3 CLI: How to use wildcards and filters to copy files?

    Introduction

    AWS S3 CLI doesn’t support regular expressions with the path parameter. To use regular expressions with the AWS S3 CLI, you can use the --include and --exclude parameters to filter the files that you want to copy. These options allow you to specify a regex pattern to filter the files. AWS will only return the files that match the pattern.

    In this tutorial, we will look at how filters work and how we can use them to copy files that match a pattern.

    Read on →

  • AWS S3 CLI: How to set the Content-Type header when uploading a file?

    Introduction

    The Content-Type header is used to indicate the type of content that is being sent. This is useful for the browser to render the content correctly. For example, if the content is a text file, the browser will render it as a text file. If the content is an image, the browser will render it as an image.

    If you are using AWS S3 to host your static website, you can set the Content-Type header for each file. This will ensure that the browser renders the content correctly.

    In this tutorial, we will look at how we can use the AWS S3 CLI to set the content-type when uploading a file.

    Read on →

  • How to enable full GitHub clone with AWS CodePipeline?

    Introduction

    AWS CodePipeline is a managed service from Amazon Web Services (AWS) that allows developers to build, test and deploy their applications. It is a continuous delivery service that helps you automate your release pipelines for fast and reliable application and infrastructure updates. CodePipeline automates the build, test, and deploy phases of your release process every time there is a code change, based on the release model you define.

    In this tutorial, we will look into how you can enable entire Git clone with AWS CodePipeline.

    Read on →

  • How to stop AWS CodeBuild execution after failure?

    Introduction

    AWS CodeBuild is a managed service from Amazon Web Services (AWS) that allows developers to build applications without having to manage servers. This makes it easier for them to build, test and deploy their services.

    Developers can define their build specification (buildspec) using a collection of commands and settings in a YAML file. This file is called buildspec.yaml and is stored in the root of the source code repository. The buildspec.yaml file defines the build environment, the build commands, and the build artifacts. You can read more about the buildspec.yaml file here.

    In this tutorial, we will look into how you can detect a failure during the Build phase of your CodeBuild build and stop the execution of the build.

    Read on →