Extensions
You can now change what Alien deploys without waiting for Alien to support a setting. An extension is Rust code that ships in your release. This one keeps every Postgres cluster's backups for 30 days in the CloudFormation template Alien generates:
use alien_extension_sdk::prelude::*;
struct CloudFormation;
impl CloudFormationModifier for CloudFormation {
fn modify(&self, mut template: CfTemplate) -> Result<CfTemplate> {
for cluster in template.resources_of_type_mut("AWS::RDS::DBCluster") {
cluster.set_property("BackupRetentionPeriod", 30);
}
Ok(template)
}
}
fn register(ext: &mut Extension) {
ext.cloudformation_modifier(CloudFormation);
}
alien_extension_sdk::export!("backups", register);alien extensions build writes the bundle and a module your stack imports,
then .extensions([backups]) in alien.ts adds it to the stack, and
alien release ships it pinned by digest.
- Template modifiers: change the CloudFormation, Terraform, or Helm chart Alien generates for initial setup. A modifier can add resources and change properties, and the build fails if it removes, hides, or retypes a resource Alien emits
- Interceptors: change a request Alien's AWS, Google Cloud, Azure, or Kubernetes clients send, before Alien signs it. An interceptor never sees credentials and can't change where a call goes, which operation it runs, which identity it names, or who can reach a resource
- Custom resources: add a resource type with its own template parts, permissions, and controller, used in
alien.tslike any Alien resource - Sandboxed: hooks and controllers build to WebAssembly modules that hold no credentials. Hooks have no network. Alien signs and sends each cloud call a controller makes, and besides its cloud a controller reaches only the origins it declares
- Unsigned releases: in a project that signs its releases, a release that lists extensions goes out unsigned, and
alien releaserefuses to promote it to a channel that protected deployments follow - Setup CLI: it refuses a release whose extensions ship interceptors; set those deployments up from the setup template, or with the Alien manager or the Operator