"In IAM authentication, instead of using a password to authenticate against the [service], you create an authentication token that you include with your ... request. These tokens can be generated outside the [service] using AWS Signature Version 4(SigV4) and can be used in place of regular authentication." [1]
Monday, January 12, 2026
The Federation: AWS Glue
Tuesday, January 6, 2026
Cross account AWS Permissions
- a Service that is allowed to assume a role (eg, EKS)
- AWS which indicates an IAM user or role or an assumed role (see below). Note that root does not indicate the most powerful user as in Unix. On the contrary, it means anybody legitimately associated with this account.
- Federated which means it's a provider external to the native AWS ecosystem.
arn:aws:sts::123456789012:assumed-role/S3ReadWriteRoleSF/snowflake
Monday, December 15, 2025
AWS cheatsheet
aws iam list-instance-profiles-for-role --query 'AttachedPolicies[*].PolicyArn' --role-name $ROLE_NAME --query "InstanceProfiles[].InstanceProfileName" --output text
- Trust policies say who can access a role.
- Permission policies say what a role can do.
aws glue get-databases --query 'DatabaseList[*].Name' --output table
Monday, November 24, 2025
AWS and HTTPs
- A Kubernetes service account must be given permissioned to access AWS infra structure
- The Kubernetes cluster needs AWS specific pods to configure the K8s ingress such that it receives traffic from outside the cloud
- The ingress is where the SSL de/encryption is performed.
- Creating the certificate is easy when using the AWS web console and there you just associate it with the domain name.
"Public-hosted zones have a route to internet-facing resources and resolve from the internet using global routing policies. Meanwhile, private hosted zones have a route to VPC resources and resolve from inside the VPC." - AWS for Solution Architects, O'Reilly
Tuesday, November 18, 2025
Snowflake and AWS
Monday, November 3, 2025
AWS, Kubernetes and more
- a new Virtual Private Cloud (VPC) in which sit the K8s control plane and workers. A VPC is "a logically isolated and secure network environment that is separate from the rest of the AWS cloud" [1]
- two public subnets and two private subnets (best practice if you want high availability). By putting worker nodes in the private subnet, they cannot be maliciously scanned from the internet.
- all necessary NAT Gateways to allow the private subnets to access the internet
- Internet Gateways allowing the internet to talk to your public subnets.
- Route Tables which are just rules for network traffic. It's the "Routers use a route table to determine the best path for data packets to take between networks" [2]
Monday, October 20, 2025
Spark and K8s on AWS
- Create the secret with aws secretsmanager create-secret ...
- Create a policy with aws iam create-policy... This reference the secret's ARNs in step 1.
- Create a role with aws iam create-role... that allows a role to be assumed via STS.
- Attach the policy in step 2 with the role in step 3 with aws iam attach-role-policy...
- Create a SecretProviderClass with kubectl apply -f... that references the secrets created in step 1
- Associate your K8s Deployment with the SecretProviderClass using its volumes.
Thursday, September 11, 2025
Configuring Polaris for AWS
- Configure your cloud account such that it's happy handing out access tokens
- Configure Polaris, both the credentials to access Polaris and the Catalog that is essentially a proxy to the cloud provider
- Configure Spark's SparkConf.
Tuesday, August 16, 2022
More AWS/GitHub notes
If you don't fancy hand-crafting YAML to set up your AWS infrastructure, Amazon offers the Cloud Development Kit.
They've taken an interesting architectural decision. They've written the logic in JavaScript executed via node. But to make it a polyglot kit, they've added what are essentially bindings that run the node executable. I guess this makes the logic less likely to diverge between languages but it also means more hassle setting up your environment.
What it means is that the Java (or the supported language of your choice) does not talk to the AWS cloud directly. It generates files that you must then feed to cdk. This is different to Fabric8's Kubernetes client or the docker-java library, both of which allow you to control the containerization in the JVM with no further tooling required.
[Aside: Terraform have a similar toolkit to CDK here but I gave up due to the lack of documentation].
CDK set up
AWS's Java CDK binding needs node in the PATH environment variable. Note, IntelliJ doesn't seem to put it into the PATH by default and I was getting the unhelpful "SyntaxError: Unexpected token ?" - a very unintuitive message. It appears that the Java implementation executes this node command using ProcessBuilder (see JsiiRuntime.startRuntimeIfNeeded) .
You install the node runtime with
npm install -g aws-cdk
You can initialize a Java project with:
cdk init app --language java
You then write your Java code to describe your environment using the libraries pulled in by the generated pom.xml. Knowing exactly what to do can be hard so you might want to look at some example on GitHub here.
When you're done, run your Java code. Then you can call cdk synth to generate the metadata and cdk deploy to deploy it and as if by magic, your S3 bucket etc is deployed in AWS! Note you must run this in the top-level directory of your Java project. Apparently, state is saved and shared between the Java build and the call to cdk.
All an act
You can run GitHub actions locally with act. This really helps with debugging.
If you're .github YAML looks like this:
jobs:
code:
Then run Act with something this:
act -n --env-file .github/pr.yml -j code -s AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -s AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
where the -j means which YAML block you're running.
Remove the -n if you want it to be a real run rather than a dummy run.
If you want to use secrets, you can just set them as environment variables. For instance:
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
run: /root/.local/bin/poetry run python -m pytest integration_tests
will use your system's environment variable AWS_ACCESS_KEY_ID as the value of AWS_ACCESS_KEY that the integration tests use.
Tuesday, July 19, 2022
Docker, ECS and access
AWS now offers the ability to remotely login to Docker containers running in ECS. The secret sauce in the Terraform script was to point execution_role_arn under the
resource "aws_ecs_task_definition" "compute_task"
to the ARN of an aws_iam_role that has the right policy. A really good guide is here. However, I still had a few issues.
First, you need to install session-manager-plugin. I followed all the instructions to install it on Ubuntu here and it seemed to install without error. But, when I ran:
$ aws ecs execute-command --cluster CLUSTER_NAME --task TASK_ARN --container CONTAINER --interactive --command "/bin/bash"
SessionManagerPlugin is not found. Please refer to SessionManager Documentation here: http://docs.aws.amazon.com/console/systems-manager/session-manager-plugin-not-found
Which was odd as it evidently was installed:
henryp@adele:~$ session-manager-plugin
The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.
Interestingly, the excellent IntelliJ AWS plugin could connect but I noticed that it used it's own session-manager-plugin even though it claimed to be exactly the same version.
So, I created a Docker image to run on my local machine that thas the session-manager-plugin installed. Amazon does not appear to offer this so I needed to build my own. I had a file called AwsDocker/Dockerfile that had this:
FROM amazon/aws-cli
RUN curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" && \
yum install -y ./session-manager-plugin.rpm
docker build --no-cache -t my_aws AwsDocker/
and run with:
docker run -v $HOME/.aws/credentials:/root/.aws/credentials:ro -t -i my_aws --debug --region eu-west-2 ecs execute-command --cluster CLUSTER_NAME --task TASK_ARN --interactive --command "/bin/bash"
And lo! I manage to login. (You can lose the --debug if you want as it's verbose but it does help sometimes).
Note that there are many ways [SO] to add the credentials to the local Docker image and the one I chose from the SO answer is a bit broken. The line above fixes it.