Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
docs: edit iam edit helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Oct 19, 2024
1 parent 102f4bc commit 266b5e7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions platform/src/components/aws/iam-edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ type PartialUnwrappedPolicyDocument = {
};

/**
* The AWS IAM Edit helper is used to modify the AWS IAM policy.
* A helper to modify the AWS IAM policy.
*
* The IAM policy document is normally in the form of a JSON string. This helper decodes
* the string into a JSON object and allows you to modify the policy document in a type-safe
* manner.
* the string into a JSON object and passes it to the callback. Allowing you to modify the
* policy document in a type-safe way.
*
* @example
*
* ```ts {4}
* For example, this comes in handy when you are transforming the policy of a component.
*
* ```ts title="sst.config.ts" "sst.aws.iamEdit"
* new sst.aws.Bucket("MyBucket", {
* transform: {
* policy: (args) => {
* args.policy = sst.aws.iamEdit(args.policy, (policy) => {
* policy.Statement.push({
* Effect: "Allow",
* Principal: { Service: "ses.amazonaws.com" },
* Action: "s3:PutObject",
* Principal: { Service: "ses.amazonaws.com" },
* Resource: $interpolate`arn:aws:s3:::${args.bucket}/*`,
* });
* });
Expand Down

0 comments on commit 266b5e7

Please sign in to comment.