WHAT YOU'LL LEARN
  • how to apply tags to all AWS resources deployed by Webiny

Overview
anchor

AWS tags are key-value pairs attached to resources, commonly used for cost allocation, ownership tracking, and automation. You can apply tags to all Webiny-deployed resources via webiny.config.tsx.

Adding Tags
anchor

Use Infra.Aws.Tags in webiny.config.tsx:

webiny.config.tsx
import React from "react";
import { Infra } from "webiny/extensions";

export const Extensions = () => {
  return (
    <>
      <Infra.Aws.Tags tags={{ OWNER: "my-team", PROJECT: "my-project" }} />
    </>
  );
};

Infra.Aws.Tags can be used multiple times — tags from all instances are merged:

webiny.config.tsx
<Infra.Aws.Tags tags={{ OWNER: "my-team" }} />
<Infra.Aws.Tags tags={{ PROJECT: "my-project", ENV: "dev" }} />

Redeploying After Changes
anchor

After making changes, redeploy by running the webiny deploy command:

yarn webiny deploy

Use --env <name> to target a specific environment if needed.