From 266b5e7dbc7735e582dfb50f6891618b75d9a030 Mon Sep 17 00:00:00 2001 From: Jay V Date: Sat, 19 Oct 2024 16:30:44 -0400 Subject: [PATCH] docs: edit iam edit helper --- platform/src/components/aws/iam-edit.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/src/components/aws/iam-edit.ts b/platform/src/components/aws/iam-edit.ts index 0612f60a1..1b8a95208 100644 --- a/platform/src/components/aws/iam-edit.ts +++ b/platform/src/components/aws/iam-edit.ts @@ -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}/*`, * }); * });