// Adds a permission to a queue for a specific principal
// (https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P). This allows
// sharing access to the queue. When you create a queue, you have full control
// access rights for the queue. Only you, the owner of the queue, can grant or deny
// permissions to the queue. For more information about these permissions, see
// Allow Developers to Write Messages to a Shared Queue
// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue)
// in the Amazon Simple Queue Service Developer Guide.
//
// * AddPermission generates a
// policy for you. You can use SetQueueAttributes to upload your policy. For more
// information, see Using Custom Policies with the Amazon SQS Access Policy
// Language
// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html)
// in the Amazon Simple Queue Service Developer Guide.
//
// * An Amazon SQS policy can
// have a maximum of 7 actions.
//
// * To remove the ability to change queue
// permissions, you must deny permission to the AddPermission, RemovePermission,
// and SetQueueAttributes actions in your IAM policy.
//
// Some actions take lists of
// parameters. These lists are specified using the param.n notation. Values of n
// are integers starting from 1. For example, a parameter list with two elements
// looks like this: &AttributeName.1=first&AttributeName.2=second Cross-account
// permissions don't apply to this action. For more information, see Grant
// cross-account permissions to a role and a user name
// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name)
// in the Amazon Simple Queue Service Developer Guide.
Adds a permission to a queue for a specific principal
. This allows
sharing access to the queue. When you create a queue, you have full control
access rights for the queue. Only you, the owner of the queue, can grant or deny
permissions to the queue. For more information about these permissions, see
Allow Developers to Write Messages to a Shared Queue

in the Amazon Simple Queue Service Developer Guide.

AddPermission generates a
policy for you. You can use SetQueueAttributes to upload your policy. For more
information, see Using Custom Policies with the Amazon SQS Access Policy
Language

in the Amazon Simple Queue Service Developer Guide.

An Amazon SQS policy can
have a maximum of 7 actions.

To remove the ability to change queue
permissions, you must deny permission to the AddPermission, RemovePermission,
and SetQueueAttributes actions in your IAM policy.

Some actions take lists of
parameters. These lists are specified using the param.n notation. Values of n
are integers starting from 1. For example, a parameter list with two elements
looks like this: &AttributeName.1=first&AttributeName.2=second Cross-account
permissions don't apply to this action. For more information, see Grant
cross-account permissions to a role and a user name

in the Amazon Simple Queue Service Developer Guide.
// Adds a permission to a queue for a specific principal // ( https : // docs . aws . amazon . com / general / latest / gr / glos - chap . html#P ) . This allows // sharing access to the queue . When you create a queue you have full control // access rights for the queue . Only you the owner of the queue can grant or deny // permissions to the queue . For more information about these permissions see // Allow Developers to Write Messages to a Shared Queue // ( https : // docs . aws . amazon . com / AWSSimpleQueueService / latest / SQSDeveloperGuide / sqs - writing - an - sqs - policy . html#write - messages - to - shared - queue ) // in the Amazon Simple Queue Service Developer Guide . // // * AddPermission generates a // policy for you . You can use SetQueueAttributes to upload your policy . For more // information see Using Custom Policies with the Amazon SQS Access Policy // Language // ( https : // docs . aws . amazon . com / AWSSimpleQueueService / latest / SQSDeveloperGuide / sqs - creating - custom - policies . html ) // in the Amazon Simple Queue Service Developer Guide . // // * An Amazon SQS policy can // have a maximum of 7 actions . // // * To remove the ability to change queue // permissions you must deny permission to the AddPermission RemovePermission // and SetQueueAttributes actions in your IAM policy . // // Some actions take lists of // parameters . These lists are specified using the param . n notation . Values of n // are integers starting from 1 . For example a parameter list with two elements // looks like this : &AttributeName . 1 = first&AttributeName . 2 = second Cross - account // permissions don ' t apply to this action . For more information see Grant // cross - account permissions to a role and a user name // ( https : // docs . aws . amazon . com / AWSSimpleQueueService / latest / SQSDeveloperGuide / sqs - customer - managed - policy - examples . html#grant - cross - account - permissions - to - role - and - user - name ) // in the Amazon Simple Queue Service Developer Guide .
func (c *Client) AddPermission(ctx context.Context, params *AddPermissionInput, optFns ...func(*Options)) (*AddPermissionOutput, error) {
	if params == nil {
		params = &AddPermissionInput{}
	}
	result, metadata, err := c.invokeOperation(ctx, "AddPermission", params, optFns, addOperationAddPermissionMiddlewares)
	if err != nil {
		return nil, err
	}
	out := result.(*AddPermissionOutput)
	out.ResultMetadata = metadata
	return out, nil
}
func ( c * Client ) AddPermission ( ctx context . Context , params * AddPermissionInput , optFns ... func ( * Options ) ) ( * AddPermissionOutput , error ) { if params == nil { params = & AddPermissionInput { } } result , metadata , err := c . invokeOperation ( ctx , " " , params , optFns , addOperationAddPermissionMiddlewares ) if err != nil { return nil , err } out := result . ( * AddPermissionOutput ) out . ResultMetadata = metadata return out , nil }
Adds a permission to a queue for a specific principal
.
Adds a permission to a queue for a specific principal .