[AWSGuard](https://github.com/pulumi/pulumi-policy-aws) codifies best practices for AWS. It is an [open source](https://github.com/pulumi/pulumi-policy-aws) library that you can configure and use to enforce these best practices for your own Pulumi stacks or organization.
### Authoring a Policy Pack that uses AWSGuard policies
To use AWSGuard policies, you must create a Policy Pack that references the `@pulumi/awsguard` npm package and creates a new instance of the `AwsGuard` class.
1. Create a directory for your new Policy Pack, and change into it.
1. Tweak the code in the `index.ts` file as desired. The default implementation provided by the `awsguard-typescript` template creates a new instance of `AwsGuard` with all policies set to have an enforcement level of advisory.
Policy Packs can be tested on a user's local workstation to facilitate rapid development and testing of policies.
1. Run `npm install` in the Policy Pack directory.
1. Use the `--policy-pack` flag with `pulumi preview` or `pulumi up` to specify the path to the directory containing your Policy Pack when previewing/updating a Pulumi program.
If you don’t have a Pulumi program readily available, you can create a new project for testing by running `pulumi new aws-typescript` in an empty directory. This AWS example will create an S3 bucket, which is perfect for testing our Policy.
If the stack is not in compliance, the policy violation will be displayed. Since the enforcement level for all policies are set to advisory, a warning is shown for any resources that are not in compliance with the AWSGuard policies. In this case, logging must be defined for S3 buckets.
Once you've validated the behavior of the AWSGuard policies you've configured in your Policy Pack, an organization administrator can publish the Policy Pack to the Pulumi Cloud to be enforced across your organization. To learn more see [Enforcing a Policy Pack Across an Organization](/docs/using-pulumi/crossguard/get-started#enforcing-a-policy-pack).
Now that you've seen how to configure and use AWSGuard policies, you may want to write your own policies. See the [Getting Started tutorial](/docs/using-pulumi/crossguard/get-started/) to get started.