How do I integrate Attini with other tooling?
Attini has two components, the CLI and the Framework. The Attini CLI will package your code and start deployments, and the Attini framework will run the deployments for you.
Because you can install the Attini CLI anywhere, you can manage Attini from anywhere.
The Attini framework has no external dependencies and can provision containers inside your environment, meaning it can run any deployment-tools you need.
With the Attini CLI you can package your code and initiate deployments.
The Attini CLI is installed with a one-line shell command in about 2-5 seconds, and it can be installed on your workstation or your build server. The CLI can be installed on Linux and macOS and supports amd64 and arm64 CPU architectures. For Windows users, we recommend to use WSL to run the CLI.
To deploy your code, the Attini CLI only needs AWS IAM credentials.
You can easily extend your current toolset with Attini, just install the Attini CLI on your build images/worker nodes.
The Attini CLI will follow/tail your deployments and use Unix exit codes. So when a deployment fails, the CLI will return a non 0 response. The Attini CLI will print deployment progress, logs, and errors as standard output so your logs will end up in the right place.
This means that Attini will fit into your current deployment tools (Github Actions, GitLab Runners, Jenkins, Azure DevOps etc.) out of the box.
The Attini framework is installed in your AWS Account, and it can run on-demand containers and other cloud services within your environments and networks.
So Attini can easily deploy anything you need, for example:
With Attini you can deploy any technology, either using one of the standard steps or a customer runner.
Attini has some standard steps for common technologies like SAM, CDK and CloudFormation. We are constantly building support for additional technologies based on feature requests (get in touch here).
Using the Attini Runner, you can run your own scripts on your own image, with a custom IAM role within your VPC so that you can easily deploy any technology you need. The Runner will pre-fetch your files and interact with the deployment pipeline/payload. This makes it is easy to run any code, and integrate different technologies.
You can run Attini anywhere, you just need the Attini CLI and AWS Credentials.
Open a terminal and run:
attini deploy run . -e dev -cb
When the deploy run
command points to a directory like in the above example, it will do
a package
and deploy
directly.
The -e / --environment
option lets you set the target environment.
The -cb / --container-build
option lets you package using a container.
name: Attini example
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'main'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::111111111111:role/GitHubRole
aws-region: eu-west-1
role-session-name: DeployFromGithub
- name: Package and deploy Attini project
shell: bash
run: |
# Install Attini CLI
/bin/bash -c "$(curl -fsSL https://docs.attini.io/blob/attini-cli/install-cli.sh)"
# Package the distribution
attini distribution package .
# Upload to S3
aws s3 cp attini_dist/hello-world.zip s3://my-repository-bucket/hello-world.zip
# Deploy
attini deploy run s3://my-repository-bucket/hello-world.zip --environment development
Find more information on how to configure AWS Credentials for GitHub Actions here.
# Use an image with the Attini CLI installed. You can use our own image, or the official Attini CLI image.
image: public.ecr.aws/attini/attini-cli:latest
stages:
- Deploy
variables:
AWS_REGION: eu-west-1
AWS_ACCOUNT: "111111111111"
deploy:
stage: Deploy
before_script:
# Assume AWS IAM Role
- >
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s"
$(aws sts assume-role-with-web-identity
--role-arn "arn:aws:iam::${AWS_ACCOUNT}:role/GitLabRole"
--role-session-name "DeployFromGitLab-${CI_PROJECT_ID}-${CI_PIPELINE_ID}"
--web-identity-token $CI_JOB_JWT_V2
--query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]'
--output text))
script:
# Package the distribution
attini distribution package .
# Upload to S3
aws s3 cp attini_dist/hello-world.zip s3://my-repository-bucket/hello-world.zip
# Deploy
attini deploy run s3://my-repository-bucket/hello-world.zip --environment development
Find more information on how to configure AWS Credentials for GitLab here.
The different Attini deployment plan types you can deploy anything.
Learn more about the different types, see our guides
Find a full example here.
The pipeline (DeploymentPlan) can be written in CloudFormation or using a programming language supported by the Attini CDK constructs.
The following DeploymentPlan will deploy a CDK application.
Resources:
DeploymentPlan:
Type: Attini::Deploy::DeploymentPlan
Properties:
DeploymentPlan:
- Name: MyCdkDeploy
Type: AttiniCdk
Properties:
Path: ./
Diff:
Enabled: true
When the Diff
is enabled, changes will require a
manual approval.
Attini doesn’t have a managed step for Terraform yet, but we can still use the Attini Runner to manage Terraform deployments using the Terraform CLI.
The Attini runner will provision an ECS task in our AWS account which can run terraform apply
for us.
The runner automatically:
Resources:
DeploymentPlan:
Type: Attini::Deploy::DeploymentPlan
Properties:
DeploymentPlan:
- Name: TerraformApply
Type: AttiniRunnerJob
Properties:
Commands:
- terraform apply -auto-approve -var-file=vars/${TF_WORKSPACE}.tfvars
- terraform output --json | jq 'map_values(.value)' > ${ATTINI_OUTPUT}