Creating a IAM policy for client access in AWS

,

Hi
Im looking to create a client policy for accessing the API gateway that serverless has created.
As this is going to be referenced in other projects (roles/ groups) id like to create this with a static name that will not change,

Currently when i create it serverless puts a random string on the end. Is it possible to change this to a fixed name or at least a non changing suffix?

An extract of my serverless.yml is below (resource removed)

Resources:
client-policy:
Type: AWS::IAM::ManagedPolicy
Properties:
Description: “Client Policy”
PolicyDocument:
Version: “2012-10-17”
Statement:
-
Sid: “firstPermission”
Effect: Allow
Action:
- execute-api:Invoke
Resource:
- *

For anyone attempting this idea the solution was to add a ManagedPolicyName to the resource.
this makes serverless/cloudformation create policy versions on an existing policy

1 Like