Volume 1 · Chapter 3 — AWS Foundations and Cloud Computing
Interacting with AWS: Console, CLI, SDK, and IaC
3.1 Introduction
Everything in AWS is ultimately driven by a set of web APIs, and there are four ways you interact with them: the Management Console (a web UI), the CLI (command line), the SDKs (from application code), and infrastructure as code (declarative templates). Which one you reach for is a signal of maturity. Clicking in the console is fine for learning and inspection, but a professional, auditable, repeatable environment - the kind a bank requires - is built with infrastructure as code and automation, not by hand. This chapter maps the four interfaces and explains when each is appropriate.
3.2 The Management Console
The Console is the browser-based graphical interface. It’s excellent for learning, exploring a service’s options, inspecting the state of resources, and one-off investigation during an incident. Its weakness is that manual clicking is not repeatable, not reviewable, and not auditable: you can’t diff it, you can’t code-review it, and you can’t reliably reproduce it in another environment. So the Console is where you learn and look, but not where you build production infrastructure - because “someone clicked something” is exactly the kind of untracked change a regulated environment cannot tolerate.
3.3 The CLI and SDKs
The AWS CLI lets you drive every service from a terminal or script, which makes actions repeatable and automatable - ideal for scripting operational tasks and gluing steps together in pipelines. The SDKs are language-specific libraries (for Python, Java, JavaScript, .NET, Go, and more) that let your application code call AWS services directly - for example, an application writing an object to S3 or reading a secret at runtime. Both authenticate as an identity and are governed by the same permission model as everything else in AWS. The important practice is that neither the CLI nor an application should carry long-lived access keys where it can be avoided; on AWS compute, they should assume an IAM role and receive temporary credentials automatically (covered in the security volume).
# CLI: repeatable, scriptable, auditable - the same call an SDK makes under the hood.
aws s3 cp ./statement.pdf s3://bank-statements/2026/07/statement.pdf --sse aws:kms
aws rds describe-db-instances --query 'DBInstances[].{id:DBInstanceIdentifier,az:AvailabilityZone}'
3.4 Infrastructure as Code
Infrastructure as code (IaC) is how mature teams provision AWS: you describe the desired infrastructure in declarative, version-controlled files and a tool creates and updates it for you. The AWS-native tool is CloudFormation (and the CDK, which generates CloudFormation from real programming languages); Terraform is the popular cloud-agnostic alternative. The benefits are the same discipline you apply to application code: every change is peer-reviewed and version-controlled, environments are reproduced identically from the same templates (eliminating “works in staging” drift), and the whole environment can be rebuilt for disaster recovery. For a regulated bank, IaC also provides the audit trail and repeatability that compliance demands. (Volume 9 covers IaC in depth.)
# CloudFormation: declarative desired state, reviewed in a pull request, applied repeatably.
Resources:
BankAppBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: bank-statements
BucketEncryption: # encryption on by default, by policy
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault: { SSEAlgorithm: aws:kms }
PublicAccessBlockConfiguration: # never publicly exposed
BlockPublicAcls: true
BlockPublicPolicy: true
3.5 The Progression of Maturity
A useful way to see these interfaces is as a maturity progression. You start in the Console to learn a service and see what’s possible. You use the CLI to automate repetitive tasks and explore scripting. You use SDKs where your application itself must call AWS. And you graduate to infrastructure as code for anything that must be reproducible, reviewed, and audited - which in practice is all production infrastructure. The senior mindset is that production infrastructure is defined in code and changed through pipelines, with the Console reserved for read-only inspection and genuine break-glass emergencies - because that’s what makes an environment repeatable, reviewable, and trustworthy at scale.
3.6 Troubleshooting: Console Drift
A frequent source of production incidents is “console drift”: someone makes a manual change in the Console to fix something quickly, and now the running infrastructure no longer matches the code that supposedly defines it. The next time the IaC pipeline runs, it may revert the manual fix (breaking things again) or, worse, the two diverge silently and nobody knows the true state. The disciplined fixes are to prohibit manual production changes except audited break-glass access, to make changes through the IaC pipeline so they’re reviewed and recorded, and to run drift detection that alerts when live infrastructure diverges from its definition. The goal is a single source of truth - the code - so the environment is always knowable and reproducible.
3.7 CloudShell, Credentials, and How Authentication Actually Works
Two practical details make the “how you interact with AWS” picture clearer and appear on the exams. First,AWS CloudShellis a browser-based shell in the console, pre-authenticated with your console identity and preloaded with the CLI and tools - handy for quick commands without configuring credentials locally. Second, and more important, ishow the CLI and SDKs find credentials: they use acredential provider chain, checking sources in order - environment variables, then shared config/credentials files (named profiles), then (on AWS compute) theinstance/role metadata. The key architectural point is that on AWS compute you should rely on the last of these: an attached IAM role supplies temporary credentials automatically via the instance metadata service, so the SDK’s default credential provider resolves them with no keys stored anywhere. Locally, developers use a named profile or SSO; in production, workloads use roles. Understanding this chain is why “the app uses a role, not access keys” works in practice - the SDK transparently obtains and refreshes role credentials from metadata.
# Named profiles let one machine assume different identities/accounts.
aws configure --profile bank-dev
aws s3 ls --profile bank-dev
# On EC2/ECS/Lambda, omit credentials entirely - the SDK reads the attached role from metadata.
aws sts get-caller-identity # confirms which identity the resolved credentials belong to
What are the ways to interact with AWS, and when is each appropriate?
There are four ways to interact with AWS, all of which ultimately call the same underlying service APIs, and choosing the right one is partly a question of engineering maturity. The Management Console is the web-based graphical interface, and it’s appropriate for learning a service, exploring its options, inspecting the state of resources, and one-off investigation during an incident; its limitation is that manual clicking isn’t repeatable, reviewable, or auditable, so it’s not where you build production infrastructure. The AWS CLI drives every service from the command line, which makes actions scriptable and repeatable - appropriate for automating operational tasks and composing steps in scripts and pipelines. The SDKs are language-specific libraries that let your application code call AWS services directly at runtime - appropriate when the application itself needs to use AWS, such as writing to S3, reading a secret, or publishing a message to a queue. Infrastructure as code - CloudFormation, the CDK, or Terraform - lets you declare your infrastructure in version-controlled templates that a tool provisions and updates, and it’s appropriate for all production infrastructure because it’s reproducible, peer-reviewed, and audited. The way I decide is by maturity and purpose: I use the Console to learn and to inspect, the CLI to automate operational tasks, SDKs where my application must call AWS, and IaC for anything that has to be repeatable and governed - which in a real environment is essentially all infrastructure. The senior principle is that production infrastructure should be defined in code and changed through pipelines, with the Console reserved for read-only inspection and break-glass emergencies, because that’s what delivers repeatability, review, and an audit trail. Doing production changes by clicking in the Console is the anti-pattern - it produces untracked, unreproducible, unauditable infrastructure, which is exactly what a regulated environment cannot accept. So the four interfaces aren’t interchangeable; they map to a progression from learning and inspection toward automated, code-defined, governed infrastructure.
Why is infrastructure as code important, especially in a regulated bank?
Infrastructure as code is important because it applies software-engineering discipline - version control, peer review, testing, and reproducibility - to infrastructure, which turns provisioning from a manual, error-prone, unauditable activity into a reliable, governed one. Concretely, defining infrastructure in declarative version-controlled templates means every change is peer-reviewed and recorded, so you know who changed what and why and can revert; environments are reproduced identically from the same code, which eliminates configuration drift and the “it works in staging but not production” class of problems; and the entire environment can be rebuilt from code, which makes disaster recovery a matter of re-running templates rather than hoping someone remembers the manual steps. It’s also idempotent - re-applying converges to the desired state and corrects drift. In a regulated bank these properties move from convenient to essential. Compliance requires demonstrable control and auditability of changes to systems that handle financial data, and IaC provides exactly that: a complete, reviewable history of every infrastructure change, enforced through a pipeline rather than left to individuals. It lets the bank guarantee that security controls - encryption on by default, no public exposure, correct network placement - are baked into the templates and applied consistently to every environment, rather than depending on an engineer remembering to tick a box. It supports separation of duties, because changes go through review and automated pipelines instead of direct human access to production. And it makes environments reproducible for testing and DR, which regulators expect. Compared with clicking in the Console, IaC removes untracked changes, prevents drift, and produces the audit trail and repeatability that both good engineering and financial regulation demand. The related discipline is preventing “console drift” - manual changes that make the live environment diverge from its code - by prohibiting unaudited manual production changes, routing all changes through the IaC pipeline, and running drift detection. So for a bank, IaC isn’t just an efficiency practice; it’s how you make infrastructure auditable, consistent, secure by default, and recoverable, which is precisely what a regulated institution is required to prove.
Chapter Revision Notes
- Four interfaces to AWS’s APIs: Console (UI), CLI (scripting), SDKs (application code), IaC (declarative templates).
- Console is for learning and inspection; not for building production infrastructure (not repeatable/auditable).
- CLI automates operational tasks; SDKs let applications call AWS at runtime - both governed by the same IAM model.
- IaC (CloudFormation/CDK/Terraform) provisions production infrastructure: version-controlled, reviewed, reproducible, auditable.
- Prevent “console drift” - prohibit unaudited manual changes, route changes through pipelines, run drift detection.