Category: aws-sdk
-
Terraform Module to Build an AMI using CodeBuild and Packer
I’ve created a terraform module that will allow you to build any AMI with a Packer configuration in a Git repository, using CodeBuild, and place the AMI ID in an SSM Parameter for use by other modules. I’ve created this module so that any AMI that I build can easily be deployed and built on…
-
Connect to GitHub from AWS CodeBuild
In order to build and deliver software in AWS using Github as the source repository, you have to setup a connection to authorize AWS to use Github. The best way is to use a GitHub App connection. AWS has some great documentation on how to do this. First, you need access to a GitHub account…
-
Drain and Replace EKS Worker Nodes
Unliked managed node groups, EKS worker node groups have to be recycled outside EKS after updating the AMI reference. I recently migrated all of my hosted sites from ECS to EKS and am using terragrunt/terraform for all infrastructure as code. I then upgraded the AMI that I used for the worker node groups and had…
-
AWS LoadBalancer SSL Redirect with Bitnami Helm Chart(s)
First of all, thank you to Bitnami for providing such valuable helm charts to the community. What a great resource! Why doesn’t Bitnami support adding an SSL redirect for AWS LoadBalancing in their helm charts? I have worked with several lately where the templates baked into the helm charts will not allow the addition of…
-
AWS Access Keys in S3 Bucket Policies
I’ve seen what appeared to be AWS Access Keys in S3 bucket policies as an AWS principal in the past. I could never figure out why this was happening and nobody appeared to be adding them. The Access Key never showed up as a valid user Access Key in a search of IAM objects either.…
-
Adding Global Environment Variables to Jenkins via puppet…
When using Jenkins in any environment, it’s useful to have variables related to that environment available to Jenkins jobs. I recently worked on a project where I used puppet to deploy global environment variables to Jenkins for use with AWS commands — typically to execute the awscli, one must have knowledge of the region, account,…
-
Retrieving puppet facts from AWS System Manager
AWS System Manager makes it easy to store and retrieve parameters for use across servers, services, and applications in AWS. One great benefit is storing secrets for use, as needed. I recently needed to retrieve some parameters to place in a configuration file via puppet and wrote a short script to retrieve these values as…
-
ruby aws-sdk strikes again…
When using ruby to upload files to S3 and trying to use multipart upload, beware the following ArgumentError: …param_validator.rb:32:in `validate!’: unexpected value at params[:server_side_encryption] (ArgumentError) … from /var/lib/jenkins/.gem/ruby/gems/aws-sdk-core-3.6.0/lib/seahorse/client/request.rb:70:in `send_request’ from /var/lib/jenkins/.gem/ruby/gems/aws-sdk-s3-1.4.0/lib/aws-sdk-s3/client.rb:3980:in `list_parts’ … The options passed to list_parts must not include “server_side_encryption”. I always forget to remove this parameter. A good way that I have…
-
Throttling Requests with the Ruby aws-sdk
A common problem of late is throttling requests when using the ruby aws-sdk gem to access AWS services. Handling these exceptions is fairly trivial with a while loop like the following: retry_count = 0 retry_success = 0 while retry_success == 0 retry_success = 1 begin # # enter code to interact with AWS here #…
-
Multipart uploads to s3 using aws-sdk v2 for ruby…
The Ruby guys over at AWS have done a great job at explaining file uploads to S3 but they left out how to perform multipart uploads citing reservation over “advanced use cases“. Prerequisites: identify an S3 bucket to upload a file to — use an existing bucket or create a new one create or identify…