Configuring Amazon AWS S3 Replication Targets


  • Your environment meets the publishing prerequisites. See Publishing Prerequisites for details.
  • You added the replication target. See Adding Replication Targets for details.
  • You have at least one of the following:
    • Valid values for the required fields from a subject matter expert (SME)
    • Access to the Amazon AWS S3 service account

When you publish, the CMS can copy the published files to an Amazon S3 bucket. Administrators configure this replication in publishing targets by adding an Amazon AWS S3 replication target.

The CMS authenticates to AWS in one of three ways. Choose the authentication type that matches where your CMS server runs:

Authentication Types for Amazon AWS S3 Replication

Authentication TypeUse WhenCredentials Stored in the CMS
KeysNo Identity and Access Management (IAM) role option is available for your environment.An IAM user's access key and secret key.
IAM Role AttachmentThe CMS server runs on an Amazon Elastic Compute Cloud (Amazon EC2) instance.An IAM role Amazon Resource Name (ARN) only. The CMS uses the IAM role attached to the EC2 instance and stores no keys.
IAM Roles AnywhereThe CMS server runs outside AWS (on-premises or in another cloud), and your organization has a private certificate authority (CA).IAM Roles Anywhere ARNs, plus a certificate and private key that the CMS encrypts and stores. The CMS stores no AWS keys.
Tip
AWS recommends temporary credentials from IAM roles over long-term access keys. See IAM roles for details.
To configure an Amazon AWS S3 replication target:
  1. Grant the Amazon S3 permissions that the CMS needs.
  2. Prepare the AWS resources for your authentication type. Choose one of the following:
    Authentication TypeAction
    KeysSkip this step.
    IAM Role AttachmentSee Preparing AWS for IAM Role Attachment.
    IAM Roles AnywhereSee Preparing AWS for IAM Roles Anywhere.
  3. Add or edit the Amazon AWS S3 replication target in the CMS.

Granting Required S3 Permissions

Grant the CMS permission to list the Amazon S3 bucket and to add and remove objects in the bucket for whichever authentication type you use. The CMS needs the following Amazon S3 actions:

Amazon S3 Actions for Replication
ActionResourcePurpose
s3:ListBucketThe bucket ARN: arn:aws:s3:::bucket-nameList the bucket.
s3:PutObjectThe objects in the bucket: arn:aws:s3:::bucket-name/*Add objects to the bucket.
s3:DeleteObjectThe objects in the bucket: arn:aws:s3:::bucket-name/*Remove objects from the bucket.
  1. In the IAM console, create a permissions policy that grants the Amazon S3 actions.

    Use a policy similar to the following. Replace amzn-s3-demo-bucket with your bucket name.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "ListReplicationBucket",
          "Effect": "Allow",
          "Action": "s3:ListBucket",
          "Resource": "arn:aws:s3:::amzn-s3-demo-bucket"
        },
        {
          "Sid": "WriteReplicationObjects",
          "Effect": "Allow",
          "Action": [
            "s3:PutObject",
            "s3:DeleteObject"
          ],
          "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
        }
      ]
    }
    Note
    s3:ListBucket applies to the bucket ARN, while s3:PutObject and s3:DeleteObject apply to the objects in the bucket (/*). If the bucket uses server-side encryption with a customer managed AWS Key Management Service (AWS KMS) key, the role also needs permission to use that key. See Required permissions for Amazon S3 API operations for details.
  2. Attach the policy to the IAM principal based on the authentication type that the CMS uses.

    Attach the policy to the IAM user whose access key and secret key the CMS uses.

    Attach the policy to the replication role when you create the role in the next task.

    Attach the policy to the replication role when you create the role in the next task.

Task Troubleshooting: Access Denied when the CMS lists or writes to the bucket
The IAM role or IAM user is missing a permission, or the policy applies s3:ListBucket to bucket/* instead of the bucket ARN.

  • Add any missing permissions from the table to the IAM role or IAM user.
  • Apply s3:ListBucket to the bucket ARN, not to bucket/*.
The CMS writes replication errors to the CMS logs in Administration > Maintenance.

Choose Authentication Type to Prepare

The CMS authenticates to AWS in one of three ways. Choose the authentication type that matches where your CMS server runs.

Preparing AWS for Keys

No preparation needed. Skip this step and see Adding Amazon AWS S3 Replication Targets.

Preparing AWS for IAM Role Attachment

  • The CMS server runs on an Amazon EC2 instance.
  • The EC2 instance has an attached IAM role. This topic calls that role the instance role. See IAM Roles for Amazon EC2 for details.
  • CMS 10.6 must be installed. See CMS Statistics to check your site version.

Create and configure the IAM roles that the CMS needs to replicate to Amazon S3 from an Amazon EC2 instance without stored keys. With IAM Role Attachment, the CMS uses the instance role's credentials to assume a second IAM role, the replication role, which has access to the bucket. Both roles must allow the instance role to assume the replication role.

  1. In the IAM console, create the replication role.

    For example, name the role IngeniuxS3Replication.

  2. Attach the permissions policy from Granting Required S3 Permissions to the replication role.
  3. Set the replication role's Maximum session duration to 12 hours.

    The CMS requests a 12-hour session. If the role's maximum session duration is lower, AWS rejects the request. See Update the maximum session duration for a role for details.

  4. Edit the replication role's trust policy so that the instance role can assume the replication role.

    Replace the example ARN with your instance role's ARN.

    Example ARN for instance role
    {
                    "Version": "2012-10-17",
                    "Statement": [
                    {
                    "Effect": "Allow",
                    "Principal": { "AWS": "arn:aws:iam::111122223333:role/CmsEc2InstanceRole" },
                    "Action": "sts:AssumeRole"
                    }
                    ]
                    }
  5. Add a permissions policy to the instance role that allows the instance role to assume the replication role.

    Replace the example ARN with your replication role's ARN.

    Example ARN for replication role
    {
                    "Version": "2012-10-17",
                    "Statement": [
                    {
                    "Effect": "Allow",
                    "Action": "sts:AssumeRole",
                    "Resource": "arn:aws:iam::111122223333:role/IngeniuxS3Replication"
                    }
                    ]
                    }
  6. Copy the replication role's ARN.

    You enter this ARN in the IAM Role ARN field when you add the replication target.

Task Troubleshooting: Access Denied when the CMS assumes the role
The replication role's trust policy doesn't list the instance role, or the instance role is missing the sts:AssumeRole permission.

  • Add the instance role to the replication role's trust policy.
  • Grant the instance role the sts:AssumeRole permission for the replication role.
Requested DurationSeconds exceeds the maximum session duration
The replication role's Maximum session duration is less than 12 hours. Set the replication role's Maximum session duration to 12 hours. See Update the maximum session duration for a role.

Preparing AWS for IAM Roles Anywhere

Prerequisites

  • A private CA. Use AWS Private Certificate Authority or your own CA.
    Important
    You can't use certificates from public CAs, such as a website's Transport Layer Security (TLS) certificate, with IAM Roles Anywhere.
  • A certificate that the CA issued to the CMS server, and the matching private key, both in Privacy-Enhanced Mail (PEM) format.
  • CMS 10.6 must be installed. See CMS Statistics to check your site version.

Set up a trust anchor, an IAM role, and a profile so that the CMS can replicate to Amazon S3 from a server that runs outside AWS. With IAM Roles Anywhere, the CMS presents the server's certificate to AWS in exchange for temporary credentials for an IAM role. The CMS includes the required credential helper, so you don't need to install the credential helper.

Note
Create the trust anchor and profile in the same AWS account and Region.
  1. In the IAM Roles Anywhere console, create a trust anchor that references your CA.
    Note
    You configure the CA certificate in the trust anchor in AWS. Don't upload the CA certificate to the CMS.
  2. Copy the trust anchor ARN.
  3. In the IAM console, create the replication role.
  4. Attach the permissions policy from Granting Required S3 Permissions to the replication role.
  5. Edit the replication role's trust policy to trust IAM Roles Anywhere through your trust anchor.

    Replace the example ARN with your trust anchor ARN.

    Example ARN for trust anchor
    {
                    "Version": "2012-10-17",
                    "Statement": [
                    {
                    "Effect": "Allow",
                    "Principal": { "Service": "rolesanywhere.amazonaws.com" },
                    "Action": [
                    "sts:AssumeRole",
                    "sts:TagSession",
                    "sts:SetSourceIdentity"
                    ],
                    "Condition": {
                    "ArnEquals": {
                    "aws:SourceArn": "arn:aws:rolesanywhere:us-west-2:111122223333:trust-anchor/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
                    }
                    }
                    }
                    ]
                    }
    Tip
    AWS recommends adding conditions on the certificate's subject and issuer so that only the CMS server's certificate can assume the role. See IAM Roles Anywhere trust model for examples.
  6. In the IAM Roles Anywhere console, create a profile that includes the replication role.
  7. Copy the profile ARN.

    You now have the replication role ARN, trust anchor ARN, and profile ARN. Enter these values, along with the certificate and private key, when you add the replication target.

Task Troubleshooting: The CMS can't obtain credentials
One of the following causes applies:

  • The CA in the trust anchor didn't issue the certificate.
  • The certificate expired.
  • The trust anchor ARN, profile ARN, or role ARN is incorrect.
  • The aws:SourceArn value in the role's trust policy doesn't match the trust anchor ARN.
To resolve the error:
  • Verify that the CA in the trust anchor issued the certificate and that the certificate is current.
  • Verify the trust anchor ARN, profile ARN, and role ARN in the replication target.
  • Verify that aws:SourceArn in the role's trust policy matches the trust anchor ARN.

Adding Amazon AWS S3 Replication Targets

Note
For help configuring the fields, see Amazon S3 Documentation.
  1. In the Replication tab, expand the Amazon AWS S3 replication target.
  2. In Name, enter a name for the replication target.
  3. Optional: In Description, enter a description of the replication target.
  4. From the Region End Point drop-down list, select the region endpoint.

    The region endpoint is the URL that serves as the entry point for the web service. Resources in each region are independent.

  5. In Bucket, enter the bucket name.

    Bucket names are globally unique, regardless of the AWS Region that contains the bucket.

  6. From the Authentication Type drop-down list, select the authentication type.

    The default is Keys. The fields that display next depend on the authentication type you select.

  7. Enter the credentials for the selected authentication type:

    FieldDescription
    Access KeyA 20-character alphanumeric string, such as AKIAIOSFODNN7EXAMPLE
    Secret KeyA 40-character string, such as wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEK

    Amazon AWS S3 replication target with the Keys authentication type selected,
                  showing the Access Key and Secret Key fields

    FieldDescription
    IAM Role ARNThe replication role's ARN, such as arn:aws:iam::111122223333:role/IngeniuxS3Replication

    Amazon AWS S3 replication target with the IAM Role Attachment authentication
                  type selected, showing the IAM Role ARN field

    Version Notes: CMS 10.6
    This authentication type is only available in CMS 10.6.
    FieldDescription
    IAM Role ARNThe replication role's ARN, such as arn:aws:iam::111122223333:role/IngeniuxS3Replication
    IAM Role Anywhere Trust Anchor ARNThe trust anchor ARN
    IAM Role Anywhere Profile ARNThe profile ARN
    IAM Role Anywhere CertificateClick Upload, then select the CMS server's certificate file in PEM format (.pem or .txt).
    IAM Role Anywhere Private KeyClick Upload, then select the matching private key file in PEM format (.pem or .txt).

    The CMS encrypts and stores the uploaded certificate and private key.

    Amazon AWS S3 replication target with the IAM Roles Anywhere authentication
                  type selected, showing the IAM Role ARN, trust anchor ARN, profile ARN,
                  certificate, and private key fields

    Version Notes: CMS 10.6
    This authentication type is only available in CMS 10.6.
  8. In Root Path, enter the replication location, starting with a forward slash (/).

    The root path begins at the root of the AWS site and uses forward slashes as delimiters. You can create a new folder for the root path.

  9. Click Save in the top-right corner of the Manage Publishing Targets pane.

Next Steps: To configure exempt locations, additional locations, cleanup exclusions, and custom commands for the replication target, see Advanced Settings.