Transfer / Client / create_agreement
create_agreement#
- Transfer.Client.create_agreement(**kwargs)#
Creates an agreement. An agreement is a bilateral trading partner agreement, or partnership, between an Transfer Family server and an AS2 process. The agreement defines the file and message transfer relationship between the server and the AS2 process. To define an agreement, Transfer Family combines a server, local profile, partner profile, certificate, and other attributes.
The partner is identified with the
PartnerProfileId
, and the AS2 process is identified with theLocalProfileId
.See also: AWS API Documentation
Request Syntax
response = client.create_agreement( Description='string', ServerId='string', LocalProfileId='string', PartnerProfileId='string', BaseDirectory='string', AccessRole='string', Status='ACTIVE'|'INACTIVE', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
- Parameters:
Description (string) – A name or short description to identify the agreement.
ServerId (string) –
[REQUIRED]
A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
LocalProfileId (string) –
[REQUIRED]
A unique identifier for the AS2 local profile.
PartnerProfileId (string) –
[REQUIRED]
A unique identifier for the partner profile used in the agreement.
BaseDirectory (string) –
[REQUIRED]
The landing directory (folder) for files transferred by using the AS2 protocol.
A
BaseDirectory
example is/DOC-EXAMPLE-BUCKET/home/mydirectory
.AccessRole (string) –
[REQUIRED]
Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.
For AS2 connectors
With AS2, you can send files by calling
StartFileTransfer
and specifying the file paths in the request parameter,SendFilePaths
. We use the file’s parent directory (for example, for--send-file-paths /bucket/dir/file.txt
, parent directory is/bucket/dir/
) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, theAccessRole
needs to provide read and write access to the parent directory of the file location used in theStartFileTransfer
request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send withStartFileTransfer
.If you are using Basic authentication for your AS2 connector, the access role requires the
secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs thekms:Decrypt
permission for that key.For SFTP connectors
Make sure that the access role provides read and write access to the parent directory of the file location that’s used in the
StartFileTransfer
request. Additionally, make sure that the role providessecretsmanager:GetSecretValue
permission to Secrets Manager.Status (string) – The status of the agreement. The agreement can be either
ACTIVE
orINACTIVE
.Tags (list) –
Key-value pairs that can be used to group and search for agreements.
(dict) –
Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called
Group
and assign the valuesResearch
andAccounting
to that group.Key (string) – [REQUIRED]
The name assigned to the tag that you create.
Value (string) – [REQUIRED]
Contains one or more values that you assigned to the key name you create.
- Return type:
dict
- Returns:
Response Syntax
{ 'AgreementId': 'string' }
Response Structure
(dict) –
AgreementId (string) –
The unique identifier for the agreement. Use this ID for deleting, or updating an agreement, as well as in any other API calls that require that you specify the agreement ID.
Exceptions
Transfer.Client.exceptions.ServiceUnavailableException
Transfer.Client.exceptions.InternalServiceError
Transfer.Client.exceptions.InvalidRequestException
Transfer.Client.exceptions.ResourceExistsException
Transfer.Client.exceptions.ResourceNotFoundException
Transfer.Client.exceptions.ThrottlingException