🔁 How AWS Permissions Work

Struggling with AWS permissions? Here is a summary I generated using ChatGPT. I think that the formula below is really helpful!

Permission boundaries are new to me!

To execute an AWS action, all of the following conditions must be true:

  1. ✅ The IAM identity-based policy allows it
    → This includes policies attached to users, groups, or roles.
  2. ✅ The permission boundary (if used) allows it
    → Applies ONLY to IAM users or roles, not groups; acts as a maximum scope limiter.
  3. ✅ The Service Control Policy (SCP), if present, allows it
    → Applies at the AWS Organization level to limit permissions across accounts/OUs.
  4. ✅ The resource-based policy allows it (if required)
    → Only necessary for services or specific features that depend on resource policies
    (e.g., S3 cross-account access, SQS access by Lambda, CloudTrail writing to S3).

🔐 Formula:

This uses set theory notation, where ⊓ shows the intersection of two sets.

Effective Permission = IAM Allow ⊓
(Boundary Allow, if boundary is attached) ⊓
(SCP Allow, if in an AWS Organization) ⊓
(Resource Policy Allow, if required by the service or feature)

or with compact notation (where square brackets indicate conditionals)

Effective Permission = IAM Allow
                    ⊓ [Boundary Allow]
                    ⊓ [SCP Allow]
                    ⊓ [Resource Policy Allow]

Systems as Code – a system-wide model for Devops Automation

This article explains my model for automating the entire software stack – I call it “Systems as Code”. The model gives us a common frame of reference when speaking about aspects of a comprehensive software system.

Systems as Code - showing the layers of a software system: Infrastructure, Platform, Application Deployment and Application Development.
Systems as Code – showing the layers of a software system: Infrastructure, Platform, Application Deployment and Application

Infrastructure Setup
At the bottom of the system there is the infrastructure setup. This defines the networks, virtual machines, load balancers, firewalls etc that support the systems at a very basic level. Traditionally these aspects of the system have been viewed as physical bits. The advent of virtualisation (of machines, networks, load balancers and firewalls) completely transforms this – we can now view the infrastructure layer as a piece of software. The physical machinery is no longer our concern – using source code types (such as Azure ARM templates, Terraform configurations) we are now able to model the infrastructure as a textual representation – a codeable, configurable and versionable suite of software.

Platform Setup
The platform setup describes the process of setting up operating system, as well as the base services (e.g. database services) and frameworks (e.g. runtimes such as the .Net framework) that are installed in order to support the application. The platform layer can be configured using scripts such as Powershell / Bash / Ruby, and the configuration can be executed by an agent running on the target machine. Alternatively, containers such as Docker provide the ability to perform the configuration at build time, thus obviating the need to introduce a deployment step for the platform layer at the time of release. Modern applications are generally “headless” and so bring all of their dependencies with the application deployment – a .Net Core website, for example, will fire up its own Kestrel web server, thus doing away with the need to configure the platform layer in advance.

Application Deployment
The application deployment describes the process of taking the build artifacts, and copying (or installing) these onto the operating system (platform). This process is again described by a set of scripts or declarations to describe how the artifacts should be deployed. The application deployment may be the code for a Wix msi, a Service Fabric manifest, a bash script or some commands in a Dockerfile. Current-day applications which utilise containers will bake the deployment into the build phase, thus minimising any last minute failures during the release. No more moving parts during application deployment, as the application has been deployed on day zero even before it is user-tested!

Application Development
Application development is the aspect of software that has been around since software was invented – it is the bits of code that we write to make the computers perform the bits of automation that give us their usefulness! We write .Net code, Java, C++ etc to produce our software applications. All of this is represented as code artefacts – a textual representation, stored in version control, just like all of the other layers.

Source Control
Source control is the foundation of Systems As Code. With source control, we are able to evolve the system safely, diff the changes, rollback to previous versions, audit the changes, and collaborate. Source control is a low-level means of self-documentation. If you want to understand how the system works, and how the system is deployed, you can read the plain text files in source control.

The code to deploy the system should live alongside the application code (preferably in its own directory) so that the application can always be deployed correctly at any specific version. Alternatively, the deployment code version should be pinned within the application code as a dependency, and the deployment should be shared in a package repository, such Nuget).

The application code is always tied to a particular version of the deployment code

Parting thoughts

“The first electronic computing devices were … rewired in order to “reprogram” them. ” (Wikipedia article about Software)

We have come a long way since 1946, before the first implementation of “software”. We are have now advanced enough to be able to think of every aspect of the system as a piece of software, with its corresponding algorithms and configurations, stored in source control. We do not need to rewire/patch the network in order to obtain a new subnet; nor do we need to buy a new piece of metal in order to stand up an additional machine. All the aspects of the system (including the infrastructure, platform, application deployment and the application itself) can be developed, configured and executed in a repeateable and deterministic manner, as pieces of software: Systems as Code.